fix(系统设置): 修复系统用户组不能删除的问题

This commit is contained in:
song-cc-rock 2024-03-28 11:57:14 +08:00 committed by 刘瑞斌
parent 30ecc8d586
commit 4c4d00baa5
4 changed files with 11 additions and 17 deletions

View File

@ -47,8 +47,8 @@ public class OrganizationUserRoleService extends BaseUserRoleService {
.andScopeIdIn(Arrays.asList(organizationId, UserRoleEnum.GLOBAL.toString()));
example.setOrderByClause("create_time asc");
List<UserRole> userRoles = userRoleMapper.selectByExample(example);
userRoles.sort(Comparator.comparing(UserRole::getInternal)
.thenComparing(UserRole::getScopeId).thenComparing(Comparator.comparing(UserRole::getCreateTime).reversed()).reversed());
userRoles.sort(Comparator.comparing(UserRole::getInternal).thenComparing(UserRole::getScopeId)
.thenComparing(Comparator.comparing(UserRole::getCreateTime).thenComparing(UserRole::getId).reversed()).reversed());
return userRoles;
}

View File

@ -69,10 +69,7 @@
>{{ element.name }}</div
>
</a-tooltip>
<div
v-if="element.id === currentId && element.scopeId !== 'global'"
class="flex flex-row items-center gap-[8px]"
>
<div v-if="element.id === currentId" class="flex flex-row items-center gap-[8px]">
<MsMoreAction
v-if="element.type === systemType"
v-permission="props.updatePermission"
@ -84,7 +81,7 @@
</div>
</MsMoreAction>
<MsMoreAction
v-if="isSystemShowAll"
v-if="isSystemShowAll && !element.internal && (element.scopeId !== 'global' || !isGlobalDisable)"
:list="systemMoreAction"
@select="(value) => handleMoreAction(value, element.id, AuthScopeEnum.SYSTEM)"
>
@ -160,10 +157,7 @@
>{{ element.name }}</div
>
</a-tooltip>
<div
v-if="element.id === currentId && element.scopeId !== 'global'"
class="flex flex-row items-center gap-[8px]"
>
<div v-if="element.id === currentId" class="flex flex-row items-center gap-[8px]">
<MsMoreAction
v-if="element.type === systemType"
v-permission="props.updatePermission"
@ -175,7 +169,7 @@
</div>
</MsMoreAction>
<MsMoreAction
v-if="isOrdShowAll"
v-if="isOrdShowAll && !element.internal && (element.scopeId !== 'global' || !isGlobalDisable)"
:list="orgMoreAction"
@select="(value) => handleMoreAction(value, element.id, AuthScopeEnum.ORGANIZATION)"
>
@ -251,10 +245,7 @@
>{{ element.name }}</div
>
</a-tooltip>
<div
v-if="element.id === currentId && element.scopeId !== 'global'"
class="flex flex-row items-center gap-[8px]"
>
<div v-if="element.id === currentId" class="flex flex-row items-center gap-[8px]">
<MsMoreAction
v-if="element.type === systemType"
v-permission="props.updatePermission"
@ -266,7 +257,7 @@
</div>
</MsMoreAction>
<MsMoreAction
v-if="isProjectShowAll"
v-if="isProjectShowAll && !element.internal && (element.scopeId !== 'global' || !isGlobalDisable)"
:list="projectMoreAction"
@select="(value) => handleMoreAction(value, element.id, AuthScopeEnum.PROJECT)"
>
@ -321,6 +312,7 @@
const props = defineProps<{
addPermission: string[];
updatePermission: string[];
isGlobalDisable: boolean;
}>();
const appStore = useAppStore();

View File

@ -6,6 +6,7 @@
ref="ugLeftRef"
:add-permission="['ORGANIZATION_USER_ROLE:READ+ADD']"
:update-permission="['ORGANIZATION_USER_ROLE:READ+UPDATE']"
:is-global-disable="true"
@handle-select="handleSelect"
@add-user-success="handleAddMember"
/>

View File

@ -6,6 +6,7 @@
ref="ugLeftRef"
:add-permission="['SYSTEM_USER_ROLE:READ+ADD']"
:update-permission="['SYSTEM_USER_ROLE:READ+UPDATE']"
:is-global-disable="false"
@handle-select="handleSelect"
@add-user-success="handleAddMember"
/>