NEZ-2986 fix:clock图表多次渲染 未清除上次的定时器

This commit is contained in:
zyh
2023-07-14 15:55:41 +08:00
parent 03885df704
commit b42f3468ec

View File

@@ -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