From 82947ef3e715d3134e8a62d66160cd91c2ed3812 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 16 Jan 2024 11:29:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E6=9D=BF=E9=85=8D=E7=BD=AE=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E4=BB=AA=E8=A1=A8=E6=9D=BF=E7=9A=84=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E6=A0=87=E9=A2=98=E5=AD=97=E5=8F=B7=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E6=9C=89=E4=B8=AA=E5=88=AB=E5=9B=BE=E8=A1=A8=E7=94=9F=E6=95=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/dashboard/DbCanvasAttr.vue | 22 ++++++++++------- .../data-visualization/CanvasAttr.vue | 24 +++++++++++-------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/core/core-frontend/src/components/dashboard/DbCanvasAttr.vue b/core/core-frontend/src/components/dashboard/DbCanvasAttr.vue index 544a0ac828..98c513af1f 100644 --- a/core/core-frontend/src/components/dashboard/DbCanvasAttr.vue +++ b/core/core-frontend/src/components/dashboard/DbCanvasAttr.vue @@ -54,16 +54,20 @@ const themeAttrChange = (custom, property, value) => { if (canvasAttrInit) { Object.keys(canvasViewInfo.value).forEach(function (viewId) { const viewInfo = canvasViewInfo.value[viewId] - if (custom === 'customAttr') { - merge(viewInfo['customAttr'], value) - } else { - Object.keys(value).forEach(function (key) { - if (viewInfo[custom][property][key] !== undefined) { - viewInfo[custom][property][key] = value[key] - } - }) + try { + if (custom === 'customAttr') { + merge(viewInfo['customAttr'], value) + } else { + Object.keys(value).forEach(function (key) { + if (viewInfo[custom][property][key] !== undefined) { + viewInfo[custom][property][key] = value[key] + } + }) + } + useEmitt().emitter.emit('renderChart-' + viewId, viewInfo) + } catch (e) { + console.warn('themeAttrChange-error') } - useEmitt().emitter.emit('renderChart-' + viewId, viewInfo) }) snapshotStore.recordSnapshotCache('renderChart') } diff --git a/core/core-frontend/src/components/data-visualization/CanvasAttr.vue b/core/core-frontend/src/components/data-visualization/CanvasAttr.vue index b27066d6cd..3b12aad8da 100644 --- a/core/core-frontend/src/components/data-visualization/CanvasAttr.vue +++ b/core/core-frontend/src/components/data-visualization/CanvasAttr.vue @@ -33,17 +33,21 @@ const onBaseChange = () => { const themeAttrChange = (custom, property, value) => { if (canvasAttrInit) { Object.keys(canvasViewInfo.value).forEach(function (viewId) { - const viewInfo = canvasViewInfo.value[viewId] - if (custom === 'customAttr') { - merge(viewInfo['customAttr'], value) - } else { - Object.keys(value).forEach(function (key) { - if (viewInfo[custom][property][key] !== undefined) { - viewInfo[custom][property][key] = value[key] - } - }) + try { + const viewInfo = canvasViewInfo.value[viewId] + if (custom === 'customAttr') { + merge(viewInfo['customAttr'], value) + } else { + Object.keys(value).forEach(function (key) { + if (viewInfo[custom][property][key] !== undefined) { + viewInfo[custom][property][key] = value[key] + } + }) + } + useEmitt().emitter.emit('renderChart-' + viewId, viewInfo) + } catch (e) { + console.warn('themeAttrChange-error') } - useEmitt().emitter.emit('renderChart-' + viewId, viewInfo) }) snapshotStore.recordSnapshotCache('renderChart') }