From b8746e9459ad7b0feecb61481f37dd048c5a18e7 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 21 Jul 2023 11:59:28 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-3006=20fix=EF=BC=9AExplorer=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E5=9B=BE=E8=A1=A8=20preview=20=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=99=A8=E5=87=BA=E7=8E=B0invalid=20date?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/chart/ChartScreenHeader.vue | 4 ++-- .../common/bottomBox/tabs/dashboardTab.vue | 8 +++---- .../components/page/dashboard/dashboard.vue | 23 ++++++++++--------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/nezha-fronted/src/components/chart/ChartScreenHeader.vue b/nezha-fronted/src/components/chart/ChartScreenHeader.vue index 6271427ea..2ebf8242b 100644 --- a/nezha-fronted/src/components/chart/ChartScreenHeader.vue +++ b/nezha-fronted/src/components/chart/ChartScreenHeader.vue @@ -205,8 +205,8 @@ export default { this.$refs.pickTime.$refs.timePicker.setCustomTime(this.nowType) this.setSearchTime(this.nowType.type, this.nowType.value, this.nowType) } else { - this.$refs.pickTime.$refs.timePicker.setCustomTime(this.nowTimeType) - this.setSearchTime(this.nowType.type, this.nowType.value, this.nowTimeType) + this.$refs.pickTime.$refs.timePicker.setCustomTime(this.nowType) + this.setSearchTime(this.nowType.type, this.nowType.value, this.nowType) } } } diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue index 05e7b8970..3a88d6588 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue @@ -865,10 +865,10 @@ export default { time: this.searchTime, nowTimeType: this.nowTimeType }) - this.$store.dispatch('dispatchTimePickerRange', { - time: this.searchTime, - nowTimeType: this.nowTimeType - }) + // this.$store.dispatch('dispatchTimePickerRange', { + // time: this.searchTime, + // nowTimeType: this.nowTimeType + // }) }) }, setTimePickerRange () { diff --git a/nezha-fronted/src/components/page/dashboard/dashboard.vue b/nezha-fronted/src/components/page/dashboard/dashboard.vue index f6902f5f2..277ada2b6 100644 --- a/nezha-fronted/src/components/page/dashboard/dashboard.vue +++ b/nezha-fronted/src/components/page/dashboard/dashboard.vue @@ -1154,15 +1154,14 @@ export default { time: this.searchTime, nowTimeType: this.nowTimeType }) - this.$store.dispatch('dispatchTimePickerRange', { - time: this.searchTime, - nowTimeType: this.nowTimeType - }) + // this.$store.dispatch('dispatchTimePickerRange', { + // time: this.searchTime, + // nowTimeType: this.nowTimeType + // }) }) }, setTimePickerRange () { this.$nextTick(() => { - console.log(13123213,this.timePickerLocked, this.timePickerRange.nowTimeType) if (this.$route.query.searchTime) return if (!this.timePickerLocked || !this.timePickerRange.nowTimeType) { this.setDefaultTimeRange() @@ -1236,12 +1235,14 @@ export default { watch: { showPanel: { handler () { - if (this.timePickerLocked && this.timePickerRange && this.timePickerRange.nowTimeType) { - this.setTimePickerRange() - } else { - this.setDefaultTimeRange() - } - this.setDefaultRefresh() + this.$nextTick(() => { + if (this.timePickerLocked && this.timePickerRange && this.timePickerRange.nowTimeType) { + this.setTimePickerRange() + } else { + this.setDefaultTimeRange() + } + this.setDefaultRefresh() + }) } }, // 监听图表联动配置