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

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

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