From 22dfe521fd6b59d21f2a67cb4bf7dae3154a2ff6 Mon Sep 17 00:00:00 2001 From: zyh Date: Wed, 18 Sep 2024 18:12:10 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-3500=20fix:=20=E5=9B=BE=E8=A1=A8=E5=85=A8?= =?UTF-8?q?=E5=B1=8F=EF=BC=8C=E6=9F=A5=E8=AF=A2=E6=8C=87=E6=A0=87=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=8C=83=E5=9B=B4=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/chart/chartList.vue | 5 +++++ nezha-fronted/src/components/chart/panelChart.vue | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/nezha-fronted/src/components/chart/chartList.vue b/nezha-fronted/src/components/chart/chartList.vue index 819882d86..38b6dd19c 100644 --- a/nezha-fronted/src/components/chart/chartList.vue +++ b/nezha-fronted/src/components/chart/chartList.vue @@ -56,6 +56,7 @@ :chart-info="item" :from="from" :time-range="timeRange" + :nowTimeType="nowTimeType" @groupShow="groupShow" :isExportHtml="isExportHtml" :dataJson="dataJson" @@ -96,6 +97,7 @@ :dataJson="dataJson" :panelLock="panelLock" :time-range="timeRange" + :nowTimeType="nowTimeType" @showFullscreen="showFullscreen" > @@ -120,6 +122,9 @@ export default { dashboardId: {}, chartDetailInfo: Object, timeRange: Array, // 时间范围 + nowTimeType: { + type: Object + }, isGroup: Boolean, groupInfo: {}, from: String, diff --git a/nezha-fronted/src/components/chart/panelChart.vue b/nezha-fronted/src/components/chart/panelChart.vue index a0e5f6ed5..f10a03d8e 100644 --- a/nezha-fronted/src/components/chart/panelChart.vue +++ b/nezha-fronted/src/components/chart/panelChart.vue @@ -228,13 +228,12 @@ export default { const now = new Date(bus.computeTimezone(new Date().getTime())) const origin = new Date(bus.timeFormate(bus.formateTimeToTime(this.timeRange[1]), 'YYYY-MM-DD HH:mm:ss')) const numInterval = now.getTime() - origin.getTime() - let nowTimeType = this.$route.query.nowTimeType + let nowTimeType = this.nowTimeType + console.log(nowTimeType) if (!nowTimeType) { nowTimeType = { value: 1 } - } else { - nowTimeType = JSON.parse(nowTimeType) } if (numInterval >= 15000 && nowTimeType.value !== -1) { // 大于1分钟,则start、end均往后移numInterval,否则时间不变 startTime = bus.getNewTime(bus.formateTimeToTime(this.timeRange[0]), numInterval, 'YYYY-MM-DD HH:mm:ss')