From cc2eba6cf585120774d2e778045a9eecdf8cb173 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Tue, 26 Nov 2024 18:19:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E8=A1=A8=E6=98=BE=E7=A4=BA=E6=80=BB=E8=AE=A1?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E8=87=AA=E5=8A=A8=E6=8D=A2=E8=A1=8C=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/panel/charts/table/table-info.ts | 18 ++++++++++-------- .../components/js/panel/common/common_table.ts | 3 +++ 2 files changed, 13 insertions(+), 8 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 590aaedd8e..3cbdf3d688 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 @@ -264,14 +264,16 @@ export class TableInfo extends S2ChartView { ev.colsHierarchy.height = maxHeight newChart.store.set('autoCalcHeight', undefined) } else { - const { value, width } = ev.colLeafNodes[0] - calculateHeaderHeight( - { info: { meta: { value }, resizedWidth: width } }, - newChart, - tableHeader, - basicStyle, - ev - ) + if (ev.colLeafNodes?.length) { + const { value, width } = ev.colLeafNodes[0] + calculateHeaderHeight( + { info: { meta: { value }, resizedWidth: width } }, + newChart, + tableHeader, + basicStyle, + ev + ) + } } }) } diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts index 12647d23ba..de6d569534 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts @@ -1793,6 +1793,9 @@ export const configSummaryRow = (chart, s2Options, newData, tableHeader, basicSt ) newData.push(summaryObj) s2Options.dataCell = viewMeta => { + // 配置文本自动换行参数 + viewMeta.autoWrap = basicStyle.autoWrap + viewMeta.maxLines = basicStyle.maxLines if (viewMeta.rowIndex !== newData.length - 1) { return new CustomDataCell(viewMeta, viewMeta.spreadsheet) }