From 94b60d18955bf910ce7bb6256549f6c5fe48530b Mon Sep 17 00:00:00 2001 From: ylj20011123 Date: Fri, 6 Feb 2026 09:29:04 +0800 Subject: [PATCH] update --- src/utils/format.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/utils/format.ts b/src/utils/format.ts index edd167c..7e08491 100644 --- a/src/utils/format.ts +++ b/src/utils/format.ts @@ -1225,14 +1225,18 @@ export async function exportXlsxFromProColumnsExcelJS( leafCols.forEach((col, j) => { const cell = row.getCell(j + 1); const val = getCellValue(col, rec, start + i); - const text = extractText(val); - cell.value = text; + if (typeof val === 'number' && !isNaN(val)) { + cell.value = val; + } else { + cell.value = extractText(val); + } const alignment: any = { vertical: 'middle', wrapText: true }; if (col.align) alignment.horizontal = col.align; cell.alignment = alignment; - const lines = text.split('\n').length; + const textForHeight = String(cell.value || ''); + const lines = textForHeight.split('\n').length; if (lines > maxRowLines) maxRowLines = lines; }); row.height = Math.max(18, maxRowLines * 16);