This commit is contained in:
lcw
2026-01-16 12:40:42 +08:00
parent 2ea84f248c
commit 10853312f2
120 changed files with 23881 additions and 617 deletions

View File

@ -10,11 +10,11 @@ const getChildrenRoutes = (routes) => {
routes.forEach((route) => {
if (route.children && route.children.length > 0) {
if (deptBizType == '23' && roleList) {
// 在这个条件分支中也需要过滤掉/internalAuditor路由
result.push(...route.children);
} else {
// console.log(route.path);
if (route.path == '/JudgmentHome') {
route.children.splice(6, 1);
route.children.splice(route.children.findIndex(item => item.path == '/internalAuditor'), 1)
result.push(...route.children);
} else {
result.push(...route.children);
@ -29,15 +29,18 @@ const getChildrenRoutes = (routes) => {
*处理脱离层级的路由
*/
export const filterRoutes = (routes) => {
//获取到所有的子集路由
const childrenRoutes = getChildrenRoutes(routes);
//根据子集路由进行查重操作
return routes.filter((route) => {
const data = routes.filter((route) => {
//根据route在childrenRoutes中进行查重把所有重复路由表 剔除
return !childrenRoutes.find((childrenRoute) => {
return childrenRoute.path === route.path;
});
});
}).filter(item => item.path != '/internalAuditor')
console.log(childrenRoutes);
return data
};
function isNull(data) {
@ -86,3 +89,5 @@ export function generateMenus(routes, basePath = "") {
});
return result;
}