diff --git a/resources/views/business/pages/financial-rules/account-mapping.blade.php b/resources/views/business/pages/financial-rules/account-mapping.blade.php index d312904f..3b313c61 100644 --- a/resources/views/business/pages/financial-rules/account-mapping.blade.php +++ b/resources/views/business/pages/financial-rules/account-mapping.blade.php @@ -103,11 +103,21 @@ /* 表格必须锁列宽(table-layout:fixed)。默认的自动列宽会按内容互相挤压, 「借方/贷方科目」两列会被挤到文字被截断;锁死后按上面 th 的宽度分配, 窗口不够宽时由外层 .upstream-data-table-scroll 横向滚动。 - 87.5rem = 各列宽度之和,改列宽时要一起改。 */ - .am-table { table-layout: fixed; min-width: 87.5rem; } + 89rem = 各列宽度之和,改列宽时要一起改。 */ + .am-table { table-layout: fixed; min-width: 89rem; } /* 只读单元格超长就省略号(编辑态那格要放开,否则下拉会被裁) */ .am-table > tbody > tr.am-item:not(.is-editing) > td { overflow: hidden; text-overflow: ellipsis; } + /* 序号列:3.5rem 才放得下三位数,居中并锁死数字等宽, + 避免宽窗口下被按比例挤压后出现「1…」 */ + .am-table .am-index { + width: 3.5rem; + min-width: 3.5rem; + max-width: 3.5rem; + text-align: center; + font-variant-numeric: tabular-nums; + } + /* 行内编辑 */ /* 注意:td 上有 height:2.5rem + white-space:nowrap(来自 upstream-data-table), 编辑态必须放开,否则一级/二级两个下拉会被压成一行、挤出单元格 */ @@ -324,7 +334,7 @@
| # | +序号 | 平台 | 账单项目 | 财务备注 | @@ -492,7 +502,7 @@ var edit = (editingId === r.id && draft); if (edit) { return '
|---|---|---|---|---|
| ' + (index + 1) + ' | ' + + '' + (index + 1) + ' | ' + '' + ' | ' + ' | ' @@ -508,7 +518,7 @@ + ' |
| ' + (index + 1) + ' | ' + + '' + (index + 1) + ' | ' + '' + esc(r.platform) + ' | ' + '▶ ' + esc(r.item) + ' | ' + '' + esc(r.memo) + ' | ' diff --git a/tests/Feature/Business/AccountMappingPageTest.php b/tests/Feature/Business/AccountMappingPageTest.php index 460f6da2..f094228c 100644 --- a/tests/Feature/Business/AccountMappingPageTest.php +++ b/tests/Feature/Business/AccountMappingPageTest.php @@ -95,6 +95,8 @@ class AccountMappingPageTest extends FeatureTestCase ->assertSee('var ROWS = [', false) ->assertSee('"platform":"得物"', false) ->assertSeeText('科目映射表') + // 序号列表头固定为「序号」且宽度 3.5rem:2.5rem 时三位数会被省略号截成「1…」 + ->assertSee('class="am-index" style="width:3.5rem;">序号', false) // ENDPOINT 经 @json 输出,斜杠会被转义成 \/,所以只断言变量名 ->assertSee('var ENDPOINT =', false); }