From dc753d708d395124cf60db316451c4f51dcb2f8b Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 3 Jul 2024 13:27:03 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E8=81=94=E5=8A=A8=E9=AB=98=E4=BA=AE=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=9F=B1=E7=BA=BF=E5=9B=BE=E4=B8=AD?= =?UTF-8?q?=E5=8C=BA=E9=97=B4=E6=9D=A1=E5=BD=A2=E5=9B=BE=E3=80=81=E5=AF=B9?= =?UTF-8?q?=E7=A7=B0=E6=9D=A1=E5=BD=A2=E5=9B=BE=E8=81=94=E5=8A=A8=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E8=81=94=E5=8A=A8=E5=9B=BE=E8=A1=A8=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E9=AB=98=E4=BA=AE=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 --- core/core-frontend/config/base.ts | 2 +- .../views/components/ChartComponentG2Plot.vue | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/core/core-frontend/config/base.ts b/core/core-frontend/config/base.ts index ddb203e13c..61513f83d1 100644 --- a/core/core-frontend/config/base.ts +++ b/core/core-frontend/config/base.ts @@ -26,6 +26,6 @@ export default { } } }, - sourcemap: true + sourcemap: false } } diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue index eeae1375f7..173e06d991 100644 --- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue +++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue @@ -73,6 +73,9 @@ const emit = defineEmits([ 'resetLoading' ]) +const g2TypeSeries1 = ['bidirectional-bar'] +const g2TypeSeries0 = ['bar-range'] + const { view, showPosition, scale, terminal } = toRefs(props) const isError = ref(false) @@ -117,7 +120,7 @@ const linkageActivePre = () => { } const linkageActive = () => { linkageActiveHistory.value = true - myChart?.setState('selected', param => { + myChart?.setState('active', param => { if (Array.isArray(param)) { return false } else { @@ -137,10 +140,16 @@ const linkageActive = () => { }) } const checkSelected = param => { - return ( - state.linkageActiveParam.name.indexOf(param.name) > -1 && - state.linkageActiveParam.category === param.category - ) + if (g2TypeSeries1.includes(view.value.type)) { + return state.linkageActiveParam.name === param.field + } else if (g2TypeSeries0.includes(view.value.type)) { + return state.linkageActiveParam.category === param.category + } else { + return ( + state.linkageActiveParam.name === param.name && + state.linkageActiveParam.category === param.category + ) + } } const calcData = async (view, callback) => {