From 6c333cecd2fe23632c94f2d61ec273470d2d4cbe Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Tue, 8 Apr 2025 18:09:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=8F=8C=E8=BD=B4=E5=9B=BE=E8=81=94=E5=8A=A8=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/components/ChartComponentG2Plot.vue | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) 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 c2feb1046a..847b6ec5fa 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 @@ -187,16 +187,32 @@ const linkageActive = () => { }) } const checkSelected = param => { + // 当前图表是双轴图时 + const chartMixFieldIds = [] + if (view.value.type.includes('chart-mix')) { + chartData.value?.left?.fields?.forEach(field => { + if (!chartMixFieldIds.includes(field.id)) { + chartMixFieldIds.push(field.id) + } + }) + chartData.value?.right?.fields?.forEach(field => { + if (!chartMixFieldIds.includes(field.id)) { + chartMixFieldIds.push(field.id) + } + }) + } // 获取当前视图的所有联动字段ID const mappingFieldIds = Array.from( new Set( - chartData.value?.fields - .map(item => item.id) - .filter(id => - Object.keys(nowPanelTrackInfo.value).some( - key => key.startsWith(view.value.id) && key.split('#')[1] === id - ) - ) + chartMixFieldIds.length + ? chartMixFieldIds + : chartData.value?.fields + .map(item => item.id) + .filter(id => + Object.keys(nowPanelTrackInfo.value).some( + key => key.startsWith(view.value.id) && key.split('#')[1] === id + ) + ) ) ) // 维度字段匹配