feat(需求): ①全站列表/卡片分页统一为共享 OldPagination(共N条+10/20/50/100条数可选+跳页) ②创建用户菜单权限改左右布局(后台|桌面端并排) ③修复角色筛选失效(normalizeUserPageParams 白名单丢 role 字段)

This commit is contained in:
2026-09-07 00:02:30 +08:00
parent d3f5a371e3
commit cd6beef388
18 changed files with 323 additions and 245 deletions
@@ -13,10 +13,13 @@ test('align_pagination_normal_primary_path', () => {
})
test('align_pagination_normal_variant_input', () => {
// 数字人版本数字页码含上一页/下一页。
// 数字人版本分页升级为共享 OldPagination含上一页/下一页/条数选择)
const dh = readSource('src/pages/records/RecordsDigitalHumanVersionPage.vue')
assert.match(dh, />上一页<\/button>/, '数字人分页含上一页')
assert.match(dh, />下一页<\/button>/, '数字人分页含下一页')
assert.match(dh, /OldPagination/, '数字人分页用共享组件')
const comp = readSource('src/components/OldPagination.vue')
assert.match(comp, />上一页<\/button>/, '共享分页含上一页')
assert.match(comp, />下一页<\/button>/, '共享分页含下一页')
assert.match(comp, /10, 20, 50, 100|sizes/, '共享分页默认 10/20/50/100')
})
test('align_pagination_boundary_empty_input', () => {
@@ -35,19 +38,19 @@ test('align_pagination_boundary_single_item', () => {
test('align_pagination_repeated_operation_is_idempotent', () => {
// 已像素复刻(自绘旧式分页/原生表格)的页单独断言。
const users = readSource('src/pages/account/UsersPage.vue')
assert.match(users, /class="pagination"/, '用户页已像素复刻,用旧式分页容器')
assert.doesNotMatch(users, /el-pagination/, '用户页不再用 EP 分页')
for (const page of [
'src/pages/account/UsersPage.vue',
'src/pages/asin/AsinInvalidPage.vue',
'src/pages/asin/DedupeRegistryPage.vue',
'src/pages/shop/ShopManagePage.vue',
'src/pages/shop/ShopKeysPage.vue',
'src/pages/tasks/ImageVideoTasksPage.vue',
]) {
const src = readSource(page)
assert.match(src, /OldPagination/, `${page} 用共享旧式分页`)
assert.doesNotMatch(src, /el-pagination/, `${page} 不再用 EP 分页`)
}
const groups = readSource('src/pages/account/GroupsPage.vue')
assert.doesNotMatch(groups, /el-pagination/, '分组管理已像素复刻旧版(panel-group-manage 无分页)')
assert.doesNotMatch(groups, /el-pagination/, '分组管理全量渲染无分页')
assert.doesNotMatch(groups, /pagedRows/, '分组管理全量渲染无客户端切片')
const invalid = readSource('src/pages/asin/AsinInvalidPage.vue')
assert.match(invalid, /class="pagination"/, '品牌库已像素复刻,用旧式分页容器')
assert.doesNotMatch(invalid, /el-pagination/, '品牌库不再用 EP 分页')
const shops = readSource('src/pages/shop/ShopManagePage.vue')
assert.match(shops, /class="pagination"/, '店铺管理已像素复刻,用旧式分页容器')
assert.doesNotMatch(shops, /el-pagination/, '店铺管理不再用 EP 分页')
const keys = readSource('src/pages/shop/ShopKeysPage.vue')
assert.match(keys, /class="pagination"/, '店铺密钥已像素复刻,用旧式分页容器')
assert.doesNotMatch(keys, /el-pagination/, '店铺密钥不再用 EP 分页')
})
@@ -13,7 +13,7 @@ test('align_shop_data_grid_normal_primary_path', () => {
test('align_shop_data_grid_normal_variant_input', () => {
const src = readSource(PAGE)
assert.match(src, /cardPageSize\s*=\s*9|pageSize\s*=\s*9/, '卡片分页每页 9 张')
assert.match(src, /cardPageSize = ref\(10\)|cardPageSize\.value/, '卡片分页默认 10 张且可调')
assert.match(src, /cardPage\b/, '应有卡片页状态')
assert.match(src, /pagedResultRows|cardPageRows/, '卡片应绑定按 9 张切片的数据')
})
+4 -2
View File
@@ -39,8 +39,10 @@ test('test_task_250_users_list_boundary_empty_input', () => {
test('test_task_250_users_list_boundary_single_item', () => {
// 边界:分页/合计形态为“共 N 条”,查询后回第一页。
const page = readSource('src/pages/account/UsersPage.vue')
assert.match(page, /共 .*total.*条/, '分页页脚应有“共 N 条”合计')
assert.match(page, /page\s*=\s*1|filters\.page\s*=\s*USER_PAGE_MIN_PAGE/, '查询需重置回第一页')
assert.match(page, /OldPagination/, '分页走共享组件')
const comp = readSource('src/components/OldPagination.vue')
assert.match(comp, /共 \{\{ total \}\} 条/, '共享分页含“共 N 条”合计')
assert.match(page, /filters\.page = 1/, '查询需重置回第一页')
})
test('test_task_250_users_list_boundary_limit_or_missing_field', () => {