fix(图表): 修复透视表带格式导出数据为 0 时单元格实际为空 #12088

This commit is contained in:
wisonic 2024-10-12 20:46:50 +08:00
parent 7abac8df61
commit d6fbaf2b5f

View File

@ -1148,7 +1148,7 @@ export async function exportPivotExcel(instance: PivotSheet, chart: ChartObj) {
for (let colIndex = 0; colIndex < colLeafNodes.length; colIndex++) {
const dataCellMeta = layoutResult.getCellMeta(rowIndex, colIndex)
const { fieldValue } = dataCellMeta
if (fieldValue) {
if (fieldValue === 0 || fieldValue) {
const meta = metaMap[dataCellMeta.valueField]
const cell = worksheet.getCell(rowIndex + maxColHeight + 1, rowLength + colIndex + 1)
const value = meta?.formatter?.(fieldValue) || fieldValue.toString()