From b6e52f7bff7cc822dff019f8a8b975aa6a332b61 Mon Sep 17 00:00:00 2001 From: yueyang <2495544247@qq.com> Date: Tue, 29 Sep 2026 11:47:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=91=E7=9B=AE=E6=98=A0=E5=B0=84=E8=A1=A8?= =?UTF-8?q?=E5=BA=8F=E5=8F=B7=E5=88=97=E5=8A=A0=E5=AE=BD=E5=88=B03.5rem?= =?UTF-8?q?=EF=BC=8C=E8=A1=A8=E5=A4=B4#=E6=94=B9=E4=B8=BA=E5=BA=8F?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../financial-rules/account-mapping.blade.php | 20 ++++++++++++++----- .../Business/AccountMappingPageTest.php | 2 ++ 2 files changed, 17 insertions(+), 5 deletions(-) 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 '' - + '' + + '' + '' + '' + '' @@ -508,7 +518,7 @@ + ''; } return '' - + '' + + '' + '' + '' + '' 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); }
#序号 平台 账单项目 财务备注
' + (index + 1) + '' + (index + 1) + '
' + (index + 1) + '' + (index + 1) + '' + esc(r.platform) + '▶ ' + esc(r.item) + '' + esc(r.memo) + '