From 8ae84248aa3f971c4549f2350cc3868916dead33 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Thu, 4 Aug 2022 09:59:56 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-2099=20fix=EF=BC=9A=20=E6=96=B0=E5=BB=BASys?= =?UTF-8?q?tem=E5=9B=BE=E8=A1=A8=E6=97=B6=E8=AE=BE=E7=BD=AE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=BALegend=EF=BC=8C=E9=A2=84=E8=A7=88=E6=97=B6?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/chart/chartMixin.js | 4 +++- .../common/rightBox/chart/chartRightBox.vue | 21 +++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/nezha-fronted/src/components/chart/chartMixin.js b/nezha-fronted/src/components/chart/chartMixin.js index ea584de2b..ba60739e1 100644 --- a/nezha-fronted/src/components/chart/chartMixin.js +++ b/nezha-fronted/src/components/chart/chartMixin.js @@ -333,7 +333,9 @@ export default { deep: true, handler (n) { if (n) { - this.initChart && this.initChart(this.chartOption) + this.$nextTick(() => { + this.initChart && this.initChart(this.chartOption) + }) } } } diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue index fc0836e3e..1f4b36d31 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue @@ -120,6 +120,8 @@ :modal-append-to-body="false" > { + this.prevChart = '' + setTimeout(()=>{ const start = new Date().setHours(new Date().getHours() - 1) const end = new Date() this.timeRange = [bus.computeTimezoneTime(start), bus.computeTimezoneTime(end)] - setTimeout(() => { - this.prevChart = lodash.cloneDeep(this.editChart) - this.prevChart.loaded = true - this.prevChart.param.showHeader = true - }) - }) + this.prevChart = { + ...lodash.cloneDeep(this.editChart), + loaded: true + } + this.prevChart.param.showHeader = true + }, 200) } + this.previewShow = show } }, created () {