diff --git a/frontend/src/components/canvas/custom-component/UserViewDialog.vue b/frontend/src/components/canvas/custom-component/UserViewDialog.vue index 27a77c7646..bef848da14 100644 --- a/frontend/src/components/canvas/custom-component/UserViewDialog.vue +++ b/frontend/src/components/canvas/custom-component/UserViewDialog.vue @@ -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) diff --git a/frontend/src/components/canvas/custom-component/UserViewMobileDialog.vue b/frontend/src/components/canvas/custom-component/UserViewMobileDialog.vue index 6dd44ebe5e..ec80419257 100644 --- a/frontend/src/components/canvas/custom-component/UserViewMobileDialog.vue +++ b/frontend/src/components/canvas/custom-component/UserViewMobileDialog.vue @@ -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)) } } }