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
@@ -221,10 +221,10 @@ onMounted(load)
</el-table-column>
<el-table-column label="操作" min-width="240" fixed="right">
<template #default="{ row }">
<el-button v-if="canReleaseDigitalHumanVersion((row as DigitalHumanVersion).status)" text type="warning" size="small" :loading="confirming === (row as DigitalHumanVersion).version" @click="release(row as DigitalHumanVersion)">发布</el-button>
<el-button v-if="!canReleaseDigitalHumanVersion((row as DigitalHumanVersion).status) && canSetLatestDigitalHumanVersion((row as DigitalHumanVersion).status) && !(row as DigitalHumanVersion).isLatest" text type="primary" size="small" :loading="confirming === (row as DigitalHumanVersion).version" @click="setLatest(row as DigitalHumanVersion)">设为最新</el-button>
<el-button v-if="canSetLatestDigitalHumanVersion((row as DigitalHumanVersion).status)" text type="success" size="small" :loading="downloadingVersion === (row as DigitalHumanVersion).version" @click="download(row as DigitalHumanVersion)">下载</el-button>
<el-button v-if="canDelete(row as DigitalHumanVersion)" text type="danger" size="small" :loading="confirming === (row as DigitalHumanVersion).version" @click="remove(row as DigitalHumanVersion)">删除</el-button>
<el-button v-if="canReleaseDigitalHumanVersion((row as DigitalHumanVersion).status)" type="warning" size="small" :loading="confirming === (row as DigitalHumanVersion).version" @click="release(row as DigitalHumanVersion)">发布</el-button>
<el-button v-if="!canReleaseDigitalHumanVersion((row as DigitalHumanVersion).status) && canSetLatestDigitalHumanVersion((row as DigitalHumanVersion).status) && !(row as DigitalHumanVersion).isLatest" type="primary" size="small" :loading="confirming === (row as DigitalHumanVersion).version" @click="setLatest(row as DigitalHumanVersion)">设为最新</el-button>
<el-button v-if="canSetLatestDigitalHumanVersion((row as DigitalHumanVersion).status)" type="success" size="small" :loading="downloadingVersion === (row as DigitalHumanVersion).version" @click="download(row as DigitalHumanVersion)">下载</el-button>
<el-button v-if="canDelete(row as DigitalHumanVersion)" type="danger" size="small" :loading="confirming === (row as DigitalHumanVersion).version" @click="remove(row as DigitalHumanVersion)">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -223,7 +223,7 @@ onMounted(() => {
</el-table-column>
<el-table-column label="操作" min-width="110" fixed="right">
<template #default="{ row }">
<el-button text type="primary" size="small" @click="openPreview(row as HistoryRecordItem)">查看大图</el-button>
<el-button type="primary" size="small" @click="openPreview(row as HistoryRecordItem)">查看大图</el-button>
</template>
</el-table-column>
</el-table>
@@ -156,8 +156,8 @@ onMounted(load)
</el-table-column>
<el-table-column label="操作" min-width="160" fixed="right">
<template #default="{ row }">
<el-button text type="primary" size="small" @click="openEdit(row as ShopKeyItem)">编辑</el-button>
<el-button text type="danger" size="small" @click="remove(row as ShopKeyItem)">删除</el-button>
<el-button type="primary" size="small" @click="openEdit(row as ShopKeyItem)">编辑</el-button>
<el-button type="danger" size="small" @click="remove(row as ShopKeyItem)">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -257,9 +257,9 @@ onMounted(() => {
</el-table-column>
<el-table-column label="操作" min-width="220" fixed="right">
<template #default="{ row }">
<el-button text type="primary" size="small" @click="openEdit(row as ShopSummary)">编辑</el-button>
<el-button text type="warning" size="small" @click="showCredential(row as ShopSummary)">凭证</el-button>
<el-button text type="danger" size="small" @click="remove(row as ShopSummary)">删除</el-button>
<el-button type="primary" size="small" @click="openEdit(row as ShopSummary)">编辑</el-button>
<el-button type="warning" size="small" @click="showCredential(row as ShopSummary)">凭证</el-button>
<el-button type="danger" size="small" @click="remove(row as ShopSummary)">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -277,7 +277,7 @@ onMounted(load)
<span class="task-id">任务 {{ task.taskId }}</span>
</div>
<el-tag :type="statusType(task.status)" size="small">{{ statusLabel(task.status) }}</el-tag>
<el-button text type="primary" size="small" @click="openDetail(task)">明细</el-button>
<el-button type="primary" size="small" @click="openDetail(task)">明细</el-button>
</header>
<div class="task-card-info">
@@ -299,7 +299,6 @@ onMounted(load)
<span v-else class="video-no-preview">视频加载失败可尝试下载</span>
<span class="video-index"> {{ index + 1 }} </span>
<el-button
text
type="success"
size="small"
:disabled="!video.displayUrl"
@@ -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')
})