align(shop·像素复刻): 店铺密钥/店铺管理 两页自绘复刻旧版(panel-shop-keys/shop-manage)——序号列+令牌掩码+白名单状态药丸(正常绿/未加白名单红/未检测灰)+悬停详情、密码列******+眼睛实时读明文、btn-sm行操作+原生confirm删除+旧式分页
This commit is contained in:
@@ -7,8 +7,6 @@ import { readSource } from './helpers.ts'
|
||||
// 例外:DuplicateCheckPage 不动;dialog/表单的 width 不属于表格列。
|
||||
|
||||
const PAGES = [
|
||||
'src/pages/shop/ShopKeysPage.vue',
|
||||
'src/pages/shop/ShopManagePage.vue',
|
||||
'src/pages/records/RecordsDigitalHumanVersionPage.vue',
|
||||
'src/pages/records/RecordsSoftwareVersionPage.vue',
|
||||
'src/pages/tasks/ImageVideoTasksPage.vue',
|
||||
@@ -63,6 +61,8 @@ test('align_column_width_boundary_empty_input', () => {
|
||||
['src/pages/asin/QueryAsinPage.vue', 'query-asin-table-scroll'],
|
||||
['src/pages/asin/SkipPricePage.vue', 'skip-price-asin-table-scroll'],
|
||||
['src/pages/asin/ProductCategoryPage.vue', 'category-table-scroll'],
|
||||
['src/pages/shop/ShopKeysPage.vue', 'shop-key-table-scroll'],
|
||||
['src/pages/shop/ShopManagePage.vue', 'shop-manage-table-scroll'],
|
||||
]) {
|
||||
const src = readSource(page)
|
||||
assert.equal(/el-table-column/.test(src), false, `${page} 已像素复刻原生表格,不再有 el-table-column`)
|
||||
|
||||
@@ -43,13 +43,7 @@ test('align_pagination_boundary_single_item', () => {
|
||||
})
|
||||
|
||||
test('align_pagination_repeated_operation_is_idempotent', () => {
|
||||
// 已有分页的页面保持原样,不被破坏;已像素复刻(自绘旧式分页/原生表格)的页单独断言。
|
||||
for (const page of [
|
||||
'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 分页')
|
||||
@@ -59,4 +53,10 @@ test('align_pagination_repeated_operation_is_idempotent', () => {
|
||||
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 分页')
|
||||
})
|
||||
|
||||
@@ -15,12 +15,13 @@ test('align_shop_keys_columns', () => {
|
||||
|
||||
test('align_shop_manage_columns_order_and_labels', () => {
|
||||
const page = readSource('src/pages/shop/ShopManagePage.vue')
|
||||
assert.doesNotMatch(page, /label="序号"/, '不再展示序号列')
|
||||
// 像素复刻旧版 panel-shop-manage:序号列保留(admin.html:5339)。
|
||||
assert.match(page, /序号/, '按旧版展示序号列')
|
||||
assert.doesNotMatch(page, /label="ID"/, '不展示 ID 列')
|
||||
// 列序:分组 → 店铺名 → 店铺商城名 → 自动化账号 → 账号 → 密码(对齐 admin.html:5339-5348)。
|
||||
const table = page.slice(page.indexOf('<el-table'))
|
||||
const orderMatch = /label="分组"[\s\S]*?label="店铺名"[\s\S]*?label="店铺商城名"[\s\S]*?label="自动化账号"[\s\S]*?label="账号"[\s\S]*?label="密码"/.exec(table)
|
||||
// 列序:序号 → 分组 → 店铺名 → 店铺商城名 → 自动化账号 → 账号 → 密码(对齐 admin.html:5339-5348)。
|
||||
const table = page.slice(page.indexOf('<table'))
|
||||
const orderMatch = /序号[\s\S]*?分组[\s\S]*?店铺名[\s\S]*?店铺商城名[\s\S]*?自动化账号[\s\S]*?账号[\s\S]*?密码/.exec(table)
|
||||
assert.ok(orderMatch, '店铺管理列序对齐参考')
|
||||
assert.doesNotMatch(table, /店铺名称/, '列名对齐「店铺名」')
|
||||
assert.doesNotMatch(table, /label="商城"/, '列名对齐「店铺商城名」')
|
||||
assert.doesNotMatch(table, />商城</, '列名对齐「店铺商城名」')
|
||||
})
|
||||
|
||||
@@ -10,17 +10,20 @@ function assertRowButtonSolid(source: string, action: string) {
|
||||
assert.doesNotMatch(source, new RegExp(`<el-button[^>]*text[^>]*@click="${action}`), `${action} 不再 text`)
|
||||
}
|
||||
|
||||
test('align_shop_manage_row_buttons_solid', () => {
|
||||
test('align_shop_manage_row_buttons_old_btn', () => {
|
||||
const s = readSource('src/pages/shop/ShopManagePage.vue')
|
||||
assertRowButtonSolid(s, 'openEdit')
|
||||
assertRowButtonSolid(s, 'showCredential')
|
||||
assertRowButtonSolid(s, 'remove')
|
||||
assert.match(s, /class="btn btn-sm"[^>]*@click="openEdit\(row\)"/, '编辑用旧版 btn-sm 实心小按钮')
|
||||
assert.match(s, /class="btn btn-sm btn-secondary"[^>]*@click="showCredential\(row\)"/, '凭证用旧版 btn-sm btn-secondary')
|
||||
assert.match(s, /class="btn btn-sm btn-danger"[^>]*@click="remove\(row\)"/, '删除用旧版 btn-sm btn-danger')
|
||||
assert.doesNotMatch(s, /el-button[^>]*@click="openEdit/, '行内不再用 EP 按钮')
|
||||
assert.match(s, /window\.confirm\(`确定删除店铺/, '删除确认原生 confirm 对齐旧版')
|
||||
})
|
||||
|
||||
test('align_shop_keys_row_buttons_solid', () => {
|
||||
test('align_shop_keys_row_buttons_old_btn', () => {
|
||||
const s = readSource('src/pages/shop/ShopKeysPage.vue')
|
||||
assertRowButtonSolid(s, 'openEdit')
|
||||
assertRowButtonSolid(s, 'remove')
|
||||
assert.match(s, /class="btn btn-sm"[^>]*@click="openEdit\(row\)"/, '编辑用旧版 btn-sm 实心小按钮')
|
||||
assert.match(s, /class="btn btn-sm btn-danger"[^>]*@click="remove\(row\)"/, '删除用旧版 btn-sm btn-danger')
|
||||
assert.doesNotMatch(s, /el-button[^>]*@click="openEdit/, '行内不再用 EP 按钮')
|
||||
})
|
||||
|
||||
test('align_records_history_thumb_click_opens_preview', () => {
|
||||
|
||||
Reference in New Issue
Block a user