|
|
@@ -9,7 +9,7 @@ import { getFormattedText } from '/@/components/Configurable/hooks/helper';
|
|
|
// import { listToTree } from '/@/utils/helper/treeHelper';
|
|
|
import { MineDepartment, useMineDepartmentStore } from '/@/store/modules/mine';
|
|
|
import { AppRouteRecordRaw } from '/@/router/types';
|
|
|
-import { cloneDeep } from 'lodash';
|
|
|
+import { cloneDeep } from 'lodash-es';
|
|
|
|
|
|
enum Api {
|
|
|
GetMenuList = '/sys/permission/getUserPermissionByToken',
|
|
|
@@ -79,7 +79,10 @@ export const getMenuList: () => Promise<getMenuListResultModel> = () => {
|
|
|
menu: processStaticRoutes(cloneDeep(__STATIC_ROUTES__), mineStore).map((route) => {
|
|
|
if (route.meta?.generation && route.children && route.children.length) {
|
|
|
const template = route.children[0];
|
|
|
- route.children = generateStaticSealedMonitorRoute(template, mineStore.getDepartTree);
|
|
|
+ route.children = generateStaticSealedMonitorRoute(
|
|
|
+ template,
|
|
|
+ mineStore.getRoot?.isLeaf ? mineStore.getDepartTree : mineStore.getRoot?.childDepart || []
|
|
|
+ );
|
|
|
}
|
|
|
return route;
|
|
|
}),
|