From 4d01571f282c3586ca6cf0cb8ea02c2d9350905d Mon Sep 17 00:00:00 2001 From: wisonic Date: Fri, 1 Nov 2024 11:41:17 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E8=A1=A8=E5=90=88=E5=B9=B6=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6=E5=92=8C=E6=82=AC=E6=B5=AE?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/chart/components/js/panel/charts/table/table-info.ts | 3 +++ .../src/views/chart/components/js/panel/types/impl/s2.ts | 1 + 2 files changed, 4 insertions(+) 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 0aebd92bc3..d308a2b251 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 @@ -302,11 +302,14 @@ export class TableInfo extends S2ChartView { } action(param) }) + // 合并的单元格直接复用数据单元格的事件 + newChart.on(S2Event.MERGED_CELLS_CLICK, e => newChart.emit(S2Event.DATA_CELL_CLICK, e)) // tooltip const { show } = tooltip if (show) { newChart.on(S2Event.COL_CELL_HOVER, event => this.showTooltip(newChart, event, meta)) newChart.on(S2Event.DATA_CELL_HOVER, event => this.showTooltip(newChart, event, meta)) + newChart.on(S2Event.MERGED_CELLS_HOVER, event => this.showTooltip(newChart, event, meta)) } // header resize newChart.on(S2Event.LAYOUT_RESIZE_COL_WIDTH, ev => resizeAction(ev)) 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 4a4d0bd930..cbd8c005aa 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 @@ -75,6 +75,7 @@ export abstract class S2ChartView

extends AntVAbstractCha let field switch (cell.cellType) { case 'dataCell': + case 'mergedCell': if (meta.valueField === SERIES_NUMBER_FIELD) { content = meta.fieldValue.toString() break