add:添加调拨其他出库下推功能 fix:修复sys菜单组件名称问题
This commit is contained in:
@@ -2,6 +2,8 @@ import { constantRouterMap } from '@/router/routers'
|
||||
import Layout from '@/layout/index'
|
||||
import ParentView from '@/components/ParentView'
|
||||
|
||||
const MENU_TYPE_DIRECTORY = '2'
|
||||
|
||||
const permission = {
|
||||
state: {
|
||||
routers: constantRouterMap,
|
||||
@@ -42,6 +44,7 @@ export const filterAsyncRouter = (routers, lastRouter = false, type = false) =>
|
||||
if (type && router.children) {
|
||||
router.children = filterChildren(router.children)
|
||||
}
|
||||
const hasChildren = router.children != null && router.children && router.children.length
|
||||
if (router.component) {
|
||||
if (router.component === 'Layout') { // Layout组件特殊处理
|
||||
router.component = Layout
|
||||
@@ -51,8 +54,10 @@ export const filterAsyncRouter = (routers, lastRouter = false, type = false) =>
|
||||
const component = router.component
|
||||
router.component = loadView(component)
|
||||
}
|
||||
} else if (hasChildren && router.type === MENU_TYPE_DIRECTORY) {
|
||||
router.component = ParentView
|
||||
}
|
||||
if (router.children != null && router.children && router.children.length) {
|
||||
if (hasChildren) {
|
||||
router.children = filterAsyncRouter(router.children, router, type)
|
||||
} else {
|
||||
delete router['children']
|
||||
|
||||
Reference in New Issue
Block a user