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( const findMainRoot = sysList.find(
(e: DataSystem) => e.parentNode === item.id (e: DataSystem) => e.parentNode === item.id
); );
root.push({
...item, const arrayChil = chil.filter((a) => a.parentId === item.id);
selected: findMainRoot ? true : false, if (arrayChil) {
attrOwnership: "", root.push({
attrIsCreate: false, ...item,
attrIsList: false, selected: findMainRoot ? true : false,
attrIsGet: false, attrOwnership: "",
attrIsUpdate: false, attrIsCreate: false,
attrIsDelete: false, attrIsList: false,
attrPrivilege: "", attrIsGet: false,
children: chil, attrIsUpdate: false,
}); attrIsDelete: false,
attrPrivilege: "",
children: arrayChil,
});
}
} else { } else {
const findRoot = sysList.find( const findRoot = sysList.find(
(e: DataSystem) => e.authSysId === item.id (e: DataSystem) => e.authSysId === item.id