This commit is contained in:
parent
fcbcf91d66
commit
c703b3d024
@ -68,6 +68,8 @@ export function usePage() {
|
||||
|
||||
const canCreateUser = computed(() => globalStatus.hasCapability('user.create'))
|
||||
|
||||
const canEditUser = user => canManageUser(globalStatus.role, user?.Role)
|
||||
|
||||
const canEditSelectedUser = computed(() => editModel.value === 'create'
|
||||
? canCreateUser.value && availableRoles.value.length > 0
|
||||
: canManageUser(globalStatus.role, selectedUser.value?.Role))
|
||||
@ -101,6 +103,7 @@ export function usePage() {
|
||||
}
|
||||
|
||||
const handleEdit = function (idx, row) {
|
||||
if (!canEditUser(row)) return
|
||||
selectedUser.value = row
|
||||
editUserInfo.account = row.Account
|
||||
editUserInfo.name = row.Name
|
||||
@ -227,6 +230,7 @@ export function usePage() {
|
||||
title,
|
||||
reflushList,
|
||||
handleEdit,
|
||||
canEditUser,
|
||||
createUser,
|
||||
submit,
|
||||
roleMeta,
|
||||
|
||||
@ -18,7 +18,14 @@
|
||||
<section v-for="group in accountGroups" :key="group.id" class="account-group-panel">
|
||||
<header class="account-group-header">
|
||||
<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>
|
||||
{{ group.name }}
|
||||
</button>
|
||||
@ -87,6 +94,7 @@
|
||||
text
|
||||
bg
|
||||
@click="handleEdit(scope.$index, scope.row)"
|
||||
:disabled="!canEditUser(scope.row)"
|
||||
class="action-btn"
|
||||
>
|
||||
编辑
|
||||
@ -279,6 +287,7 @@ const {
|
||||
saveMembership,
|
||||
createUser,
|
||||
handleEdit,
|
||||
canEditUser,
|
||||
reflushList,
|
||||
userInfoDialog,
|
||||
title,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user