Merge pull request #12673 from dataease/pr@dev-v2@fix_pivot_formated_export_zero

fix(图表): 修复透视表带格式导出数据为 0 时单元格实际为空 #12088
This commit is contained in:
wisonic-s 2024-10-12 20:48:16 +08:00 committed by GitHub
commit a09c22bfc1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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