summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzyh <[email protected]>2023-07-14 15:55:41 +0800
committerzyh <[email protected]>2023-07-14 15:55:41 +0800
commitb42f3468eca4f468c2b2147dc79a9f64ebcb4e63 (patch)
tree26851cc25973a058f06cbc3895007c8307212364
parent03885df7043dff510e8116280a2b3084197ff24b (diff)
NEZ-2986 fix:clock图表多次渲染 未清除上次的定时器
-rw-r--r--nezha-fronted/src/components/chart/chart/chartClock.vue2
1 files changed, 2 insertions, 0 deletions
diff --git a/nezha-fronted/src/components/chart/chart/chartClock.vue b/nezha-fronted/src/components/chart/chart/chartClock.vue
index 3141398d9..da1f87939 100644
--- a/nezha-fronted/src/components/chart/chart/chartClock.vue
+++ b/nezha-fronted/src/components/chart/chart/chartClock.vue
@@ -124,6 +124,7 @@ export default {
this.isInit && setChart(this.chartId, myChart) // 缓存;不使用vue的data是为避免整个chart被监听导致卡顿
this.isInit = false
if (this.chartInfo.param && this.chartInfo.param.timeType === 'local') {
+ clearInterval(_soft.localTimer)
_soft.localTimer = setInterval(function () {
const date = new Date()
const second = date.getSeconds()
@@ -146,6 +147,7 @@ export default {
myChart.setOption(chartOption)
}, 1000)
} else {
+ clearInterval(_soft.serverTimer)
_soft.serverTimer = setInterval(function () {
_soft.querySystemState()
chartOption.animationDurationUpdate = 300