修改路由

dev
夜笙歌 1 year ago
parent 1a81756ecf
commit 308f1000a4

@ -0,0 +1,16 @@
<template>
<div>
<app-main/>
</div>
</template>
<script>
import {AppMain} from './components'
export default {
name: 'BoardIndex',
components: {
AppMain,
},
}
</script>

@ -89,48 +89,48 @@ export const constantRoutes = [
]
},
{
path: '/board1',
component: () => import('@/views/board/index'),
name: 'Index',
meta: { title: 'index', icon: 'dashboard', affix: true }
},
{
path: '/board2',
component: () => import('@/views/board/equipmentMonitoring'),
name: 'Index',
meta: { title: 'equipmentMonitoring', icon: 'dashboard', affix: true }
},
{
path: '/board3',
component: () => import('@/views/board/GPS'),
name: 'Index',
meta: { title: 'GPS', icon: 'dashboard', affix: true }
},
{
path: '/board4',
component: () => import('@/views/board/senso'),
name: 'Index',
meta: { title: 'senso', icon: 'dashboard', affix: true }
},
{
path: '/board5',
component: () => import('@/views/board/smartScene'),
name: 'Index',
meta: { title: 'smartScene', icon: 'dashboard', affix: true }
},
{
path: '/board6',
component: () => import('@/views/board/equipment'),
name: 'Index',
meta: { title: 'equipment', icon: 'dashboard', affix: true }
},
{
path: '/board7',
component: () => import('@/views/board/allScenes'),
name: 'Index',
meta: { title: 'allScenes', icon: 'dashboard', affix: true }
},
// {
// path: '/board1',
// component: () => import('@/views/board/index'),
// name: 'Index',
// meta: { title: 'index', icon: 'dashboard', affix: true }
// },
// {
// path: '/board2',
// component: () => import('@/views/board/equipmentMonitoring'),
// name: 'Index',
// meta: { title: 'equipmentMonitoring', icon: 'dashboard', affix: true }
// },
// {
// path: '/board3',
// component: () => import('@/views/board/GPS'),
// name: 'Index',
// meta: { title: 'GPS', icon: 'dashboard', affix: true }
// },
// {
// path: '/board4',
// component: () => import('@/views/board/senso'),
// name: 'Index',
// meta: { title: 'senso', icon: 'dashboard', affix: true }
// },
// {
// path: '/board5',
// component: () => import('@/views/board/smartScene'),
// name: 'Index',
// meta: { title: 'smartScene', icon: 'dashboard', affix: true }
// },
// {
// path: '/board6',
// component: () => import('@/views/board/equipment'),
// name: 'Index',
// meta: { title: 'equipment', icon: 'dashboard', affix: true }
// },
// {
// path: '/board7',
// component: () => import('@/views/board/allScenes'),
// name: 'Index',
// meta: { title: 'allScenes', icon: 'dashboard', affix: true }
// },
]
// 动态路由,基于用户权限动态去加载

@ -2,6 +2,7 @@ import auth from '@/plugins/auth'
import router, { constantRoutes, dynamicRoutes } from '@/router'
import { getRouters } from '@/api/menu'
import Layout from '@/layout/index'
import BoardIndex from '@/layout/boardIndex'
import ParentView from '@/components/ParentView'
import InnerLink from '@/layout/components/InnerLink'
@ -58,7 +59,7 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
if (type && route.children) {
route.children = filterChildren(route.children)
}
if (route.component) {
if (route.component && route.name !== 'Board') {
// Layout ParentView 组件特殊处理
if (route.component === 'Layout') {
route.component = Layout
@ -70,6 +71,9 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
route.component = loadView(route.component)
}
}
if(route.name === 'Board'){
route.component = BoardIndex
}
if (route.children != null && route.children && route.children.length) {
route.children = filterAsyncRouter(route.children, route, type)
} else {

Loading…
Cancel
Save