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,6 +100,9 @@ function fetchDataRole() {
const findMainRoot = sysList.find( const findMainRoot = sysList.find(
(e: DataSystem) => e.parentNode === item.id (e: DataSystem) => e.parentNode === item.id
); );
const arrayChil = chil.filter((a) => a.parentId === item.id);
if (arrayChil) {
root.push({ root.push({
...item, ...item,
selected: findMainRoot ? true : false, selected: findMainRoot ? true : false,
@ -110,8 +113,9 @@ function fetchDataRole() {
attrIsUpdate: false, attrIsUpdate: false,
attrIsDelete: false, attrIsDelete: false,
attrPrivilege: "", attrPrivilege: "",
children: chil, children: arrayChil,
}); });
}
} else { } else {
const findRoot = sysList.find( const findRoot = sysList.find(
(e: DataSystem) => e.authSysId === item.id (e: DataSystem) => e.authSysId === item.id