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'
|
import { describe, expect, it } from 'vitest'
|
||||||
|
|
||||||
// 结构性回归测试:不渲染组件,仅检查 SFC 源码中的页面布局样式。
|
// 结构性回归测试:不渲染组件,仅检查 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')
|
const sfc = readFileSync(fileURLToPath(new URL('./AuditLogList.vue', import.meta.url)), 'utf-8')
|
||||||
|
|
||||||
function styleRule(selector: string): string {
|
function styleRule(selector: string): string {
|
||||||
@@ -15,14 +17,14 @@ function styleRule(selector: string): string {
|
|||||||
return sfc.slice(start, end)
|
return sfc.slice(start, end)
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('AuditLogList 页面铺白', () => {
|
describe('AuditLogList 页面外观', () => {
|
||||||
it('.audit-page 撑满控制台内容区剩余高度并使用白色背景', () => {
|
it('.audit-page 撑满控制台内容区剩余高度且不铺白(保持默认灰底)', () => {
|
||||||
const rule = styleRule('.audit-page')
|
const rule = styleRule('.audit-page')
|
||||||
expect(rule).toMatch(/flex:\s*1/)
|
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')
|
const rule = styleRule('.audit-pagination')
|
||||||
expect(rule).toMatch(/padding:\s*0\s+1rem\s+1rem/)
|
expect(rule).toMatch(/padding:\s*0\s+1rem\s+1rem/)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -308,9 +308,8 @@ onMounted(fetchLogs)
|
|||||||
--audit-green: #4ccba0;
|
--audit-green: #4ccba0;
|
||||||
--audit-dark: #0e1731;
|
--audit-dark: #0e1731;
|
||||||
--audit-red: #d71d1d;
|
--audit-red: #d71d1d;
|
||||||
/* 控制台内容区整体铺白:筛选、数据、分页之间的间隙不再露出灰底 */
|
/* 保持控制台默认灰底,内容以白色卡片呈现(与控制台其他页面观感一致) */
|
||||||
flex: 1;
|
flex: 1;
|
||||||
background: #fff;
|
|
||||||
}
|
}
|
||||||
.audit-body {
|
.audit-body {
|
||||||
padding: 1rem 1.25rem 2rem;
|
padding: 1rem 1.25rem 2rem;
|
||||||
@@ -409,7 +408,7 @@ onMounted(fetchLogs)
|
|||||||
.audit-pagination {
|
.audit-pagination {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
/* 左右各留 1rem,分页条两端不贴白色区域边缘 */
|
/* 左右各留 1rem,与内容区留白呼应 */
|
||||||
padding: 0 1rem 1rem;
|
padding: 0 1rem 1rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user