提交 ca29445b authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

fix: 地图详情点击其他地方后底图错误

上级 f2bcdb03
......@@ -58,7 +58,8 @@ export default {
data() {
return {
refId: null,
element: {}
element: {},
lastMapChart: null
}
},
computed: {
......@@ -119,7 +120,12 @@ export default {
if (this.curComponent && this.curComponent.DetailAreaCode && this.curComponent.DetailAreaCode.length) {
DetailAreaCode = this.curComponent.DetailAreaCode
}
return { ...temp, ...{ DetailAreaCode: DetailAreaCode }}
if (!this.curComponent && this.lastMapChart) {
return this.lastMapChart
}
const result = { ...temp, ...{ DetailAreaCode: DetailAreaCode }}
this.setLastMapChart(result)
return result
}
return null
}
......@@ -142,6 +148,9 @@ export default {
exportViewImg() {
exportImg(this.chart.name)
},
setLastMapChart(data) {
this.lastMapChart = JSON.parse(JSON.stringify(data))
},
exportExcelDownload(snapshot, width, height) {
const excelHeader = JSON.parse(JSON.stringify(this.chart.data.fields)).map(item => item.name)
const excelHeaderKeys = JSON.parse(JSON.stringify(this.chart.data.fields)).map(item => item.dataeaseName)
......
......@@ -47,7 +47,8 @@ export default {
},
data() {
return {
refId: null
refId: null,
lastMapChart: null
}
},
computed: {
......@@ -86,7 +87,12 @@ export default {
if (this.curComponent && this.curComponent.DetailAreaCode && this.curComponent.DetailAreaCode.length) {
DetailAreaCode = this.curComponent.DetailAreaCode
}
return { ...temp, ...{ DetailAreaCode: DetailAreaCode }}
if (!this.curComponent && this.lastMapChart) {
return this.lastMapChart
}
const result = { ...temp, ...{ DetailAreaCode: DetailAreaCode }}
this.setLastMapChart(result)
return result
}
return null
}
......@@ -95,6 +101,9 @@ export default {
renderComponent() {
return this.chart.render
},
setLastMapChart(data) {
this.lastMapChart = JSON.parse(JSON.stringify(data))
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论