From e391bd456ebb316e0cec7e9cb51887406c2efc17 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Wed, 3 Apr 2024 15:50:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E8=A1=A8=E5=A4=B4=E6=8E=92=E5=BA=8F=E5=90=8E?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E8=8E=B7=E5=8F=96=E7=9A=84=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E6=95=B0=E6=8D=AE=E9=94=99=E8=AF=AF=20#8888?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor-style/components/table/TableHeaderSelector.vue | 1 - .../chart/components/js/panel/charts/table/table-info.ts | 6 +++--- .../chart/components/js/panel/charts/table/table-normal.ts | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableHeaderSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableHeaderSelector.vue index 3e36bd1a51..a1ee4a3d4e 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableHeaderSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/table/TableHeaderSelector.vue @@ -237,7 +237,6 @@ onMounted(() => { /> { // click newChart.on(S2Event.DATA_CELL_CLICK, ev => { const cell = newChart.getCell(ev.target) - const meta = cell.getMeta() + const meta = cell.getMeta() as ViewMeta const nameIdMap = fields.reduce((pre, next) => { pre[next['dataeaseName']] = next['id'] return pre }, {}) - const rowData = chart.data.tableRow[meta.rowIndex] as any + const rowData = newChart.dataSet.getRowData(meta) const dimensionList = [] for (const key in rowData) { if (nameIdMap[key]) { 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 deb547c9c9..cd93307715 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 @@ -1,5 +1,5 @@ import { S2ChartView, S2DrawOptions } from '@/views/chart/components/js/panel/types/impl/s2' -import { S2Event, S2Options, TableSheet, TableColCell } from '@antv/s2' +import { S2Event, S2Options, TableSheet, TableColCell, ViewMeta } from '@antv/s2' import { parseJson } from '@/views/chart/components/js/util' import { formatterItem, valueFormatter } from '@/views/chart/components/js/formatter' import { copyContent, getCurrentField } from '@/views/chart/components/js/panel/common/common_table' @@ -139,13 +139,13 @@ export class TableNormal extends S2ChartView { // click newChart.on(S2Event.DATA_CELL_CLICK, ev => { const cell = newChart.getCell(ev.target) - const meta = cell.getMeta() + const meta = cell.getMeta() as ViewMeta const nameIdMap = fields.reduce((pre, next) => { pre[next['dataeaseName']] = next['id'] return pre }, {}) - const rowData = chart.data.tableRow[meta.rowIndex] as any + const rowData = newChart.dataSet.getRowData(meta) const dimensionList = [] for (const key in rowData) { if (nameIdMap[key]) {