From 544855912c5af212c9900deb248051fbbe1f4f8e Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 4 Sep 2024 15:14:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=A4=8D=E7=94=A8=E6=97=B6=E9=83=A8=E5=88=86=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/data-visualization/dvMain.ts | 28 ++++++++++--------- .../template/component/DeTemplateImport.vue | 1 - 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts index 044cc207ff..baecca8f4a 100644 --- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts +++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts @@ -1228,20 +1228,22 @@ export const dvMainStore = defineStore('dataVisualization', { setViewDataDetails(viewId, chartDataInfo) { this.canvasViewDataInfo[viewId] = chartDataInfo.data const viewInfo = this.canvasViewInfo[viewId] - const oldCalParams = viewInfo.calParams - ? viewInfo.calParams.reduce((map, params) => { - map[params.id] = params.value - return map - }, {}) - : {} - if (chartDataInfo.calParams) { - chartDataInfo.calParams.forEach(paramsItem => { - if (oldCalParams[paramsItem.id]) { - paramsItem.value = oldCalParams[paramsItem.id] - } - }) + if (viewInfo) { + const oldCalParams = viewInfo.calParams + ? viewInfo.calParams.reduce((map, params) => { + map[params.id] = params.value + return map + }, {}) + : {} + if (chartDataInfo.calParams) { + chartDataInfo.calParams.forEach(paramsItem => { + if (oldCalParams[paramsItem.id]) { + paramsItem.value = oldCalParams[paramsItem.id] + } + }) + } + this.canvasViewInfo[viewId]['calParams'] = chartDataInfo.calParams || null } - this.canvasViewInfo[viewId]['calParams'] = chartDataInfo.calParams || null }, getViewDataDetails(viewId) { return this.canvasViewDataInfo[viewId] diff --git a/core/core-frontend/src/views/template/component/DeTemplateImport.vue b/core/core-frontend/src/views/template/component/DeTemplateImport.vue index 8d0ffa5534..29fbbb9040 100644 --- a/core/core-frontend/src/views/template/component/DeTemplateImport.vue +++ b/core/core-frontend/src/views/template/component/DeTemplateImport.vue @@ -246,7 +246,6 @@ const importTemplate = () => { ElMessage.warning('当前名称已在模版管理中存在,请修改') } else { save(state.templateInfo).then(rsp => { - console.log('====' + JSON.stringify(rsp)) ElMessage.success(t('导入成功')) emits('refresh', getRefreshPInfo()) emits('closeEditTemplateDialog')