fix(frontend): 修复百分比表格列宽与单元格居中

This commit is contained in:
yml2213
2026-10-24 15:13:05 +08:00
parent ce8efa6bad
commit 8991263d25
3 changed files with 45 additions and 7 deletions
@@ -31,6 +31,19 @@ test('百分比表格:没有列宽时平均分配', () => {
)
})
test('百分比表格:minWidth 作为比例权重并移除最小宽度约束', () => {
const columns: TableColumnsType<Record<string, unknown>> = [
{ title: 'A', dataIndex: 'a', minWidth: 100 },
{ title: 'B', dataIndex: 'b', minWidth: 300 },
]
const result = normalizePercentColumns(columns)
assert.deepEqual(
result.map((column) => column.width),
['25.0000%', '75.0000%'],
)
assert.ok(result.every((column) => !('minWidth' in column)))
})
test('百分比表格:选择列预留 4%', () => {
const columns: TableColumnsType<Record<string, unknown>> = [
{ title: 'A', dataIndex: 'a', width: 100 },