summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzyh <[email protected]>2024-09-20 10:46:17 +0800
committerzyh <[email protected]>2024-09-20 10:46:17 +0800
commitc79b14b132552e7858f1cd5c879d93fef5ca1a7b (patch)
tree0f66b1bfa79c2debb0cfed90c370a66d435d5f26
parent2950d4019542f88d38a4c7e44aa945003cfdb1a9 (diff)
NEZ-3502 fix: alert message页面asset dashboard标签页 Group组件图表时区计算错误rel-24.01.37
-rw-r--r--nezha-fronted/src/components/chart/ChartScreenHeader.vue2
-rw-r--r--nezha-fronted/src/components/chart/panelChart.vue1
-rw-r--r--nezha-fronted/src/components/common/alert/alertMessageInfo.vue6
-rw-r--r--nezha-fronted/src/components/common/alert/alertMessageInfoTab.vue2
-rw-r--r--nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue8
-rw-r--r--nezha-fronted/src/components/page/alert/alertMessage.vue2
6 files changed, 15 insertions, 6 deletions
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: {}
+ })
}
}
</script>
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: {