edit
This commit is contained in:
@ -105,10 +105,21 @@ export class MenuManagerComponentsIndexComponent implements OnInit {
|
||||
deleteMenuByAppID(appId: string) {
|
||||
this.service.request(this.service.$api_get_one, { appId }, 'POST', false).subscribe(res => {
|
||||
console.log(res);
|
||||
|
||||
if (res) {
|
||||
this.menus = res;
|
||||
const menus = res.data;
|
||||
console.log(this.getIds(res.data));
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getIds(arr: Array<any>): Array<string> {
|
||||
let ids: any[] = [];
|
||||
arr.forEach(item => {
|
||||
if (item.children?.length > 0) {
|
||||
ids = [...ids, this.getIds(item.children)];
|
||||
}
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user