|
@@ -29,7 +29,6 @@ function getc(obj) {
|
|
|
}
|
|
|
|
|
|
router.beforeEach(async (to, from, next) => {
|
|
|
-
|
|
|
NProgress.start()
|
|
|
document.title = getPageTitle(to.meta.title)
|
|
|
const hasToken = getToken()
|
|
@@ -56,20 +55,22 @@ router.beforeEach(async (to, from, next) => {
|
|
|
// 维保
|
|
|
engineeringMaintenance: userInfo.moduleWb,
|
|
|
// 延保
|
|
|
- valueAddedService: userInfo.moduleYb,
|
|
|
+ valueAddedService: userInfo.moduleYb
|
|
|
}
|
|
|
// 设置路由
|
|
|
lay.children = []
|
|
|
for (var route of store.getters.menus) {
|
|
|
- if (route.code == "bigViews") {
|
|
|
- router.addRoutes([{
|
|
|
- path: '/bigViews',
|
|
|
- code: "bigViews",
|
|
|
- name: "bigViews",
|
|
|
- component: _import(`${route.fullUrl}/index`),
|
|
|
- hidden: true
|
|
|
- }])
|
|
|
- } else if (moduleObj[route.code] !== false) {
|
|
|
+ if (route.code == 'bigViews') {
|
|
|
+ router.addRoutes([
|
|
|
+ {
|
|
|
+ path: '/bigViews',
|
|
|
+ code: 'bigViews',
|
|
|
+ name: 'bigViews',
|
|
|
+ component: _import(`${route.fullUrl}/index`),
|
|
|
+ hidden: true
|
|
|
+ }
|
|
|
+ ])
|
|
|
+ } else if (moduleObj[route.code] !== false && route.status) {
|
|
|
lay.children.push(...buildRoute(route))
|
|
|
}
|
|
|
}
|
|
@@ -77,15 +78,15 @@ router.beforeEach(async (to, from, next) => {
|
|
|
router.addRoutes([lay])
|
|
|
global.antRouter = []
|
|
|
for (var route of store.getters.menus) {
|
|
|
- if (route.code == "bigViews") {
|
|
|
+ if (route.code == 'bigViews') {
|
|
|
global.antRouter.push({
|
|
|
path: '/bigViews',
|
|
|
- code: "bigViews",
|
|
|
- name: "bigViews",
|
|
|
+ code: 'bigViews',
|
|
|
+ name: 'bigViews',
|
|
|
component: _import(`${route.fullUrl}/index`),
|
|
|
hidden: true
|
|
|
})
|
|
|
- } else if (moduleObj[route.code] !== false) {
|
|
|
+ } else if (moduleObj[route.code] !== false && route.status) {
|
|
|
global.antRouter.push(...buildRoute(route, '', false))
|
|
|
}
|
|
|
}
|
|
@@ -149,7 +150,9 @@ function buildRoute(route, parentUrl = '', bool = true) {
|
|
|
children: []
|
|
|
}
|
|
|
childrenPage.map(child => {
|
|
|
- itemparent.children.push(...buildRoute(child, `${parentUrl}/${code}_children`, bool))
|
|
|
+ if (child.status) {
|
|
|
+ itemparent.children.push(...buildRoute(child, `${parentUrl}/${code}_children`, bool))
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -176,13 +179,16 @@ function buildRoute(route, parentUrl = '', bool = true) {
|
|
|
item.path = `${item.path}${bool ? '/:pageName?/:pageType?/:pageCode?/:pagePam?' : ''}`
|
|
|
pages.push(item)
|
|
|
}
|
|
|
-
|
|
|
} else if (type == 1) {
|
|
|
item.component = RouterView
|
|
|
item.children = []
|
|
|
- route.children.filter(itema => itema.type !== 3).map(child => {
|
|
|
- item.children.push(...buildRoute(child, item.path, bool))
|
|
|
- })
|
|
|
+ route.children
|
|
|
+ .filter(itema => itema.type !== 3)
|
|
|
+ .map(child => {
|
|
|
+ if (child.status) {
|
|
|
+ item.children.push(...buildRoute(child, item.path, bool))
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
} else {
|
|
|
if (type == 4) {
|
|
@@ -198,7 +204,6 @@ function buildRoute(route, parentUrl = '', bool = true) {
|
|
|
item.path = `${item.path}${bool ? '/:pageName?/:pageType?/:pageCode?/:pagePam?' : ''}`
|
|
|
pages.push(item)
|
|
|
}
|
|
|
-
|
|
|
} catch (e) {
|
|
|
console.log(e)
|
|
|
}
|