|
@@ -79,11 +79,11 @@ router.afterEach(() => {
|
|
NProgress.done()
|
|
NProgress.done()
|
|
})
|
|
})
|
|
|
|
|
|
-function buildRoute(route) {
|
|
|
|
|
|
+function buildRoute(route, parentUrl = '') {
|
|
const { url, moduleName, icon, moduleId, code, type, hidden, fullUrl } = route
|
|
const { url, moduleName, icon, moduleId, code, type, hidden, fullUrl } = route
|
|
var item = {}
|
|
var item = {}
|
|
- item.path = fullUrl || code
|
|
|
|
- item.name = fullUrl || code
|
|
|
|
|
|
+ item.path = ~[3, 4].indexOf(type) ? fullUrl : parentUrl + url
|
|
|
|
+ item.name = ~[3, 4].indexOf(type) ? fullUrl : parentUrl + url
|
|
item.meta = {
|
|
item.meta = {
|
|
url,
|
|
url,
|
|
title: moduleName,
|
|
title: moduleName,
|
|
@@ -103,14 +103,14 @@ function buildRoute(route) {
|
|
roles.push(role.code)
|
|
roles.push(role.code)
|
|
}
|
|
}
|
|
item.meta.roles = roles
|
|
item.meta.roles = roles
|
|
- } else {
|
|
|
|
|
|
+ } else if (type == 1) {
|
|
item.component = RouterView
|
|
item.component = RouterView
|
|
- item.children = route.children.map(child => buildRoute(child))
|
|
|
|
|
|
+ item.children = route.children.filter(item => item.type !== 3).map(child => buildRoute(child, item.path))
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
if (type == 4) {
|
|
if (type == 4) {
|
|
item.component = IframeView
|
|
item.component = IframeView
|
|
- } else {
|
|
|
|
|
|
+ } else if (type == 2) {
|
|
try {
|
|
try {
|
|
item.component = _import(`${fullUrl}`)
|
|
item.component = _import(`${fullUrl}`)
|
|
} catch (e) {
|
|
} catch (e) {
|