diff --git a/nezha-fronted/src/components/chart/ChartScreenHeader.vue b/nezha-fronted/src/components/chart/ChartScreenHeader.vue index 76dfb5424..aa30839a4 100644 --- a/nezha-fronted/src/components/chart/ChartScreenHeader.vue +++ b/nezha-fronted/src/components/chart/ChartScreenHeader.vue @@ -105,7 +105,7 @@ export default { if (this.$refs.pickTime.$refs.multipleTime && !this.$refs.pickTime.$refs.multipleTime.showDropdown) { multipleTime = '' } - this.$emit('dateChange', this.filter, multipleTime) + this.$emit('dateChange', this.filter, multipleTime, nowTimeType) }, 100) }, closeDialog () { diff --git a/nezha-fronted/src/components/chart/panelChart.vue b/nezha-fronted/src/components/chart/panelChart.vue index f10a03d8e..b8ca1e1e2 100644 --- a/nezha-fronted/src/components/chart/panelChart.vue +++ b/nezha-fronted/src/components/chart/panelChart.vue @@ -229,7 +229,6 @@ export default { 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.nowTimeType - console.log(nowTimeType) if (!nowTimeType) { nowTimeType = { value: 1 diff --git a/nezha-fronted/src/components/common/alert/alertMessageInfo.vue b/nezha-fronted/src/components/common/alert/alertMessageInfo.vue index 89f1d1897..d771faff7 100644 --- a/nezha-fronted/src/components/common/alert/alertMessageInfo.vue +++ b/nezha-fronted/src/components/common/alert/alertMessageInfo.vue @@ -126,7 +126,7 @@ export default { }, methods: { isGroup, - dateChange (filter, multipleTime) { + dateChange (filter, multipleTime, nowTimeType) { this.loading = true // TODO assetInfo、endpointInfo、echarts等进行不同的处理 let startTime = bus.formateTimeToTime(filter.start_time) @@ -144,6 +144,10 @@ export default { this.multipleTime = false } this.time = [startTime, endTime] + this.$store.dispatch('dispatchPanelTime', { + time: [filter.start_time, filter.end_time], + nowTimeType: nowTimeType + }) this.chartInfo.loaded && this.chartInfo.alertRule && this.chartInfo.alertRule.type !== 3 && this.query(elements, startTime, endTime, step) }, // 参数 isRefresh 标识是否是刷新操作 diff --git a/nezha-fronted/src/components/common/alert/alertMessageInfoTab.vue b/nezha-fronted/src/components/common/alert/alertMessageInfoTab.vue index 68c97c18f..9d4b396f2 100644 --- a/nezha-fronted/src/components/common/alert/alertMessageInfoTab.vue +++ b/nezha-fronted/src/components/common/alert/alertMessageInfoTab.vue @@ -186,7 +186,7 @@ export default { immediate: true, handler (n) { if (n && n.length) { - this.timeRange = this.timeRange = [ + this.timeRange = [ bus.timeFormate(bus.computeTimezone(n[0] * 1000)), bus.timeFormate(bus.computeTimezone(n[1] * 1000)) ] diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue index 4ff4c55af..92d91e36a 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue @@ -676,7 +676,7 @@ export default { this.$get('/alert/rule/' + row.alertRule.id).then(res => { this.currentMsg = { ...row, alertRule: { ...res.data } } this.$nextTick(() => { - this.searchTime = [bus.computeTimezoneTime(new Date().getTime() - 1 * 60 * 60 * 1000), bus.computeTimezoneTime(new Date().getTime())] + this.searchTime = [bus.timeFormate(bus.computeTimezoneTime(new Date().getTime() - 1 * 60 * 60 * 1000)), bus.timeFormate(bus.computeTimezoneTime(new Date().getTime()))] this.$store.dispatch('dispatchPanelTime', { time: this.searchTime, nowTimeType: { @@ -1070,6 +1070,12 @@ export default { this.chartInfo = chartInfo this.graphShow = show } + }, + beforeDestroy () { + this.$store.dispatch('dispatchPanelTime', { + time: [], + nowTimeType: {} + }) } } diff --git a/nezha-fronted/src/components/page/alert/alertMessage.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue index bed6468db..35266299e 100644 --- a/nezha-fronted/src/components/page/alert/alertMessage.vue +++ b/nezha-fronted/src/components/page/alert/alertMessage.vue @@ -595,7 +595,7 @@ export default { this.$get('/alert/rule/' + row.alertRule.id).then(res => { this.currentMsg = { ...row, alertRule: { ...res.data } } this.$nextTick(() => { - this.searchTimeDialog = [bus.computeTimezoneTime(new Date().getTime() - 1 * 60 * 60 * 1000), bus.computeTimezoneTime(new Date().getTime())] + this.searchTimeDialog = [bus.timeFormate(bus.computeTimezoneTime(new Date().getTime() - 1 * 60 * 60 * 1000)), bus.timeFormate(bus.computeTimezoneTime(new Date().getTime()))] this.$store.dispatch('dispatchPanelTime', { time: this.searchTimeDialog, nowTimeType: {