8776a9bf1e
- ElMessage.error 全收进 showAdminFeedback(例外清单 CAP=0,唯一保留的裸调用是出口本体); window.confirm 24 处全部改成 await 的 openAdminConfirm(逐处核过所在函数本就 async, 不存在"点了确认不执行"的异步断层)。 - 新增 load-failure-model + LoadFailureBar:22/23 个取数页有失败态与真重试 (只有"知道了"清条不算过),例外仅登录页。 - DedupeRegistryPage / DuplicateCheckPage 补 onUnmounted,并加全树定时器/监听配对判据。 - 去重页那处"能点但后端 403":读侧认 wholeCompany、写侧只认 groupIds/userIds 的不对称 本轮没动后端(前端拿不到与写侧同集合的 groupIds,按它置灰会误伤同事名下真能改的行=静默删功能); 先修更实在的一半——403 的中文原因此前整段丢失,现在走统一文案到界面。 - 验收:node --test 1,818 例 0 红、npx vue-tsc --noEmit rc=0;5 支新判据 26 例。
56 lines
3.5 KiB
TypeScript
56 lines
3.5 KiB
TypeScript
import test from 'node:test'
|
||
import assert from 'node:assert/strict'
|
||
import { readSource } from './helpers.ts'
|
||
|
||
/** 对齐旧版 .btn-sm:shop/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_old_btn', () => {
|
||
const s = readSource('src/pages/shop/ShopManagePage.vue')
|
||
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, /openAdminConfirm\(\{ message: `确定删除店铺/, '删除确认走统一确认出口,文案对齐旧版')
|
||
})
|
||
|
||
test('align_shop_keys_row_buttons_old_btn', () => {
|
||
const s = readSource('src/pages/shop/ShopKeysPage.vue')
|
||
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', () => {
|
||
const s = readSource('src/pages/records/RecordsHistoryPage.vue')
|
||
assert.match(s, /class="thumb"[^>]*@click="openPreview\(h\)"/, '点击缩略图直接放大预览')
|
||
assert.doesNotMatch(s, /查看大图/, '无行内「查看大图」按钮')
|
||
})
|
||
|
||
test('align_digital_human_row_buttons_old_btn', () => {
|
||
const s = readSource('src/pages/records/RecordsDigitalHumanVersionPage.vue')
|
||
assert.match(s, /class="btn btn-sm"[^>]*@click="release\(row\)"/, '发布用旧版 btn-sm')
|
||
assert.match(s, /class="btn btn-sm"[^>]*@click="setLatest\(row\)"/, '设为最新用旧版 btn-sm')
|
||
assert.match(s, /class="btn btn-sm btn-secondary"[^>]*@click="download\(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="release/, '行内不再用 EP 按钮')
|
||
assert.match(s, /openAdminConfirm\(\{ message: text, danger: /, '确认走统一确认出口,文案仍由模型给出')
|
||
})
|
||
|
||
test('align_image_video_detail_and_download_old_btn', () => {
|
||
const s = readSource('src/pages/tasks/ImageVideoTasksPage.vue')
|
||
assert.match(s, /class="btn btn-sm btn-secondary"[^>]*@click="downloadVideo\(task, index, video\)"/, '视频下载为旧版 btn-sm btn-secondary')
|
||
assert.match(s, /class="btn btn-sm"[^>]*@click="copyLink\(video\.displayUrl\)"/, '复制链接为旧版 btn-sm')
|
||
})
|
||
|
||
test('align_copy_link_aux_old_btn', () => {
|
||
// 辅助"复制链接"为旧版 btn-sm 小按钮。
|
||
const s = readSource('src/pages/tasks/ImageVideoTasksPage.vue')
|
||
assert.match(s, /class="btn btn-sm"[^>]*@click="copyLink/, '复制链接用 btn-sm')
|
||
})
|