fix:dashboard跳转调用clearTopology

This commit is contained in:
zyh
2023-04-06 17:48:31 +08:00
parent 6dae7ed6e5
commit 323006efda
6 changed files with 14 additions and 17 deletions

View File

@@ -205,9 +205,6 @@ export default {
// eslint-disable-next-line vue/no-mutating-props // eslint-disable-next-line vue/no-mutating-props
this.chartOption.color || (this.chartOption.color = initColor(20)) this.chartOption.color || (this.chartOption.color = initColor(20))
this.colorList = this.chartOption.color this.colorList = this.chartOption.color
try {
this.isStack = this.chartInfo.param.stack
} catch (e) {}
this.chartInfo.loaded && this.initChart(this.chartOption) this.chartInfo.loaded && this.initChart(this.chartOption)
} }
} }

View File

@@ -442,9 +442,6 @@ export default {
// eslint-disable-next-line vue/no-mutating-props // eslint-disable-next-line vue/no-mutating-props
this.chartOption.color || (this.chartOption.color = initColor(20)) this.chartOption.color || (this.chartOption.color = initColor(20))
this.colorList = this.chartOption.color this.colorList = this.chartOption.color
try {
this.isStack = this.chartInfo.param.stack
} catch (e) {}
this.chartInfo.loaded && this.initChart(this.chartOption) this.chartInfo.loaded && this.initChart(this.chartOption)
}, },
beforeDestroy () { beforeDestroy () {

View File

@@ -171,9 +171,6 @@ export default {
// eslint-disable-next-line vue/no-mutating-props // eslint-disable-next-line vue/no-mutating-props
this.chartOption.color || (this.chartOption.color = initColor(20)) this.chartOption.color || (this.chartOption.color = initColor(20))
this.colorList = this.chartOption.color this.colorList = this.chartOption.color
try {
this.isStack = this.chartInfo.param.stack
} catch (e) {}
this.chartInfo.loaded && this.initChart(this.chartOption) this.chartInfo.loaded && this.initChart(this.chartOption)
} }
} }

View File

@@ -176,9 +176,6 @@ export default {
// eslint-disable-next-line vue/no-mutating-props // eslint-disable-next-line vue/no-mutating-props
this.chartOption.color || (this.chartOption.color = initColor(20)) this.chartOption.color || (this.chartOption.color = initColor(20))
this.colorList = this.chartOption.color this.colorList = this.chartOption.color
try {
this.isStack = this.chartInfo.param.stack
} catch (e) {}
this.chartInfo.loaded && this.initChart(this.chartOption) this.chartInfo.loaded && this.initChart(this.chartOption)
} }
} }

View File

@@ -200,10 +200,14 @@ export default {
getTopology(this.meta2dId).off('leave', this.penLeave) // 移出画笔· getTopology(this.meta2dId).off('leave', this.penLeave) // 移出画笔·
getTopology(this.meta2dId).off('add', this.appPen) // 添加新画笔· getTopology(this.meta2dId).off('add', this.appPen) // 添加新画笔·
getTopology(this.meta2dId).off('click', this.topoClick) // click画笔· getTopology(this.meta2dId).off('click', this.topoClick) // click画笔·
getTopology(this.meta2dId).destroy(true) if (this.isChart) {
for (const k in globalStore) { getTopology(this.meta2dId).destroy()
if (!globalStore[k]) { } else {
delete globalStore[k] getTopology(this.meta2dId).destroy(true)
for (const k in globalStore) {
if (!globalStore[k]) {
delete globalStore[k]
}
} }
} }
setTopology(this.meta2dId, null) setTopology(this.meta2dId, null)

View File

@@ -155,7 +155,7 @@
<script> <script>
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { chartCache } from '@/components/common/js/common' import { chartCache, clearTopology } from '@/components/common/js/common'
import { data as le5leData, observers as le5leObservers } from 'le5le-store/store/data.js' import { data as le5leData, observers as le5leObservers } from 'le5le-store/store/data.js'
import chartRightBox from '@/components/common/rightBox/chart/chartRightBox' import chartRightBox from '@/components/common/rightBox/chart/chartRightBox'
import bus from '../../../libs/bus' import bus from '../../../libs/bus'
@@ -173,6 +173,7 @@ import panelVariables from '@/components/common/panel/panelVariables'
import snapshotProgress from '@/components/common/snapshotProgress/snapshotProgress.vue' import snapshotProgress from '@/components/common/snapshotProgress/snapshotProgress.vue'
import dashboardTempBox from '@/components/common/rightBox/dashboardTempBox' import dashboardTempBox from '@/components/common/rightBox/dashboardTempBox'
import playlist from '@/components/common/playlist' import playlist from '@/components/common/playlist'
// import FileSaver from 'file-saver' // import FileSaver from 'file-saver'
// import chartData from './testData' // import chartData from './testData'
export default { export default {
@@ -747,6 +748,7 @@ export default {
if (!val) { if (!val) {
return false return false
} }
clearTopology()
const param = { const param = {
dashboardId: val.id dashboardId: val.id
} }
@@ -774,6 +776,7 @@ export default {
/* 时间条件查询--start */ /* 时间条件查询--start */
// 选择日期变化 // 选择日期变化
dateChange (route) { dateChange (route) {
clearTopology()
const nowTimeType = this.$refs.pickTime.$refs.timePicker.nowTimeType const nowTimeType = this.$refs.pickTime.$refs.timePicker.nowTimeType
this.nowTimeType = this.$refs.pickTime.$refs.timePicker.nowTimeType this.nowTimeType = this.$refs.pickTime.$refs.timePicker.nowTimeType
this.setSearchTime(nowTimeType.type, nowTimeType.value, nowTimeType) this.setSearchTime(nowTimeType.type, nowTimeType.value, nowTimeType)
@@ -1282,6 +1285,8 @@ export default {
echarts.disconnect('timeSeriesGroup') echarts.disconnect('timeSeriesGroup')
this.$store.commit('setMode', '') this.$store.commit('setMode', '')
clearTopology()
} }
} }
</script> </script>