align(shop/records/tasks): 店铺管理/密钥、生成记录查看大图、数字人版本操作矩阵、视频任务明细/下载 主操作统一实心 small(对齐 .btn-sm);纯复制链接辅助保留 text

This commit is contained in:
2026-09-06 21:41:26 +08:00
parent 2691472a5e
commit fc4eff2f01
6 changed files with 60 additions and 12 deletions
@@ -0,0 +1,49 @@
import test from 'node:test'
import assert from 'node:assert/strict'
import { readSource } from './helpers.ts'
/** 对齐旧版 .btn-smshop/records/任务 域主操作按钮(编辑/凭证/删除/查看/发布/设最新/下载/明细)统一实心 small;纯复制链接辅助仍可 text。 */
function assertRowButtonSolid(source: string, action: string) {
assert.match(source, new RegExp(`<el-button[^>]*size="small"[^>]*@click="${action}`), `${action} 为 size=small 实心按钮`)
assert.doesNotMatch(source, new RegExp(`<el-button[^>]*link[^>]*@click="${action}`), `${action} 不再 link`)
assert.doesNotMatch(source, new RegExp(`<el-button[^>]*text[^>]*@click="${action}`), `${action} 不再 text`)
}
test('align_shop_manage_row_buttons_solid', () => {
const s = readSource('src/pages/shop/ShopManagePage.vue')
assertRowButtonSolid(s, 'openEdit')
assertRowButtonSolid(s, 'showCredential')
assertRowButtonSolid(s, 'remove')
})
test('align_shop_keys_row_buttons_solid', () => {
const s = readSource('src/pages/shop/ShopKeysPage.vue')
assertRowButtonSolid(s, 'openEdit')
assertRowButtonSolid(s, 'remove')
})
test('align_records_history_preview_solid', () => {
const s = readSource('src/pages/records/RecordsHistoryPage.vue')
assertRowButtonSolid(s, 'openPreview')
})
test('align_digital_human_row_buttons_solid', () => {
const s = readSource('src/pages/records/RecordsDigitalHumanVersionPage.vue')
assertRowButtonSolid(s, 'release')
assertRowButtonSolid(s, 'setLatest')
assertRowButtonSolid(s, 'download')
assertRowButtonSolid(s, 'remove')
})
test('align_image_video_detail_and_download_solid', () => {
const s = readSource('src/pages/tasks/ImageVideoTasksPage.vue')
assertRowButtonSolid(s, 'openDetail')
assertRowButtonSolid(s, 'downloadVideo')
})
test('align_copy_link_aux_kept_text', () => {
// 辅助"复制链接"保留 text(非破坏主操作),避免被误伤。
const s = readSource('src/pages/tasks/ImageVideoTasksPage.vue')
assert.match(s, /<el-button[^>]*text[^>]*@click="copyLink/, '复制链接保留 text')
})