|
@@ -20,7 +20,11 @@ enum Api {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const generateStaticSealedMonitorRoute = (route: AppRouteRecordRaw, items: MineDepartment[]) => {
|
|
const generateStaticSealedMonitorRoute = (route: AppRouteRecordRaw, items: MineDepartment[]) => {
|
|
|
- return items.map((item) => {
|
|
|
|
|
|
|
+ return items.reduce((arr: AppRouteRecordRaw[], item) => {
|
|
|
|
|
+ const [__, ___, LEAF_LEVEL_ORG] = item.memoDesc;
|
|
|
|
|
+
|
|
|
|
|
+ if (item.orgType === LEAF_LEVEL_ORG) return arr;
|
|
|
|
|
+
|
|
|
const res: AppRouteRecordRaw = {
|
|
const res: AppRouteRecordRaw = {
|
|
|
component: route.component,
|
|
component: route.component,
|
|
|
path: getFormattedText(item, route.path),
|
|
path: getFormattedText(item, route.path),
|
|
@@ -31,14 +35,14 @@ const generateStaticSealedMonitorRoute = (route: AppRouteRecordRaw, items: MineD
|
|
|
hideMenu: false,
|
|
hideMenu: false,
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
- const [__, LEAF_LEVEL_ORG, ___] = item.memoDesc;
|
|
|
|
|
|
|
|
|
|
- if (item.orgType !== LEAF_LEVEL_ORG && item.childDepart.length) {
|
|
|
|
|
|
|
+ if (item.childDepart.length) {
|
|
|
res.children = generateStaticSealedMonitorRoute(route, item.childDepart);
|
|
res.children = generateStaticSealedMonitorRoute(route, item.childDepart);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return res;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ arr.push(res);
|
|
|
|
|
+ return arr;
|
|
|
|
|
+ }, []);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -60,7 +64,6 @@ export const getMenuList: () => Promise<getMenuListResultModel> = () => {
|
|
|
|
|
|
|
|
ele.children = routes;
|
|
ele.children = routes;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
return ele;
|
|
return ele;
|
|
|
}),
|
|
}),
|
|
|
};
|
|
};
|