From ba2dda1ceb6c5bb56c06be2ce9f9886779ee5404 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 5 Mar 2025 17:42:47 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=88=86=E7=BB=84=E5=A0=86?= =?UTF-8?q?=E5=8F=A0=E6=9F=B1=E7=8A=B6=E5=9B=BE=E5=A0=86=E5=8F=A0=E9=A1=B9?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/visualization/LinkageSet.vue | 3 +++ .../views/components/ChartComponentG2Plot.vue | 26 ++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/components/visualization/LinkageSet.vue b/core/core-frontend/src/components/visualization/LinkageSet.vue index 83f2990f1c..8e37a157d9 100644 --- a/core/core-frontend/src/components/visualization/LinkageSet.vue +++ b/core/core-frontend/src/components/visualization/LinkageSet.vue @@ -554,12 +554,14 @@ const linkageFieldAdaptor = async data => { const curCheckAllAxisStr = JSON.stringify(state.curLinkageViewInfo.xAxis) + JSON.stringify(state.curLinkageViewInfo.xAxisExt) + + JSON.stringify(state.curLinkageViewInfo.extStack) + (state.curLinkageViewInfo.type.includes('chart-mix') ? JSON.stringify(state.curLinkageViewInfo.extBubble) : '') const targetCheckAllAxisStr = JSON.stringify(targetChartDetails.xAxis) + JSON.stringify(targetChartDetails.xAxisExt) + + JSON.stringify(state.curLinkageViewInfo.extStack) + (targetChartDetails.type.includes('chart-mix') ? JSON.stringify(targetChartDetails.extBubble) : '') @@ -586,6 +588,7 @@ const sourceLinkageInfoFilter = computed(() => { JSON.stringify(state.curLinkageViewInfo.xAxis) + JSON.stringify(state.curLinkageViewInfo.drillFields) + JSON.stringify(state.curLinkageViewInfo.xAxisExt) + + JSON.stringify(state.curLinkageViewInfo.extStack) + (state.curLinkageViewInfo.type.includes('chart-mix') ? JSON.stringify(state.curLinkageViewInfo.extBubble) : '') + 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 c3dd04507a..e086e301ef 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 @@ -435,10 +435,28 @@ const trackClick = trackAction => { if (!param?.data?.dimensionList) { return } - let checkName = state.pointParam.data.name - // 对多维度的处理 取第一个 - if (state.pointParam.data.dimensionList.length > 1) { - checkName = state.pointParam.data.dimensionList[0].id + let checkName = undefined + if (param.data.dimensionList.length > 1) { + // 分组堆叠处理 去能比较出来值的那个维度 + if (view.value.type === 'bar-group-stack') { + const length = param.data.dimensionList.length + // 存在最后一个id + if (param.data.dimensionList[length - 1].id === param.data.dimensionList[length - 2].id) { + param.data.dimensionList.pop() + } + param.data.dimensionList.forEach(dimension => { + if (dimension.value === param.data.category) { + checkName = dimension.id + } + }) + } + if (!checkName) { + // 对多维度的处理 取第一个 + checkName = param.data.dimensionList[0].id + } + } + if (!checkName) { + checkName = param.data.name } // 跳转字段处理 let jumpName = state.pointParam.data.name