This commit is contained in:
ylj20011123 2026-02-06 09:29:04 +08:00
parent 3d9b2740a6
commit 94b60d1895

View File

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