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) }