From 1aeccd72caa8b3431da1bb22323874b019dfbe58 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Wed, 5 Jun 2024 19:56:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B8=8B=E9=92=BB=E5=AD=97=E6=AE=B5=E8=AE=BE=E7=BD=AE=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E6=97=A0=E6=95=88=E6=9E=9C=20#9933?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/components/ChartComponentG2Plot.vue | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) 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 b5b233070c..dea867602a 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 @@ -261,6 +261,29 @@ const trackClick = trackAction => { if (state.pointParam.data.dimensionList.length > 1) { checkName = state.pointParam.data.dimensionList[0].id } + // 跳转字段处理 + let jumpName = state.pointParam.data.name + if (state.pointParam.data.dimensionList.length > 1) { + const fieldIds = [] + // 优先下钻字段 + if (curView.drill) { + const curFiled = curView.drillFields[curView.drillFilters.length] + fieldIds.push(curFiled.id) + } + chartData.value?.fields.forEach(field => { + if (!fieldIds.includes(field.id)) { + fieldIds.push(field.id) + } + }) + for (let i = 0; i < fieldIds.length; i++) { + const id = fieldIds[i] + const sourceInfo = view.value.id + '#' + id + if (nowPanelJumpInfo.value[sourceInfo]) { + jumpName = id + break + } + } + } let quotaList = state.pointParam.data.quotaList if (curView.type === 'bar-range') { quotaList = state.pointParam.data.dimensionList @@ -276,7 +299,7 @@ const trackClick = trackAction => { } const jumpParam = { option: 'jump', - name: checkName, + name: jumpName, viewId: view.value.id, dimensionList: state.pointParam.data.dimensionList, quotaList: quotaList