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') }