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 eda96dd..80e8ebf 100644 --- a/plugin-operation-audit/ui/src/views/AuditLogList.appearance.spec.ts +++ b/plugin-operation-audit/ui/src/views/AuditLogList.appearance.spec.ts @@ -4,10 +4,12 @@ import { describe, expect, it } from 'vitest' // 结构性回归测试:不渲染组件,仅检查 SFC 源码中的页面布局样式。 // 操作审计页需保持控制台默认灰底(.audit-page 不自行设置背景色), -// 筛选栏、数据列表以白色卡片呈现,与控制台其他页面观感一致; +// 筛选栏、数据列表、分页条合并为同一张白色卡片:区块之间不留灰缝, +// 分页条白底随卡片铺满整行、与上方列表左右对齐(与控制台其他列表页观感一致); // flex: 1 撑满 main-content 剩余高度,使灰底延伸到页面底部。 -// 分页条两端需向内留白,不贴内容区边缘。 -// 历史上 .audit-page 曾整体铺白导致页面与其他页面观感不一致,本测试防止回归。 +// 历史上 .audit-page 曾整体铺白导致页面与其他页面观感不一致, +// 分页条曾左右各留 1rem 导致白底与上方卡片错位, +// 卡片之间曾留 1rem 间距导致白色断开,本测试防止回归。 const sfc = readFileSync(fileURLToPath(new URL('./AuditLogList.vue', import.meta.url)), 'utf-8') function styleRule(selector: string): string { @@ -24,8 +26,19 @@ describe('AuditLogList 页面外观', () => { expect(rule).not.toMatch(/background\s*:/) }) - it('.audit-pagination 左右向内留白,两端不贴内容区边缘', () => { + it('.audit-body 不设区块间距(筛选/数据/分页之间白色连成一体)', () => { + const rule = styleRule('.audit-body') + expect(rule).not.toMatch(/gap\s*:/) + }) + + it('筛选栏与数据列表合并为同一张 VCard', () => { + expect(sfc.match(/ { const rule = styleRule('.audit-pagination') - expect(rule).toMatch(/padding:\s*0\s+1rem\s+1rem/) + expect(rule).not.toMatch(/padding:\s*0\s+1rem/) + expect(rule).toMatch(/padding:\s*1rem/) + expect(rule).toMatch(/border-top:\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 413988e..2db1dff 100644 --- a/plugin-operation-audit/ui/src/views/AuditLogList.vue +++ b/plugin-operation-audit/ui/src/views/AuditLogList.vue @@ -163,69 +163,71 @@ onMounted(fetchLogs)
- - -
- - - - - - - -
- 查询 - 重置 -
-
-
- + + +
+
+ + + + + + + +
+ 查询 + 重置 +
+
+
+ + +
+ +
- -
- -
@@ -315,7 +317,7 @@ onMounted(fetchLogs) padding: 1rem 1.25rem 2rem; display: flex; flex-direction: column; - gap: 1rem; + /* 筛选、数据、分页合并为一张白卡,区块之间不留灰缝 */ } .audit-logo { display: inline-flex; @@ -365,6 +367,8 @@ onMounted(fetchLogs) } .audit-error { --tw-ring-color: transparent; + /* 错误提示位于白卡上方,与卡片留出间距 */ + margin-bottom: 1rem; } .audit-row { cursor: pointer; @@ -406,9 +410,9 @@ onMounted(fetchLogs) .status-ok { color: #0f766e; background: rgba(76, 203, 160, 0.15); } .status-fail { color: var(--audit-red); background: rgba(215, 29, 29, 0.12); } .audit-pagination { - display: flex; - justify-content: center; - /* 左右各留 1rem,与内容区留白呼应 */ - padding: 0 1rem 1rem; + /* 在白卡内铺满整行:白底与上方列表左右对齐;上下各留 1rem, + 文字的垂直位置与原分页条一致;上边缘 1px 分隔线同控制台卡片 footer 观感 */ + padding: 1rem; + border-top: 1px solid #eaecf0; }