From f324c6bd3d223271414c388e73b59a8b5824f235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E8=87=AA=E8=BE=BE?= <980324341@qq.com> Date: Sun, 6 Sep 2026 23:05:51 +0800 Subject: [PATCH] =?UTF-8?q?align(shop=C2=B7=E5=83=8F=E7=B4=A0=E5=A4=8D?= =?UTF-8?q?=E5=88=BB):=20=E5=BA=97=E9=93=BA=E5=AF=86=E9=92=A5/=E5=BA=97?= =?UTF-8?q?=E9=93=BA=E7=AE=A1=E7=90=86=20=E4=B8=A4=E9=A1=B5=E8=87=AA?= =?UTF-8?q?=E7=BB=98=E5=A4=8D=E5=88=BB=E6=97=A7=E7=89=88(panel-shop-keys/s?= =?UTF-8?q?hop-manage)=E2=80=94=E2=80=94=E5=BA=8F=E5=8F=B7=E5=88=97+?= =?UTF-8?q?=E4=BB=A4=E7=89=8C=E6=8E=A9=E7=A0=81+=E7=99=BD=E5=90=8D?= =?UTF-8?q?=E5=8D=95=E7=8A=B6=E6=80=81=E8=8D=AF=E4=B8=B8(=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E7=BB=BF/=E6=9C=AA=E5=8A=A0=E7=99=BD=E5=90=8D?= =?UTF-8?q?=E5=8D=95=E7=BA=A2/=E6=9C=AA=E6=A3=80=E6=B5=8B=E7=81=B0)+?= =?UTF-8?q?=E6=82=AC=E5=81=9C=E8=AF=A6=E6=83=85=E3=80=81=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E5=88=97******+=E7=9C=BC=E7=9D=9B=E5=AE=9E=E6=97=B6=E8=AF=BB?= =?UTF-8?q?=E6=98=8E=E6=96=87=E3=80=81btn-sm=E8=A1=8C=E6=93=8D=E4=BD=9C+?= =?UTF-8?q?=E5=8E=9F=E7=94=9Fconfirm=E5=88=A0=E9=99=A4+=E6=97=A7=E5=BC=8F?= =?UTF-8?q?=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/shop/ShopKeysPage.vue | 368 ++++++++++++--- .../src/pages/shop/ShopManagePage.vue | 424 ++++++++++++++---- .../tests/align-column-width.test.ts | 4 +- .../tests/align-pagination.test.ts | 14 +- .../tests/align-shop-columns.test.ts | 11 +- .../align-shop-records-row-buttons.test.ts | 17 +- 6 files changed, 664 insertions(+), 174 deletions(-) diff --git a/admin-frontend-vue/src/pages/shop/ShopKeysPage.vue b/admin-frontend-vue/src/pages/shop/ShopKeysPage.vue index 4f7b2ee6..caeb4ea1 100644 --- a/admin-frontend-vue/src/pages/shop/ShopKeysPage.vue +++ b/admin-frontend-vue/src/pages/shop/ShopKeysPage.vue @@ -1,8 +1,9 @@ diff --git a/admin-frontend-vue/src/pages/shop/ShopManagePage.vue b/admin-frontend-vue/src/pages/shop/ShopManagePage.vue index 0250a677..c7de9aa1 100644 --- a/admin-frontend-vue/src/pages/shop/ShopManagePage.vue +++ b/admin-frontend-vue/src/pages/shop/ShopManagePage.vue @@ -1,8 +1,9 @@ diff --git a/admin-frontend-vue/tests/align-column-width.test.ts b/admin-frontend-vue/tests/align-column-width.test.ts index b78de4a8..b07a4b60 100644 --- a/admin-frontend-vue/tests/align-column-width.test.ts +++ b/admin-frontend-vue/tests/align-column-width.test.ts @@ -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`) diff --git a/admin-frontend-vue/tests/align-pagination.test.ts b/admin-frontend-vue/tests/align-pagination.test.ts index 199bbc4e..c7ad07f8 100644 --- a/admin-frontend-vue/tests/align-pagination.test.ts +++ b/admin-frontend-vue/tests/align-pagination.test.ts @@ -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 分页') }) diff --git a/admin-frontend-vue/tests/align-shop-columns.test.ts b/admin-frontend-vue/tests/align-shop-columns.test.ts index 6496ed65..519f18ee 100644 --- a/admin-frontend-vue/tests/align-shop-columns.test.ts +++ b/admin-frontend-vue/tests/align-shop-columns.test.ts @@ -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('商城]*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', () => {