解决部门列表删除按钮不显示问题

This commit is contained in:
icssoa 2022-08-13 00:41:27 +08:00
parent 2477a44ee5
commit e2470a31bf

View File

@ -244,13 +244,15 @@ export function revDeepTree(list: any[]) {
const arr: any[] = [];
let id = 0;
function deep(list: any[], parentId: any) {
function deep(list: any[], parentId: number) {
list.forEach((e) => {
if (!e.id) {
e.id = id++;
}
e.parentId = parentId;
if (!e.parentId) {
e.parentId = parentId;
}
arr.push(e);
@ -260,7 +262,7 @@ export function revDeepTree(list: any[]) {
});
}
deep(list || [], null);
deep(list || [], 0);
return arr;
}