fix(图表): 修复明细表显示总计后,自动换行失效的问题

This commit is contained in:
jianneng-fit2cloud 2024-11-26 18:19:02 +08:00
parent 0b537a4fc8
commit cc2eba6cf5
2 changed files with 13 additions and 8 deletions

View File

@ -264,14 +264,16 @@ export class TableInfo extends S2ChartView<TableSheet> {
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
)
}
}
})
}

View File

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