Commit 840d3aa9 authored by Gakki's avatar Gakki

默认加载子项目documents

parent af28d862
[{ {
"Layout": [{
"path": "/documents/month", "name": "month", "path": "/documents/month", "name": "month",
"meta": { "title": "检查单","menuIcon": "profile", "menuPath":false, "hideInBread":false }, "meta": { "title": "检查单","menuIcon": "profile", "menuPath":false, "hideInBread":false },
"children":[ "children":[
...@@ -53,4 +54,4 @@ ...@@ -53,4 +54,4 @@
"meta": { "title": "投诉密度排行", "menuPath":true, "hideInBread":false} "meta": { "title": "投诉密度排行", "menuPath":true, "hideInBread":false}
} }
] ]
}] }]}
\ No newline at end of file \ No newline at end of file
...@@ -3,6 +3,7 @@ import pudong from '@/router/pudongRoutes.json' ...@@ -3,6 +3,7 @@ import pudong from '@/router/pudongRoutes.json'
import xuhui from '@/router/xuhuiRoutes.json' import xuhui from '@/router/xuhuiRoutes.json'
import huangpu from '@/router/huangpuRoutes.json' import huangpu from '@/router/huangpuRoutes.json'
import yangpu from '@/router/yangpuRoutes.json' import yangpu from '@/router/yangpuRoutes.json'
import documents from '@/router/documentsRoutes.json'
import Store from '@/store/index' import Store from '@/store/index'
async function GetRoutes(router) { async function GetRoutes(router) {
...@@ -64,6 +65,7 @@ async function GetRoutes(router) { ...@@ -64,6 +65,7 @@ async function GetRoutes(router) {
const micSystemRoutersConfigs = Object.assign({}, MicRouters) const micSystemRoutersConfigs = Object.assign({}, MicRouters)
const { routes } = router.options const { routes } = router.options
const parent = routes.find(item => item.name === 'Layout') const parent = routes.find(item => item.name === 'Layout')
for (let key in micSystemRoutersConfigs) { for (let key in micSystemRoutersConfigs) {
for (let i = 0; i < micSystemRoutersConfigs[key].length; i++) { for (let i = 0; i < micSystemRoutersConfigs[key].length; i++) {
let firstRouter = Object.assign({}, micSystemRoutersConfigs[key][i]) let firstRouter = Object.assign({}, micSystemRoutersConfigs[key][i])
...@@ -77,6 +79,20 @@ async function GetRoutes(router) { ...@@ -77,6 +79,20 @@ async function GetRoutes(router) {
router.addRoutes([ parent ]) router.addRoutes([ parent ])
} }
} }
for(let key in documents) {
for (let i = 0; i < documents[key].length; i++) {
let firstRouter = Object.assign({}, documents[key][i])
if (
!!firstRouter.meta.openMode &&
firstRouter.meta.openMode == 'outsite'
) {
firstRouter.component = TipsOutsite
}
parent.children.push(Object.assign({}, firstRouter))
router.addRoutes([ parent ])
}
}
} }
export default GetRoutes export default GetRoutes
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment