版本迁移同步合并|管理后台build

This commit is contained in:
2026-06-25 17:25:35 +08:00
parent 50afcf02d0
commit fa2e56d021
9 changed files with 1629 additions and 445 deletions
+2 -2
View File
@@ -92,7 +92,7 @@ function estimateColumnWidths(rows: ExcelCellValue[][], columns: StyledExcelColu
const config = columns[index];
if (config?.width) return { wch: config.width };
const maxLength = rows.reduce((max, row) => Math.max(max, visualLength(row[index])), visualLength(config?.title));
const maxLength = rows.reduce<number>((max, row) => Math.max(max, visualLength(row[index])), visualLength(config?.title));
const minWidth = config?.minWidth ?? 10;
const maxWidth = config?.maxWidth ?? 42;
return { wch: clamp(Math.ceil(maxLength * 1.15) + 2, minWidth, maxWidth) };
@@ -100,7 +100,7 @@ function estimateColumnWidths(rows: ExcelCellValue[][], columns: StyledExcelColu
}
function estimateRowHeight(row: ExcelCellValue[], colWidths: { wch: number }[], baseHeight = 20): number {
const maxLines = row.reduce((max, cell, index) => {
const maxLines = row.reduce<number>((max, cell, index) => {
const width = Math.max(8, colWidths[index]?.wch || 12);
const text = cell === null || cell === undefined ? '' : String(cell);
const explicitLines = text.split(/\r?\n/);