diff --git a/frontend/src/business/components/settings/system/group/EditPermission.vue b/frontend/src/business/components/settings/system/group/EditPermission.vue index 2193f0c25d..eedc275fc7 100644 --- a/frontend/src/business/components/settings/system/group/EditPermission.vue +++ b/frontend/src/business/components/settings/system/group/EditPermission.vue @@ -35,7 +35,7 @@ prop="permissions" :label="$t('group.permission')"> @@ -83,6 +83,12 @@ export default { computed: { userGroupType() { return USER_GROUP_SCOPE; + }, + isReadOnly() { + return function (data) { + const isDefaultSystemGroup = this.group.id === 'admin' && data.resource.id === 'SYSTEM_GROUP'; + return this.readOnly || isDefaultSystemGroup; + } } }, methods: { diff --git a/frontend/src/business/components/settings/system/group/GroupPermission.vue b/frontend/src/business/components/settings/system/group/GroupPermission.vue index 4ebd2fb1de..945a0cf8e2 100644 --- a/frontend/src/business/components/settings/system/group/GroupPermission.vue +++ b/frontend/src/business/components/settings/system/group/GroupPermission.vue @@ -6,7 +6,7 @@ {{ $t(permission.name) }} + v-model="permission['checked']" @change="change($event, permission)" :disabled="isReadOnly(permission)"> {{ $t(permission.name) }} @@ -34,11 +34,22 @@ export default { default() { return false; } + }, + group: { + type: Object, + default() { + return {}; + } } }, - data() { - return { - + 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' && isSystemGroupPermission; + return this.readOnly || isDefaultSystemGroup; + } } }, methods: {