diff --git a/nezha-fronted/src/components/page/dashboard/chartBox.vue b/nezha-fronted/src/components/page/dashboard/chartBox.vue index 8412438b7..39989e417 100644 --- a/nezha-fronted/src/components/page/dashboard/chartBox.vue +++ b/nezha-fronted/src/components/page/dashboard/chartBox.vue @@ -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; + } } } } diff --git a/nezha-fronted/src/components/page/dashboard/explore/explore.vue b/nezha-fronted/src/components/page/dashboard/explore/explore.vue index db508be6a..810c65ad6 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/explore.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/explore.vue @@ -191,7 +191,7 @@ instance_cpu_time_ns{app="fox", proc="widget", rev="4d3a513", env="prod", job="c - +