fix: correct tag rendering and permission check logic in index.vue

--bug=1057921 --user=刘瑞斌 【资源授权】专业版和社区版、企业版授权工具勾选了文件夹,保存后,文件夹自动取消勾选,只勾选了工具 https://www.tapd.cn/62980211/s/1728387
This commit is contained in:
CaptainB 2025-07-10 18:40:44 +08:00
parent a2726a9367
commit 691d7ceaa5

View File

@ -46,7 +46,7 @@
<div class="flex-between">
<div class="flex">
<span class="mr-8">{{ row.nick_name }}</span>
<TagGroup :tags="row.roles"
<TagGroup :tags="row.roles"
v-if="hasPermission([EditionConst.IS_EE,EditionConst.IS_PE],'OR')"
/>
</div>
@ -314,13 +314,26 @@ const dfsPermissionIndeterminate = (
}
if (item.isFolder) {
item.permissionHalf[type] = permissionHalfMap[item.id][type].length
? new Set(permissionHalfMap[item.id][type]).size > 1
: false
//
const hasPermissions = permissionHalfMap[item.id][type];
const allTrue = hasPermissions.length && hasPermissions.every((p: boolean) => p);
const allFalse = hasPermissions.length && hasPermissions.every((p: boolean) => !p);
//
item.permissionHalf[type] = hasPermissions.length && !allTrue && !allFalse;
//
if (item.children.some((ele: any) => ele.isFolder && ele.permissionHalf[type])) {
item.permissionHalf[type] = true
item.permissionHalf[type] = true;
}
//
if (allTrue) {
item.permission[type] = true;
item.permissionHalf[type] = false
}
//
if (
item.children.some((ele: any) => ele.permission[type]) &&
item.children.some((ele: any) => !ele.permission[type])