lcw
This commit is contained in:
@ -7,11 +7,36 @@ const getChildrenRoutes = (routes) => {
|
||||
const result = [];
|
||||
const { deptBizType, deptLevel } = getItem('deptId')[0]
|
||||
const roleList = getItem('roleList') ? getItem('roleList').filter(item => item.roleCode == 'JS_666666').length > 0 : false
|
||||
const xjLsit = getItem('roleList') ? getItem('roleList').filter(item => item.roleCode == 'JS_999999').length > 0 : false
|
||||
console.log(roleList, xjLsit);
|
||||
|
||||
routes.forEach((route) => {
|
||||
if (route.children && route.children.length > 0) {
|
||||
if (deptBizType == '23' && roleList) {
|
||||
// 在这个条件分支中也需要过滤掉/internalAuditor路由
|
||||
result.push(...route.children);
|
||||
if (deptBizType == '23') {
|
||||
|
||||
if (roleList) {
|
||||
result.push(...route.children);
|
||||
} else if (xjLsit) {
|
||||
if (route.path == '/JudgmentHome') {
|
||||
route.children.splice(route.children.findIndex(item => item.path == '/internalAuditor'), 1)
|
||||
result.push(...route.children);
|
||||
} else {
|
||||
result.push(...route.children);
|
||||
}
|
||||
} else {
|
||||
if (route.path == '/HumanIntelligence') {
|
||||
route.children.splice(route.children.findIndex(item => item.path == '/auditList'), 1)
|
||||
result.push(...route.children);
|
||||
} else {
|
||||
result.push(...route.children);
|
||||
}
|
||||
if (route.path == '/JudgmentHome') {
|
||||
route.children.splice(route.children.findIndex(item => item.path == '/internalAuditor'), 1)
|
||||
result.push(...route.children);
|
||||
} else {
|
||||
result.push(...route.children);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (route.path == '/HumanIntelligence') {
|
||||
route.children.splice(route.children.findIndex(item => item.path == '/auditList'), 1)
|
||||
@ -19,7 +44,6 @@ const getChildrenRoutes = (routes) => {
|
||||
} else {
|
||||
result.push(...route.children);
|
||||
}
|
||||
|
||||
if (route.path == '/JudgmentHome') {
|
||||
route.children.splice(route.children.findIndex(item => item.path == '/internalAuditor'), 1)
|
||||
result.push(...route.children);
|
||||
@ -27,6 +51,23 @@ const getChildrenRoutes = (routes) => {
|
||||
result.push(...route.children);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// if (deptBizType == '23' && (roleList || xjLsit)) {
|
||||
// // 在这个条件分支中也需要过滤掉/internalAuditor路由
|
||||
// result.push(...route.children);
|
||||
// } else {
|
||||
|
||||
|
||||
// if (route.path == '/JudgmentHome' && xjLsit) {
|
||||
// route.children.splice(route.children.findIndex(item => item.path == '/internalAuditor'), 1)
|
||||
// result.push(...route.children);
|
||||
// } else {
|
||||
// result.push(...route.children);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
});
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user