refactor: delete check role
This commit is contained in:
parent
208649f5bb
commit
e1a6fead38
1 changed files with 4 additions and 18 deletions
|
|
@ -183,10 +183,7 @@ const treeData = computed(() => {
|
||||||
|
|
||||||
branchData.value?.result.forEach((v) => {
|
branchData.value?.result.forEach((v) => {
|
||||||
if (v.isHeadOffice) map[v.id] = Object.assign(v, { branch: [] });
|
if (v.isHeadOffice) map[v.id] = Object.assign(v, { branch: [] });
|
||||||
if (v.virtual && isRoleInclude(['head_of_admin']) === false) {
|
else children.push(v);
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!v.isHeadOffice) children.push(v);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
children.forEach((v) => {
|
children.forEach((v) => {
|
||||||
|
|
@ -230,21 +227,10 @@ async function calculateStats(headOfficeId?: string) {
|
||||||
];
|
];
|
||||||
|
|
||||||
stats.value = baseStats.filter((v) => {
|
stats.value = baseStats.filter((v) => {
|
||||||
if (isRoleInclude(['head_of_admin'])) {
|
if (headOfficeId !== undefined && v.label.includes('HQ')) {
|
||||||
if (headOfficeId !== undefined && v.label.includes('HQ')) {
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
if (v.label.includes('Virtual')) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (headOfficeId !== undefined && v.label.includes('HQ')) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue