财务台账:修复账户异常待办列宽恢复基线 #435

Merged
shanshi merged 1 commits from fix/shanshi-pending-column-default-width into main 2026-10-21 16:21:29 +08:00
2 changed files with 23 additions and 4 deletions

View File

@ -311,10 +311,26 @@
const minimumWidth = 56;
const maximumWidth = 720;
const clampWidth = (value) => Math.min(maximumWidth, Math.max(minimumWidth, Math.round(Number(value) || 0)));
const defaults = new Map(headers.map((header) => [
header.dataset.pendingColumnKey,
Math.max(minimumWidth, Math.round(header.getBoundingClientRect().width * 10) / 10),
]));
const pendingColumnDefaultWidths = Object.freeze({
company_name: 170,
account_short: 92,
account_type: 72,
account_status: 78,
account_no: 180,
bank_name: 250,
bank_city_branch: 180,
abnormal_reason: 145,
handling_method: 95,
owner_name: 105,
started_at: 178,
completed_at: 178,
current_progress: 165,
completion_status: 105,
});
const defaults = new Map(headers.map((header) => {
const key = header.dataset.pendingColumnKey;
return [key, clampWidth(pendingColumnDefaultWidths[key] ?? 120)];
}));
const widths = new Map(defaults);
try {

View File

@ -229,6 +229,9 @@ class FinanceLedgerAccountStatusTest extends FeatureTestCase
->assertSee('data-pending-pagination', false)
->assertSee('data-pending-table', false)
->assertSee('拖动表头右侧边界可调整列宽')
->assertSee('const pendingColumnDefaultWidths = Object.freeze({', false)
->assertSee('company_name: 170', false)
->assertSee('completion_status: 105', false)
->assertSee('ledger-page-box', false)
->assertSee('1 / 1', false)
->assertSee('data-pending-account="待办测试账户二"', false)