bug修订

This commit is contained in:
chenxing
2026-09-02 08:41:35 +08:00
parent 428ee56bd3
commit 790f0e3db5
4 changed files with 14 additions and 5 deletions
+7 -3
View File
@@ -19,8 +19,9 @@
<template v-else>未找到匹配用户</template>
</div>
<div v-else class="user-list">
<div v-for="user in userList" :key="user.id" class="user-item"
:class="{ active: selectedUser?.id === user.id }" @click="onSelectUser(user)">
<div v-for="user in userList" :key="`${user.id}-${user.groupId ?? ''}`" class="user-item"
:class="{ active: selectedUser?.id === user.id && selectedUser?.groupId === user.groupId }"
@click="onSelectUser(user)">
<div class="user-name">{{ userDisplayName(user) }}</div>
<div v-if="mode === 'user' && user.groupPath" class="user-path">{{ user.groupPath }}</div>
</div>
@@ -84,6 +85,8 @@ interface UserItem {
account?: string;
realName?: string;
isMain?: number;
/** 该行对应的组ID:同一用户多组时后端每个组出一行,选中行按该组查看权限 */
groupId?: number;
groupPath?: string;
}
@@ -232,7 +235,8 @@ async function onSelectUser(user: UserItem) {
selectedUser.value = user;
treeLoading.value = true;
const userId = user.id as number;
const groupId = selectedGroup.value?.id;
// 行自带组ID(多组用户每个组一行)优先;组列表模式回退左侧选中组
const groupId = user.groupId ?? (selectedGroup.value?.id ? Number(selectedGroup.value.id) : undefined);
// 三块数据并行加载,互不阻塞
// userGroupTree 为新增接口:apiDefinitions 未重新生成(npm run api:gen)时方法不存在,降级为友好报错
const userGroupTreeApi = (Apis.GroupAuthz as any).userGroupTree