align(account·像素复刻): 用户管理/菜单权限配置/分组管理 三页自绘复刻旧版(panel-users/columns/group-manage)——原生表格+btn-sm行操作+原生confirm删除+旧式分页(菜单/分组全量无分页同旧版)+分组摘要chips;创建/编辑/菜单树弹窗保留现有组件
This commit is contained in:
@@ -10,20 +10,25 @@ function assertRowButtonSolid(source: string, action: string) {
|
||||
assert.doesNotMatch(source, new RegExp(`<el-button[^>]*text[^>]*@click="${action}`), `${action} 不再 text`)
|
||||
}
|
||||
|
||||
test('align_users_row_buttons_solid', () => {
|
||||
test('align_users_row_buttons_old_btn', () => {
|
||||
const s = readSource('src/pages/account/UsersPage.vue')
|
||||
assertRowButtonSolid(s, 'openEdit')
|
||||
assertRowButtonSolid(s, 'removeUser')
|
||||
assert.match(s, /class="btn btn-sm"[^>]*@click="openEdit\(row\)"/, '编辑用旧版 btn-sm 实心小按钮')
|
||||
assert.match(s, /class="btn btn-sm btn-danger"[^>]*@click="removeUser\(row\)"/, '删除用旧版 btn-sm btn-danger')
|
||||
assert.doesNotMatch(s, /el-button/, '用户页已自绘,无 EP 按钮')
|
||||
assert.match(s, /window\.confirm\(deleteConfirmMessage\(row\)\)/, '删除确认走原生 confirm 对齐旧版')
|
||||
})
|
||||
|
||||
test('align_groups_row_buttons_solid', () => {
|
||||
test('align_groups_row_buttons_old_btn', () => {
|
||||
const s = readSource('src/pages/account/GroupsPage.vue')
|
||||
assertRowButtonSolid(s, 'openEdit')
|
||||
assertRowButtonSolid(s, 'removeGroup')
|
||||
assert.match(s, /class="btn btn-sm"[^>]*@click="openEdit\(group\)"/, '编辑用旧版 btn-sm 实心小按钮')
|
||||
assert.match(s, /class="btn btn-sm btn-danger"[^>]*@click="removeGroup\(group\)"/, '删除用旧版 btn-sm btn-danger')
|
||||
assert.doesNotMatch(s, /el-button[^>]*@click="openEdit/, '行内不再用 EP 按钮')
|
||||
})
|
||||
|
||||
test('align_menus_row_buttons_solid', () => {
|
||||
test('align_menus_row_buttons_old_btn', () => {
|
||||
const s = readSource('src/pages/account/MenusPage.vue')
|
||||
assertRowButtonSolid(s, 'openEdit')
|
||||
assertRowButtonSolid(s, 'removeMenu')
|
||||
assert.match(s, /class="btn btn-sm"[^>]*@click="openEdit\(row\)"/, '编辑用旧版 btn-sm 实心小按钮')
|
||||
assert.match(s, /class="btn btn-sm btn-danger"[^>]*@click="removeMenu\(row\)"/, '删除用旧版 btn-sm btn-danger')
|
||||
assert.doesNotMatch(s, /el-button[^>]*@click="openEdit/, '行内不再用 EP 按钮')
|
||||
assert.match(s, /window\.confirm\(`确定删除菜单/, '删除确认走原生 confirm 对齐旧版')
|
||||
})
|
||||
|
||||
@@ -7,9 +7,6 @@ import { readSource } from './helpers.ts'
|
||||
// 例外:DuplicateCheckPage 不动;dialog/表单的 width 不属于表格列。
|
||||
|
||||
const PAGES = [
|
||||
'src/pages/account/GroupsPage.vue',
|
||||
'src/pages/account/MenusPage.vue',
|
||||
'src/pages/account/UsersPage.vue',
|
||||
'src/pages/asin/AsinInvalidPage.vue',
|
||||
'src/pages/asin/ProductCategoryPage.vue',
|
||||
'src/pages/asin/QueryAsinPage.vue',
|
||||
@@ -56,6 +53,15 @@ test('align_column_width_boundary_empty_input', () => {
|
||||
const dedupe = readSource('src/pages/asin/DedupeRegistryPage.vue')
|
||||
assert.equal(/el-table-column/.test(dedupe), false, '去重汇总已像素复刻 admin panel-dedupe-total-data 原生表格,不再有 el-table-column')
|
||||
assert.match(dedupe, /class="table-scroll dedupe-table-scroll"/, '去重汇总用原生 .table-scroll 表格')
|
||||
const users = readSource('src/pages/account/UsersPage.vue')
|
||||
assert.equal(/el-table-column/.test(users), false, '用户管理已像素复刻 admin panel-users 原生表格,不再有 el-table-column')
|
||||
assert.match(users, /class="table-scroll user-table-scroll"/, '用户管理用原生 .table-scroll 表格')
|
||||
const menus = readSource('src/pages/account/MenusPage.vue')
|
||||
assert.equal(/el-table-column/.test(menus), false, '菜单配置已像素复刻 admin panel-columns 原生表格,不再有 el-table-column')
|
||||
assert.match(menus, /class="table-scroll columns-table-scroll"/, '菜单配置用原生 .table-scroll 表格')
|
||||
const groups = readSource('src/pages/account/GroupsPage.vue')
|
||||
assert.equal(/el-table-column/.test(groups), false, '分组管理已像素复刻 admin panel-group-manage 原生表格,不再有 el-table-column')
|
||||
assert.match(groups, /class="table-scroll"/, '分组管理用原生 .table-scroll 表格')
|
||||
})
|
||||
|
||||
test('align_column_width_dependency_failure_returns_actionable_message', () => {
|
||||
|
||||
@@ -7,8 +7,8 @@ import { readSource } from './helpers.ts'
|
||||
// 菜单管理是树结构(非列表),商品类目树用懒加载+加载更多节点,均豁免。
|
||||
|
||||
test('align_pagination_normal_primary_path', () => {
|
||||
// 分组管理已像素复刻旧版(panel-group-manage 无分页),豁免;其余列表保留分页。
|
||||
for (const page of [
|
||||
'src/pages/account/GroupsPage.vue',
|
||||
'src/pages/records/RecordsSoftwareVersionPage.vue',
|
||||
'src/pages/asin/ProductCategoryPage.vue',
|
||||
]) {
|
||||
@@ -20,7 +20,6 @@ test('align_pagination_normal_primary_path', () => {
|
||||
test('align_pagination_normal_variant_input', () => {
|
||||
// 分页组件需含上一页/下一页(prev/next),中文文案由全局 zh-cn locale 渲染。
|
||||
for (const page of [
|
||||
'src/pages/account/GroupsPage.vue',
|
||||
'src/pages/records/RecordsSoftwareVersionPage.vue',
|
||||
'src/pages/asin/ProductCategoryPage.vue',
|
||||
]) {
|
||||
@@ -30,8 +29,8 @@ test('align_pagination_normal_variant_input', () => {
|
||||
})
|
||||
|
||||
test('align_pagination_boundary_empty_input', () => {
|
||||
// 分组/软件版本为全量拉取,走客户端切片分页(computed 按 page/pageSize 切)。
|
||||
for (const page of ['src/pages/account/GroupsPage.vue', 'src/pages/records/RecordsSoftwareVersionPage.vue']) {
|
||||
// 软件版本为全量拉取,走客户端切片分页(computed 按 page/pageSize 切)。
|
||||
for (const page of ['src/pages/records/RecordsSoftwareVersionPage.vue']) {
|
||||
const src = readSource(page)
|
||||
assert.match(src, /pagedRows|pageRows|pageItems|pagedItems/, `${page} 应有客户端分页切片`)
|
||||
assert.match(src, /:data="paged/, `${page} 表格应绑定分页后的数据`)
|
||||
@@ -46,13 +45,18 @@ test('align_pagination_boundary_single_item', () => {
|
||||
})
|
||||
|
||||
test('align_pagination_repeated_operation_is_idempotent', () => {
|
||||
// 已有分页的页面(12 页)保持原样,不被破坏。
|
||||
// 已有分页的页面保持原样,不被破坏;已像素复刻(自绘旧式分页)的页单独断言。
|
||||
for (const page of [
|
||||
'src/pages/account/UsersPage.vue',
|
||||
'src/pages/asin/AsinInvalidPage.vue',
|
||||
'src/pages/shop/ShopManagePage.vue',
|
||||
]) {
|
||||
const src = readSource(page)
|
||||
assert.match(src, /el-pagination/, `${page} 既有分页保留`)
|
||||
}
|
||||
const users = readSource('src/pages/account/UsersPage.vue')
|
||||
assert.match(users, /class="pagination"/, '用户页已像素复刻,用旧式分页容器')
|
||||
assert.doesNotMatch(users, /el-pagination/, '用户页不再用 EP 分页')
|
||||
const groups = readSource('src/pages/account/GroupsPage.vue')
|
||||
assert.doesNotMatch(groups, /el-pagination/, '分组管理已像素复刻旧版(panel-group-manage 无分页)')
|
||||
assert.doesNotMatch(groups, /pagedRows/, '分组管理全量渲染无客户端切片')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user