feat: 操作审计页筛选/列表/分页合并为一张白卡

- 筛选栏与数据列表由两张独立 VCard 合并为同一张白卡,
  卡片之间不再留 1rem 灰缝,白色区域连成一体
- 分页条移入卡片内部末尾并铺满整行:白底与上方列表左右对齐,
  上下各留 1rem 内边距使文字位置与原先一致,上边缘加 1px #eaecf0
  分隔线(同控制台卡片 footer 观感)
- 错误提示移至白卡上方并留出 1rem 间距
- 更新 AuditLogList.appearance.spec.ts 为「单张白卡」断言
This commit is contained in:
2026-11-21 18:56:05 +08:00
parent c2e38d7c44
commit 8cc66a5693
2 changed files with 96 additions and 79 deletions
@@ -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(/<VCard/g)?.length).toBe(1)
})
it('.audit-pagination 白底铺满整行(不再左右缩进 1rem),仅以 1px 分隔线与列表相接', () => {
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/)
})
})