2018-10-12 07:10:11 +08:00
|
|
|
import playground from './modules/playground'
|
|
|
|
|
import frame from './modules/frame'
|
|
|
|
|
import d2Crud from './modules/d2-crud'
|
|
|
|
|
import plugins from './modules/plugins'
|
|
|
|
|
import charts from './modules/charts'
|
|
|
|
|
import components from './modules/components'
|
|
|
|
|
import element from './modules/element'
|
2018-12-16 12:25:41 +08:00
|
|
|
import filters from './modules/filters'
|
2018-10-12 07:10:11 +08:00
|
|
|
import business from './modules/business'
|
|
|
|
|
|
|
|
|
|
import layoutHeaderAside from '@/layout/header-aside'
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 在主框架内显示
|
|
|
|
|
*/
|
|
|
|
|
const frameIn = [
|
|
|
|
|
{
|
|
|
|
|
path: '/',
|
|
|
|
|
redirect: { name: 'index' },
|
|
|
|
|
component: layoutHeaderAside,
|
|
|
|
|
children: [
|
2018-11-05 23:13:28 +08:00
|
|
|
// 首页 必须 name:index
|
2018-10-12 07:10:11 +08:00
|
|
|
{
|
|
|
|
|
path: 'index',
|
|
|
|
|
name: 'index',
|
2019-01-16 10:45:00 +08:00
|
|
|
meta: {
|
|
|
|
|
auth: true
|
|
|
|
|
},
|
2018-10-12 07:10:11 +08:00
|
|
|
component: () => import('@/pages/index')
|
2018-11-05 23:13:28 +08:00
|
|
|
},
|
|
|
|
|
// 刷新页面 必须保留
|
|
|
|
|
{
|
|
|
|
|
path: 'refresh',
|
|
|
|
|
name: 'refresh',
|
|
|
|
|
hidden: true,
|
|
|
|
|
component: {
|
|
|
|
|
beforeRouteEnter (to, from, next) {
|
2019-02-06 15:49:47 +08:00
|
|
|
next(instance => instance.$router.replace(from.fullPath))
|
2018-11-05 23:13:28 +08:00
|
|
|
},
|
|
|
|
|
render: h => h()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 页面重定向 必须保留
|
|
|
|
|
{
|
|
|
|
|
path: 'redirect/:route*',
|
|
|
|
|
name: 'redirect',
|
|
|
|
|
hidden: true,
|
|
|
|
|
component: {
|
|
|
|
|
beforeRouteEnter (to, from, next) {
|
2019-02-06 15:49:47 +08:00
|
|
|
next(instance => instance.$router.replace(JSON.parse(from.params.route)))
|
2018-11-05 23:13:28 +08:00
|
|
|
},
|
|
|
|
|
render: h => h()
|
|
|
|
|
}
|
2018-10-12 07:10:11 +08:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
playground,
|
|
|
|
|
frame,
|
|
|
|
|
d2Crud,
|
|
|
|
|
plugins,
|
|
|
|
|
charts,
|
|
|
|
|
components,
|
|
|
|
|
element,
|
2018-12-16 12:25:41 +08:00
|
|
|
filters,
|
2018-10-12 07:10:11 +08:00
|
|
|
business
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 在主框架之外显示
|
|
|
|
|
*/
|
|
|
|
|
const frameOut = [
|
|
|
|
|
// 登录
|
|
|
|
|
{
|
|
|
|
|
path: '/login',
|
|
|
|
|
name: 'login',
|
|
|
|
|
component: () => import('@/pages/login')
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 错误页面
|
|
|
|
|
*/
|
|
|
|
|
const errorPage = [
|
|
|
|
|
// 404
|
|
|
|
|
{
|
|
|
|
|
path: '*',
|
|
|
|
|
name: '404',
|
|
|
|
|
component: () => import('@/pages/error-page-404')
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
// 导出需要显示菜单的
|
|
|
|
|
export const frameInRoutes = frameIn
|
|
|
|
|
|
|
|
|
|
// 重新组织后导出
|
|
|
|
|
export default [
|
|
|
|
|
...frameIn,
|
|
|
|
|
...frameOut,
|
|
|
|
|
...errorPage
|
|
|
|
|
]
|