From 55c50706b516c6dc70313f8fcc93470cb4d38efc Mon Sep 17 00:00:00 2001 From: Guichumo <836061373@qq.com> Date: Sat, 21 Nov 2026 19:33:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=93=8D=E4=BD=9C=E5=AE=A1=E8=AE=A1?= =?UTF-8?q?=E9=A2=98=E5=A4=B4=E7=BB=93=E6=9E=9C/IP=20=E5=88=97=E4=B8=8E?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=97=E5=AF=B9=E9=BD=90=EF=BC=88=E9=95=9C?= =?UTF-8?q?=E5=83=8F=20entity=20=E8=A1=8C=E4=B8=A4=20td=20=E7=9B=92?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VEntity 数据行由两个自带 1rem 左右内边距的 td 组成,end 组紧跟 start 组; 题头原先用 margin-left: auto 把结果/IP 推到行尾,与数据列错位 19rem。 现改为题头 start/end 两组各自镜像 1rem 内边距、end 组不再右推。 已用真实 @halo-dev/components CSS + 同构 DOM 在浏览器实测:五列偏差均为 0。 --- .../ui/src/views/AuditLogList.appearance.spec.ts | 14 ++++++++++---- .../ui/src/views/AuditLogList.vue | 12 ++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/plugin-operation-audit/ui/src/views/AuditLogList.appearance.spec.ts b/plugin-operation-audit/ui/src/views/AuditLogList.appearance.spec.ts index 8e12398..0e0fe80 100644 --- a/plugin-operation-audit/ui/src/views/AuditLogList.appearance.spec.ts +++ b/plugin-operation-audit/ui/src/views/AuditLogList.appearance.spec.ts @@ -6,7 +6,8 @@ import { describe, expect, it } from 'vitest' // 操作审计页需保持控制台默认灰底(.audit-page 不自行设置背景色), // 筛选栏、数据列表、分页条合并为同一张白色卡片:区块之间不留灰缝, // 分页条白底随卡片铺满整行、与上方列表左右对齐(与控制台其他列表页观感一致); -// 数据行上方有列题头,题头列宽与数据行各字段固定宽度一一对应; +// 数据行上方有列题头,题头列宽与数据行各字段固定宽度一一对应, +// 且题头 start/end 两组各自镜像 entity 行两个 td 的 1rem 左右内边距(end 组紧跟 start 组); // flex: 1 撑满 main-content 剩余高度,使灰底延伸到页面底部。 // 历史上 .audit-page 曾整体铺白导致页面与其他页面观感不一致, // 分页条曾左右各留 1rem 导致白底与上方卡片错位, @@ -71,14 +72,19 @@ describe('AuditLogList 页面外观', () => { } }) - it('题头分组间距与 entity 行一致(start 间距 1rem、end 间距 1.5rem 且右对齐)', () => { + it('题头分组间距与 entity 行一致(start 间距 1rem、end 间距 1.5rem 且不右对齐)', () => { + // entity 行由两个自带 1rem 左右内边距的 td 组成,end 组紧跟 start 组(行宽随内容收缩); + // 题头两组各自镜像 1rem 内边距才能与数据列对齐, + // 历史上曾用 margin-left: auto 把结果/IP 推到行尾导致与数据错位 19rem,本测试防止回归。 const start = styleRule('.header-start') expect(start).toMatch(/gap:\s*1rem/) + expect(start).toMatch(/padding:\s*0\s+1rem/) const end = styleRule('.header-end') expect(end).toMatch(/gap:\s*1\.5rem/) - expect(end).toMatch(/margin-left:\s*auto/) + expect(end).toMatch(/padding:\s*0\s+1rem/) + expect(end).not.toMatch(/margin-left:\s*auto/) const header = styleRule('.audit-header') - expect(header).toMatch(/padding:\s*0\.5rem\s+1rem/) + expect(header).toMatch(/padding:\s*0\.5rem\s+0/) expect(header).toMatch(/border-bottom:\s*1px\s+solid\s+#eaecf0/) }) diff --git a/plugin-operation-audit/ui/src/views/AuditLogList.vue b/plugin-operation-audit/ui/src/views/AuditLogList.vue index 6c858f0..9b7cb59 100644 --- a/plugin-operation-audit/ui/src/views/AuditLogList.vue +++ b/plugin-operation-audit/ui/src/views/AuditLogList.vue @@ -242,7 +242,7 @@ onMounted(fetchLogs)