fix(用户组与权限): 权限编辑

This commit is contained in:
shiziyuan9527 2022-12-13 11:02:06 +08:00 committed by lyh
parent 0aac4ed341
commit d0cf2b0b33
2 changed files with 14 additions and 12 deletions

View File

@ -108,12 +108,14 @@
{
"id": "SYSTEM_QUOTA:READ",
"name": "permission.system_quota.read",
"resourceId": "SYSTEM_QUOTA"
"resourceId": "SYSTEM_QUOTA",
"license": true
},
{
"id": "SYSTEM_QUOTA:READ+EDIT",
"name": "permission.system_quota.edit",
"resourceId": "SYSTEM_QUOTA"
"resourceId": "SYSTEM_QUOTA",
"license": true
},
{
"id": "SYSTEM_AUTH:READ",
@ -337,7 +339,8 @@
},
{
"id": "SYSTEM_QUOTA",
"name": "permission.system_quota.name"
"name": "permission.system_quota.name",
"license": true
},
{
"id": "SYSTEM_AUTH",

View File

@ -1,12 +1,11 @@
<template>
<div>
<span v-for="(permission, index) in permissions" :key="index">
<el-checkbox v-if="permission.license" v-xpack class="permission-checkbox"
v-model="permission['checked']" @change="change($event, permission)" :disabled="readOnly">
{{ $t(permission.name) }}
</el-checkbox>
<el-checkbox v-else class="permission-checkbox"
v-model="permission['checked']" @change="change($event, permission)" :disabled="isReadOnly(permission)">
<el-checkbox
class="permission-checkbox"
v-model="permission['checked']"
@change="change($event, permission)"
:disabled="isReadOnly(permission)">
{{ $t(permission.name) }}
</el-checkbox>
</span>
@ -20,13 +19,13 @@ export default {
permissions: {
type: Array,
default() {
return []
return [];
}
},
selected: {
type: Array,
default() {
return []
return [];
}
},
readOnly: {
@ -45,7 +44,7 @@ export default {
computed: {
isReadOnly() {
return function (permission) {
//
//
const isSystemGroupPermission = permission.id === 'SYSTEM_GROUP:READ' || permission.id === 'SYSTEM_GROUP:READ+SETTING_PERMISSION';
const isDefaultSystemGroup = (this.group.id === 'admin' || this.group.id === 'super_group') && isSystemGroupPermission;
return this.readOnly || isDefaultSystemGroup;