|
|
@ -169,6 +169,22 @@ function cookApiDataItem2(item) { |
|
|
} |
|
|
} |
|
|
return item; |
|
|
return item; |
|
|
} |
|
|
} |
|
|
|
|
|
// 把父级拼到子集
|
|
|
|
|
|
function cookApiDataItem3(item, parent = []) { |
|
|
|
|
|
item.parent = parent; |
|
|
|
|
|
let { children } = item; |
|
|
|
|
|
if (children && Array.isArray(children) && children.length > 0) { |
|
|
|
|
|
item.children = children.map((val) => |
|
|
|
|
|
cookApiDataItem3(val, [ |
|
|
|
|
|
...parent, |
|
|
|
|
|
{ |
|
|
|
|
|
title: item.name || "", |
|
|
|
|
|
}, |
|
|
|
|
|
]) |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
return item; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 模块路由(基于主入口布局页面) 可视化数据
|
|
|
// 模块路由(基于主入口布局页面) 可视化数据
|
|
|
export const moduleShujuRoutes = { |
|
|
export const moduleShujuRoutes = { |
|
|
@ -176,7 +192,7 @@ export const moduleShujuRoutes = { |
|
|
component: () => import("@/views/main-shuju/main"), |
|
|
component: () => import("@/views/main-shuju/main"), |
|
|
name: "main-shuju", |
|
|
name: "main-shuju", |
|
|
redirect: { |
|
|
redirect: { |
|
|
path:"/main-shuju/visual-basicinfo-basicInfoMain", |
|
|
path: "/main-shuju/visual-basicinfo-basicInfoMain", |
|
|
}, |
|
|
}, |
|
|
meta: { |
|
|
meta: { |
|
|
title: "主入口布局", |
|
|
title: "主入口布局", |
|
|
@ -314,6 +330,7 @@ router.beforeEach((to, from, next) => { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
window.SITE_CONFIG["menuList"] = res.data |
|
|
window.SITE_CONFIG["menuList"] = res.data |
|
|
|
|
|
.map((item) => cookApiDataItem3(item)) |
|
|
.map((item) => cookApiDataItem2(item)) |
|
|
.map((item) => cookApiDataItem2(item)) |
|
|
.map((item) => cookApiDataItem(item)); |
|
|
.map((item) => cookApiDataItem(item)); |
|
|
fnAddDynamicMenuRoutes(window.SITE_CONFIG["menuList"]); |
|
|
fnAddDynamicMenuRoutes(window.SITE_CONFIG["menuList"]); |
|
|
@ -370,6 +387,7 @@ function fnAddDynamicMenuRoutes(menuList = [], routes = []) { |
|
|
menuId: menuList[i].id, |
|
|
menuId: menuList[i].id, |
|
|
title: menuList[i].name, |
|
|
title: menuList[i].name, |
|
|
btns: menuList[i].btns || [], |
|
|
btns: menuList[i].btns || [], |
|
|
|
|
|
parent: menuList[i].parent || [], |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
|
// eslint-disable-next-line
|
|
|
// eslint-disable-next-line
|
|
|
|