修复分组成员列表中不可管理账号的编辑入口
This commit is contained in:
1 parent
8ad62d8509
commit
902960e11c
2 files changed
+14
-1
No files matched your search
@@ -68,6 +68,8 @@ export function usePage() {
|
|||||||
|
|
||||||
const canCreateUser = computed(() => globalStatus.hasCapability('user.create'))
|
const canCreateUser = computed(() => globalStatus.hasCapability('user.create'))
|
||||||
|
|
||||||
|
const canEditUser = user => canManageUser(globalStatus.role, user?.Role)
|
||||||
|
|
||||||
const canEditSelectedUser = computed(() => editModel.value === 'create'
|
const canEditSelectedUser = computed(() => editModel.value === 'create'
|
||||||
? canCreateUser.value && availableRoles.value.length > 0
|
? canCreateUser.value && availableRoles.value.length > 0
|
||||||
: canManageUser(globalStatus.role, selectedUser.value?.Role))
|
: canManageUser(globalStatus.role, selectedUser.value?.Role))
|
||||||
@@ -101,6 +103,7 @@ export function usePage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleEdit = function (idx, row) {
|
const handleEdit = function (idx, row) {
|
||||||
|
if (!canEditUser(row)) return
|
||||||
selectedUser.value = row
|
selectedUser.value = row
|
||||||
editUserInfo.account = row.Account
|
editUserInfo.account = row.Account
|
||||||
editUserInfo.name = row.Name
|
editUserInfo.name = row.Name
|
||||||
@@ -227,6 +230,7 @@ export function usePage() {
|
|||||||
title,
|
title,
|
||||||
reflushList,
|
reflushList,
|
||||||
handleEdit,
|
handleEdit,
|
||||||
|
canEditUser,
|
||||||
createUser,
|
createUser,
|
||||||
submit,
|
submit,
|
||||||
roleMeta,
|
roleMeta,
|
||||||
|
|||||||
@@ -18,7 +18,14 @@
|
|||||||
<section v-for="group in accountGroups" :key="group.id" class="account-group-panel">
|
<section v-for="group in accountGroups" :key="group.id" class="account-group-panel">
|
||||||
<header class="account-group-header">
|
<header class="account-group-header">
|
||||||
<h4 v-if="group.id === 0">{{ group.name }}</h4>
|
<h4 v-if="group.id === 0">{{ group.name }}</h4>
|
||||||
<button v-else type="button" class="account-group-toggle" :aria-expanded="group.expanded" :aria-controls="`account-group-${group.id}`" @click="toggleGroup(group)">
|
<button
|
||||||
|
v-else
|
||||||
|
type="button"
|
||||||
|
class="account-group-toggle"
|
||||||
|
:aria-expanded="group.expanded"
|
||||||
|
:aria-controls="`account-group-${group.id}`"
|
||||||
|
@click="toggleGroup(group)"
|
||||||
|
>
|
||||||
<span aria-hidden="true">{{ group.expanded ? '▾' : '▸' }}</span>
|
<span aria-hidden="true">{{ group.expanded ? '▾' : '▸' }}</span>
|
||||||
{{ group.name }}
|
{{ group.name }}
|
||||||
</button>
|
</button>
|
||||||
@@ -87,6 +94,7 @@
|
|||||||
text
|
text
|
||||||
bg
|
bg
|
||||||
@click="handleEdit(scope.$index, scope.row)"
|
@click="handleEdit(scope.$index, scope.row)"
|
||||||
|
:disabled="!canEditUser(scope.row)"
|
||||||
class="action-btn"
|
class="action-btn"
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
@@ -279,6 +287,7 @@ const {
|
|||||||
saveMembership,
|
saveMembership,
|
||||||
createUser,
|
createUser,
|
||||||
handleEdit,
|
handleEdit,
|
||||||
|
canEditUser,
|
||||||
reflushList,
|
reflushList,
|
||||||
userInfoDialog,
|
userInfoDialog,
|
||||||
title,
|
title,
|
||||||
|
|||||||
Reference in new issue
Block a user