This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-06-13 11:43:09 +07:00
parent d90d4287c1
commit 4ebad6fc60

View file

@ -100,18 +100,22 @@ function fetchDataRole() {
const findMainRoot = sysList.find(
(e: DataSystem) => e.parentNode === item.id
);
root.push({
...item,
selected: findMainRoot ? true : false,
attrOwnership: "",
attrIsCreate: false,
attrIsList: false,
attrIsGet: false,
attrIsUpdate: false,
attrIsDelete: false,
attrPrivilege: "",
children: chil,
});
const arrayChil = chil.filter((a) => a.parentId === item.id);
if (arrayChil) {
root.push({
...item,
selected: findMainRoot ? true : false,
attrOwnership: "",
attrIsCreate: false,
attrIsList: false,
attrIsGet: false,
attrIsUpdate: false,
attrIsDelete: false,
attrPrivilege: "",
children: arrayChil,
});
}
} else {
const findRoot = sysList.find(
(e: DataSystem) => e.authSysId === item.id