From 5d0f6d18608f426f8afe9619f3ff6db2bf36663d Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 22 Jul 2024 09:19:52 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E8=B7=B3=E8=BD=AC=E4=BC=98=E5=8C=96=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=98=8E=E7=BB=86=E8=A1=A8=E5=92=8C=E6=B1=87=E6=80=BB?= =?UTF-8?q?=E8=A1=A8=E7=82=B9=E5=87=BB=E7=BB=B4=E5=BA=A6=E5=92=8C=E6=8C=87?= =?UTF-8?q?=E6=A0=87=E4=BD=BF=E7=94=A8=E4=B8=8D=E5=90=8C=E7=9A=84=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/data-visualization/dvMain.ts | 5 +++- .../views/components/ChartComponentS2.vue | 30 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts index c7f4c24755..dc1e81eac2 100644 --- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts +++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts @@ -1026,7 +1026,10 @@ export const dvMainStore = defineStore('dataVisualization', { } }, trackFilterCursor(element, checkQDList, trackInfo, preActiveComponentIds, viewId) { - const currentFilters = element.linkageFilters || [] // 当前联动filter + let currentFilters = element.linkageFilters || [] // 当前联动filter + if (['table-info', 'table-normal'].includes(element.innerType)) { + currentFilters = [] + } // 联动的图表情况历史条件 // const currentFilters = [] checkQDList.forEach(QDItem => { diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue index c58bd797c3..b6e2d88815 100644 --- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue +++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentS2.vue @@ -334,6 +334,36 @@ const trackClick = trackAction => { dimensionList: state.pointParam.data.dimensionList, quotaList: state.pointParam.data.quotaList } + // 明细表 汇总表特殊处理 1.点击维度传递触发字段的值 2.点击指标传递的值非触发的维度字段值 + if (['table-info', 'table-normal'].includes(view.value.type)) { + linkageParam.quotaList = [] + const dimensionIds = [] + const quotaIds = [] + view.value.xAxis.forEach(xd => { + if (xd.groupType === 'd') { + dimensionIds.push(xd.id) + } else { + quotaIds.push(xd.id) + } + }) + view.value.yAxis.forEach(xd => { + if (xd.groupType === 'd') { + dimensionIds.push(xd.id) + } else { + quotaIds.push(xd.id) + } + }) + if (dimensionIds.includes(param.data.name)) { + linkageParam.dimensionList = linkageParam.dimensionList.filter( + dimension => dimension.id === param.data.name + ) + } else if (quotaIds.includes(param.data.name)) { + linkageParam.dimensionList = linkageParam.dimensionList.filter(dimension => + dimensionIds.includes(dimension.id) + ) + } + view.value + } const jumpParam = { option: 'jump', name: state.pointParam.data.name,