feat: 操作审计页恢复控制台默认灰底白卡片观感
- .audit-page 不再整体铺白,仅保留 flex: 1 撑满内容区高度, 控制台默认灰底透出,筛选栏/数据列表以白色卡片呈现(与插件页等页面一致) - 更新 AuditLogList.appearance.spec.ts 结构性回归测试为「不铺白」断言
This commit is contained in:
@@ -3,9 +3,11 @@ import { fileURLToPath } from 'node:url'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
// 结构性回归测试:不渲染组件,仅检查 SFC 源码中的页面布局样式。
|
||||
// 控制台内容区默认为灰底,操作审计页需整体铺白(flex: 1 撑满 main-content 剩余高度),
|
||||
// 使筛选栏、数据列表、分页条之间的间隙不再露出灰色;同时分页条两端需向内留白,
|
||||
// 不贴白色区域边缘。历史上这两处曾分别为灰底间隙与贴边分页,本测试防止回归。
|
||||
// 操作审计页需保持控制台默认灰底(.audit-page 不自行设置背景色),
|
||||
// 筛选栏、数据列表以白色卡片呈现,与控制台其他页面观感一致;
|
||||
// flex: 1 撑满 main-content 剩余高度,使灰底延伸到页面底部。
|
||||
// 分页条两端需向内留白,不贴内容区边缘。
|
||||
// 历史上 .audit-page 曾整体铺白导致页面与其他页面观感不一致,本测试防止回归。
|
||||
const sfc = readFileSync(fileURLToPath(new URL('./AuditLogList.vue', import.meta.url)), 'utf-8')
|
||||
|
||||
function styleRule(selector: string): string {
|
||||
@@ -15,14 +17,14 @@ function styleRule(selector: string): string {
|
||||
return sfc.slice(start, end)
|
||||
}
|
||||
|
||||
describe('AuditLogList 页面铺白', () => {
|
||||
it('.audit-page 撑满控制台内容区剩余高度并使用白色背景', () => {
|
||||
describe('AuditLogList 页面外观', () => {
|
||||
it('.audit-page 撑满控制台内容区剩余高度且不铺白(保持默认灰底)', () => {
|
||||
const rule = styleRule('.audit-page')
|
||||
expect(rule).toMatch(/flex:\s*1/)
|
||||
expect(rule).toMatch(/background:\s*#fff/)
|
||||
expect(rule).not.toMatch(/background\s*:/)
|
||||
})
|
||||
|
||||
it('.audit-pagination 左右向内留白,两端不贴白色区域边缘', () => {
|
||||
it('.audit-pagination 左右向内留白,两端不贴内容区边缘', () => {
|
||||
const rule = styleRule('.audit-pagination')
|
||||
expect(rule).toMatch(/padding:\s*0\s+1rem\s+1rem/)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user