align(account): 用户/菜单/分组行内操作统一实心 small 按钮(对齐旧版 .btn-sm),移除 link 形态

This commit is contained in:
2026-09-06 21:39:30 +08:00
parent 4742a2e3b5
commit 2691472a5e
4 changed files with 35 additions and 6 deletions
@@ -123,8 +123,8 @@ onMounted(loadGroups)
</el-table-column> </el-table-column>
<el-table-column label="操作" min-width="140" fixed="right"> <el-table-column label="操作" min-width="140" fixed="right">
<template #default="{ row }"> <template #default="{ row }">
<el-button link type="primary" :disabled="!canEditOf(row)" @click="openEdit(row)">编辑</el-button> <el-button size="small" type="primary" :disabled="!canEditOf(row)" @click="openEdit(row)">编辑</el-button>
<el-button link type="danger" :disabled="!canEditOf(row)" @click="removeGroup(row)">删除</el-button> <el-button size="small" type="danger" :disabled="!canEditOf(row)" @click="removeGroup(row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -228,8 +228,8 @@ onMounted(loadMenus)
</el-table-column> </el-table-column>
<el-table-column label="操作" min-width="160" fixed="right"> <el-table-column label="操作" min-width="160" fixed="right">
<template #default="{ row }"> <template #default="{ row }">
<el-button link type="primary" @click="openEdit(row as MenuManageNode)">编辑</el-button> <el-button size="small" type="primary" @click="openEdit(row as MenuManageNode)">编辑</el-button>
<el-button link type="danger" :disabled="menuDeleteReason(row as MenuManageNode) !== undefined" @click="removeMenu(row as MenuManageNode)">删除</el-button> <el-button size="small" type="danger" :disabled="menuDeleteReason(row as MenuManageNode) !== undefined" @click="removeMenu(row as MenuManageNode)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -177,9 +177,9 @@ onMounted(loadUsers)
</el-table-column> </el-table-column>
<el-table-column label="操作" min-width="160" fixed="right"> <el-table-column label="操作" min-width="160" fixed="right">
<template #default="{ row }"> <template #default="{ row }">
<el-button link type="primary" :disabled="!editableOf(row)" @click="openEdit(row)">编辑</el-button> <el-button size="small" type="primary" :disabled="!editableOf(row)" @click="openEdit(row)">编辑</el-button>
<el-button <el-button
link size="small"
type="danger" type="danger"
:disabled="deleteBlockReason(row, currentUserId) !== undefined" :disabled="deleteBlockReason(row, currentUserId) !== undefined"
@click="removeUser(row)" @click="removeUser(row)"
@@ -0,0 +1,29 @@
import test from 'node:test'
import assert from 'node:assert/strict'
import { readSource } from './helpers.ts'
/** 对齐旧版 .btn-smaccount 域行内操作统一实心小按钮(不再 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_solid', () => {
const s = readSource('src/pages/account/UsersPage.vue')
assertRowButtonSolid(s, 'openEdit')
assertRowButtonSolid(s, 'removeUser')
})
test('align_groups_row_buttons_solid', () => {
const s = readSource('src/pages/account/GroupsPage.vue')
assertRowButtonSolid(s, 'openEdit')
assertRowButtonSolid(s, 'removeGroup')
})
test('align_menus_row_buttons_solid', () => {
const s = readSource('src/pages/account/MenusPage.vue')
assertRowButtonSolid(s, 'openEdit')
assertRowButtonSolid(s, 'removeMenu')
})