From ee93bbbddb755365b22b9e5e64cb27e551361cff Mon Sep 17 00:00:00 2001 From: wisonic Date: Tue, 12 Aug 2025 15:36:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E8=A1=A8=E6=A0=BC=E7=AC=AC=E4=BA=8C?= =?UTF-8?q?=E5=B1=82=E6=97=A0=E6=B3=95=E4=B8=8B=E9=92=BB=20#16633=20#16485?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/js/panel/charts/table/table-info.ts | 3 ++- .../components/js/panel/charts/table/table-normal.ts | 3 ++- .../components/js/panel/charts/table/table-pivot.ts | 3 ++- .../src/views/chart/components/js/panel/types/impl/s2.ts | 9 ++++++++- .../components/views/components/ChartComponentS2.vue | 5 ++++- .../dataease/extensions/view/dto/ChartViewFieldDTO.java | 2 ++ 6 files changed, 20 insertions(+), 5 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts index c41133ad55..f3c6e89b00 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts @@ -132,7 +132,8 @@ export class TableInfo extends S2ChartView { formatCfg = formatterItem } return valueFormatter(value, formatCfg) - } + }, + id: ele.id }) }) const { basicStyle, tableCell, tableHeader, tooltip } = parseJson(chart.customAttr) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts index 300f24b4d2..d57da03bca 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts @@ -129,7 +129,8 @@ export class TableNormal extends S2ChartView { formatCfg = formatterItem } return valueFormatter(value, formatCfg) - } + }, + id: ele.id }) }) const { basicStyle, tableCell, tableHeader, tooltip } = parseJson(chart.customAttr) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts index aef198e3e7..7e0e4cfa22 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts @@ -174,7 +174,8 @@ export class TablePivot extends S2ChartView { } else { return valueFormatter(value, formatterItem) } - } + }, + id: ele.id }) }) diff --git a/core/core-frontend/src/views/chart/components/js/panel/types/impl/s2.ts b/core/core-frontend/src/views/chart/components/js/panel/types/impl/s2.ts index b7da8c2279..1e0248b05c 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/types/impl/s2.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/types/impl/s2.ts @@ -162,7 +162,14 @@ export abstract class S2ChartView

extends AntVAbstractCha this.showTooltip(s2Instance, event, meta) } } - touchAction(callback) + const cell = s2Instance.getCell(shape) + const cellMeta = cell?.getMeta() + let fieldId + if (cellMeta) { + const field = find(meta, item => item.field === cellMeta.valueField) + fieldId = field?.id + } + touchAction(callback, fieldId) }) }) } 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 77d22a48b3..af33a59bb4 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 @@ -370,7 +370,10 @@ const pointClickTrans = () => { } } -const touchAction = callback => { +const touchAction = (callback, fieldId) => { + if (fieldId) { + state.curActionId = fieldId + } if (!trackMenu.value.length) { callback?.() } diff --git a/sdk/extensions/extensions-view/src/main/java/io/dataease/extensions/view/dto/ChartViewFieldDTO.java b/sdk/extensions/extensions-view/src/main/java/io/dataease/extensions/view/dto/ChartViewFieldDTO.java index f94fe38c67..c907c2280c 100644 --- a/sdk/extensions/extensions-view/src/main/java/io/dataease/extensions/view/dto/ChartViewFieldDTO.java +++ b/sdk/extensions/extensions-view/src/main/java/io/dataease/extensions/view/dto/ChartViewFieldDTO.java @@ -27,6 +27,8 @@ public class ChartViewFieldDTO extends ChartViewFieldBaseDTO implements Serializ private boolean hide; + private String groupType; + /** * 字段来源 */