fix:explore save chart 失效修复

This commit is contained in:
wangwenrui
2020-05-25 17:15:14 +08:00
parent a838649591
commit 468237e91f
2 changed files with 21 additions and 11 deletions

View File

@@ -360,6 +360,11 @@
'chart-metric':ChartMetric,
'chart-preview':chartPreview,
},
mounted() {
this.$nextTick(()=>{
console.log(!this.isUrl && !this.isSingleStat)
})
},
methods: {
show(show) {
if(this.showPanel){
@@ -574,7 +579,7 @@
addCharts(params) {
let panelId;
//先处理panel
if (this.showPanel.type) {
if (this.showPanel&&this.showPanel.type) {
panelId = this.panelData[0].id;
} else {
panelId = this.autocompleteExist(this.panelName2);
@@ -813,7 +818,9 @@
});
} else {
console.log(this.$refs)
this.$nextTick(() => {
this.$refs.chartTag[0].setMdata(elementInfo.elements[0]);
});
}
@@ -1023,14 +1030,16 @@
deep: true,
immediate: true,
handler(n, o) {
if (!this.showPanel.type) {
if (this.selectFirstPanel) {
this.selectFirstPanel = false;
this.panelId = n[0].id;
} else if (this.panelName) {
for (let i = 0; i < n.length; i++) {
if (n[i].name == this.panelName) {
this.panelId = n[i].id;
if(this.showPanel){
if (!this.showPanel.type) {
if (this.selectFirstPanel) {
this.selectFirstPanel = false;
this.panelId = n[0].id;
} else if (this.panelName) {
for (let i = 0; i < n.length; i++) {
if (n[i].name == this.panelName) {
this.panelId = n[i].id;
}
}
}
}