From 15d7381a3b6472a85b2f46d70af4aa437f7270a6 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 28 Nov 2022 10:51:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E9=83=A8?= =?UTF-8?q?=E5=88=86=E4=BB=AA=E8=A1=A8=E6=9D=BF=E6=89=93=E5=BC=80=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=8F=B0=E6=9C=89=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/customComponent/UserView.vue | 7 +++++- .../views/chart/components/ChartComponent.vue | 23 +++++++++++-------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/canvas/customComponent/UserView.vue b/frontend/src/components/canvas/customComponent/UserView.vue index d72a517904..c9a5137afd 100644 --- a/frontend/src/components/canvas/customComponent/UserView.vue +++ b/frontend/src/components/canvas/customComponent/UserView.vue @@ -653,7 +653,12 @@ export default { }, clearPanelLinkage(param) { if (param.viewId === 'all' || param.viewId === this.element.propValue.viewId) { - this.$refs[this.element.propValue.id].reDrawView() + try { + this.$refs[this.element.propValue.id].reDrawView() + } catch (e) { + console.error('reDrawView-error:', this.element.propValue.id) + } + } }, bindPluginEvent() { diff --git a/frontend/src/views/chart/components/ChartComponent.vue b/frontend/src/views/chart/components/ChartComponent.vue index 1c8cedf253..a3f0cc1153 100644 --- a/frontend/src/views/chart/components/ChartComponent.vue +++ b/frontend/src/views/chart/components/ChartComponent.vue @@ -57,6 +57,7 @@ import { reverseColor } from '../chart/common/common' import MapController from './map/MapController.vue' import { mapState } from 'vuex' import bus from '@/utils/bus' + export default { name: 'ChartComponent', components: { @@ -180,16 +181,18 @@ export default { this.currentSeriesId = seriesId }, reDrawView() { - this.myChart.dispatchAction({ - type: 'unselect', - seriesIndex: this.linkageActiveParam.seriesIndex, - name: this.linkageActiveParam.name - }) - this.myChart.dispatchAction({ - type: 'downplay', - seriesIndex: this.linkageActiveParam.seriesIndex, - name: this.linkageActiveParam.name - }) + if (this.linkageActiveParam) { + this.myChart.dispatchAction({ + type: 'unselect', + seriesIndex: this.linkageActiveParam.seriesIndex, + name: this.linkageActiveParam.name + }) + this.myChart.dispatchAction({ + type: 'downplay', + seriesIndex: this.linkageActiveParam.seriesIndex, + name: this.linkageActiveParam.name + }) + } this.linkageActiveParam = null }, linkageActive() {