diff --git a/nezha-fronted/src/components/chart/ChartScreenHeader.vue b/nezha-fronted/src/components/chart/ChartScreenHeader.vue index 21ec07214..f35058614 100644 --- a/nezha-fronted/src/components/chart/ChartScreenHeader.vue +++ b/nezha-fronted/src/components/chart/ChartScreenHeader.vue @@ -207,8 +207,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 9b245b335..35fd27f74 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/dashboardTab.vue @@ -875,10 +875,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 6fb0358dd..f3946b820 100644 --- a/nezha-fronted/src/components/page/dashboard/dashboard.vue +++ b/nezha-fronted/src/components/page/dashboard/dashboard.vue @@ -1168,15 +1168,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() @@ -1250,12 +1249,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() + }) } }, // 监听图表联动配置