diff --git a/resources/views/business/pages/financial-ledger/unavailable-balance-tasks.blade.php b/resources/views/business/pages/financial-ledger/unavailable-balance-tasks.blade.php index 37573f02..30154bec 100644 --- a/resources/views/business/pages/financial-ledger/unavailable-balance-tasks.blade.php +++ b/resources/views/business/pages/financial-ledger/unavailable-balance-tasks.blade.php @@ -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 { diff --git a/tests/Feature/Business/FinanceLedgerAccountStatusTest.php b/tests/Feature/Business/FinanceLedgerAccountStatusTest.php index 54d8caea..b6da8c8e 100644 --- a/tests/Feature/Business/FinanceLedgerAccountStatusTest.php +++ b/tests/Feature/Business/FinanceLedgerAccountStatusTest.php @@ -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)