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() + }) } }, // 监听图表联动配置