From ca29445bf24c69b0790bb203c2c989699a8fb98b Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 25 Apr 2022 18:59:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9C=B0=E5=9B=BE=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=85=B6=E4=BB=96=E5=9C=B0=E6=96=B9=E5=90=8E?= =?UTF-8?q?=E5=BA=95=E5=9B=BE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/custom-component/UserViewDialog.vue | 13 +++++++++++-- .../custom-component/UserViewMobileDialog.vue | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) 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)) } } }