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 例。
35 lines
2.2 KiB
TypeScript
35 lines
2.2 KiB
TypeScript
import test from 'node:test'
|
||
import assert from 'node:assert/strict'
|
||
import { readSource } from './helpers.ts'
|
||
|
||
/** 对齐旧版 .btn-sm:account 域行内操作统一实心小按钮(不再 link/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_users_row_buttons_old_btn', () => {
|
||
const s = readSource('src/pages/account/UsersPage.vue')
|
||
assert.match(s, /class="btn btn-sm"[^>]*@click="openEdit\(row\)"/, '编辑用旧版 btn-sm 实心小按钮')
|
||
assert.match(s, /class="btn btn-sm btn-danger"[^>]*@click="removeUser\(row\)"/, '删除用旧版 btn-sm btn-danger')
|
||
assert.doesNotMatch(s, /el-button/, '用户页已自绘,无 EP 按钮')
|
||
assert.match(s, /openAdminConfirm\(\{ message: deleteConfirmMessage\(row\), danger: true \}\)/, '删除确认走统一确认出口,文案仍取旧版模型')
|
||
})
|
||
|
||
test('align_groups_row_buttons_old_btn', () => {
|
||
const s = readSource('src/pages/account/GroupsPage.vue')
|
||
assert.match(s, /class="btn btn-sm"[^>]*@click="openEdit\(group\)"/, '编辑用旧版 btn-sm 实心小按钮')
|
||
assert.match(s, /class="btn btn-sm btn-danger"[^>]*@click="removeGroup\(group\)"/, '删除用旧版 btn-sm btn-danger')
|
||
assert.doesNotMatch(s, /el-button[^>]*@click="openEdit/, '行内不再用 EP 按钮')
|
||
})
|
||
|
||
test('align_menus_row_buttons_old_btn', () => {
|
||
const s = readSource('src/pages/account/MenusPage.vue')
|
||
assert.match(s, /class="btn btn-sm"[^>]*@click="openEdit\(row\)"/, '编辑用旧版 btn-sm 实心小按钮')
|
||
assert.match(s, /class="btn btn-sm btn-danger"[^>]*@click="removeMenu\(row\)"/, '删除用旧版 btn-sm btn-danger')
|
||
assert.doesNotMatch(s, /el-button[^>]*@click="openEdit/, '行内不再用 EP 按钮')
|
||
assert.match(s, /openAdminConfirm\(\{ message: `确定删除菜单/, '删除确认走统一确认出口,文案对齐旧版')
|
||
})
|