| | |
| | | import { constantRoutes } from '@/router'
|
| | | import { getRouters } from '@/api/menu'
|
| | | import Layout from '@/layout/index'
|
| | | import ParentView from '@/components/ParentView';
|
| | | import ParentView from '@/components/ParentView'
|
| | | import InnerLink from '@/layout/components/InnerLink'
|
| | |
|
| | | const permission = {
|
| | |
| | | // 顶部导航菜单默认添加统计报表栏指向首页
|
| | | const index = [{
|
| | | path: 'index',
|
| | | meta: { title: '统计报表', icon: 'dashboard'}
|
| | | meta: { title: '统计报表', icon: 'dashboard' }
|
| | | }]
|
| | | state.topbarRouters = routes.concat(index);
|
| | | },
|
| | |
| | | var children = []
|
| | | childrenMap.forEach((el, index) => {
|
| | | if (el.children && el.children.length) {
|
| | | if (el.component === 'ParentView') {
|
| | | if (el.component === 'ParentView' && !lastRouter) {
|
| | | el.children.forEach(c => {
|
| | | c.path = el.path + '/' + c.path
|
| | | if (c.children && c.children.length) {
|
| | |
| | | return children
|
| | | }
|
| | |
|
| | | export const loadView = (view) => { // 路由懒加载
|
| | | return (resolve) => require([`@/views/${view}`], resolve)
|
| | | export const loadView = (view) => {
|
| | | if (process.env.NODE_ENV === 'development') {
|
| | | return (resolve) => require([`@/views/${view}`], resolve)
|
| | | } else {
|
| | | // 使用 import 实现生产环境的路由懒加载
|
| | | return () => import(`@/views/${view}`)
|
| | | }
|
| | | }
|
| | |
|
| | | export default permission
|