rt-sim-training-client/src/router/index.js

831 lines
18 KiB
JavaScript
Raw Normal View History

2019-07-04 10:59:40 +08:00
import Vue from 'vue';
import Router from 'vue-router';
2019-07-02 16:29:52 +08:00
2019-07-04 10:59:40 +08:00
Vue.use(Router);
2019-07-02 16:29:52 +08:00
/* Layout */
2019-07-04 10:59:40 +08:00
import Layout from '@/layout';
2019-07-02 16:29:52 +08:00
/**
* Note: sub-menu only appear when route children.length >= 1
* Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
*
* hidden: true if set true, item will not show in the sidebar(default is false)
* alwaysShow: true if set true, will always show the root menu
* if not set alwaysShow, when item has more than one children route,
* it will becomes nested mode, otherwise not show the root menu
* redirect: noRedirect if set noRedirect will no redirect in the breadcrumb
* name:'router-name' the name is used by <keep-alive> (must set!!!)
* meta : {
roles: ['admin','editor'] control the page roles (you can set multiple roles)
title: 'title' the name show in sidebar and breadcrumb (recommend set)
icon: 'svg-name' the icon show in the sidebar
breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
activeMenu: '/example/list' if set path, the sidebar will highlight the path you set
}
*/
export const user = '01'; // 普通用户
export const mapCreater = '02'; // 地图创建权限
export const lessonCreater = '03'; // 课程创建权限
export const admin = '04'; // 管理员
export const superAdmin = '05'; // 超级管理员
2019-08-09 10:10:26 +08:00
export const userExam = '011'; // 考试系统
export const userLesson = '012'; // 教学系统
2019-07-02 16:29:52 +08:00
export const userSimulation = '013'; // 仿真系统
2019-08-09 10:10:26 +08:00
export const userScreen = '014'; // 大屏系统
export const userPlan = '015'; // 计划系统
2019-07-02 16:29:52 +08:00
export const UrlConfig = {
display: '/display',
examRuleDraft: '/examRule/draft',
2019-07-25 13:26:20 +08:00
examRuleManage: '/examRule/manage',
map: {
prefix: '/map',
draft: '/map/draw',
skinStyle: '/map/skinStyle',
skinStyleDraft: '/map/skinStyle/draft',
runPlan: '/map/runPlan',
runPlanView: '/map/runPlan/view',
product: '/map/product',
productDraft: '/map/product/draft'
2019-07-26 13:32:43 +08:00
},
lesson: {
prefix: '/lesson',
record: '/lesson/record/training',
manage: '/lesson/manage/training'
},
teach: {
prefix: '/teach',
detail: '/teach/detail',
practical: '/teach/practical',
pay: '/teach/pay'
2019-07-26 13:32:43 +08:00
},
exam: {
prefix: '/exam',
detail: '/exam/detail',
course: '/exam/course',
examRuleManage: '/exam/examRule/manage',
pay: '/exam/pay'
},
demonstration: {
prefix: '/demonstration',
detail: '/demonstration/detail',
pay: '/demonstration/pay'
},
dp: {
prefix: '/dp',
detail: '/dp/detail',
pay: '/dp/pay'
},
plan: {
prefix: '/plan',
tool: '/plan/tool',
detail: '/plan/detail',
pay: '/plan/pay'
},
replay: {
prefix: '/replay'
},
permission: {
prefix: '/permission',
permissionList: '/permission/manage',
permissionDraft: '/permission/draft',
permission: '/permission/restore'
},
publish: {
prefix: '/publish',
map: '/publish/map',
mapDraft: '/publish/map/draft',
runPlanEveryDay: '/publish/runPlan/everyDay',
runPlanTemplate: '/publish/runPlan/template',
runPlanCommon: '/publish/runPlan/common',
runPlanView: '/publish/runPlan/view'
2019-07-26 13:32:43 +08:00
},
orderauthor: {
prefix: '/orderauthor',
commodityManage: '/orderauthor/commodity/manage',
commodityDraft: '/orderauthor/commodity/draft',
orderManage: '/orderauthor/order/manage',
orderDraft: '/orderauthor/order/draft',
authorMange: '/orderauthor/author/manage',
authorDraft: '/orderauthor/author/draft',
transferDetail: '/orderauthor/transfer/detail',
trainferPackage: '/orderauthor/transfer/package'
2019-07-25 13:26:20 +08:00
}
2019-07-02 16:29:52 +08:00
};
/**
* constantRoutes
* a base page that does not have permission requirements
* all roles can be accessed
*/
export const constantRoutes = [
{
path: '/login',
component: () => import('@/views/login/loginNew'),
hidden: true
},
{
path: '/login1',
component: () => import('@/views/login/index'),
hidden: true
},
2019-07-26 13:32:43 +08:00
// 扫码登录
{
2019-08-08 13:47:30 +08:00
path: '/dp/login',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/login/loginNewScreen'),
2019-07-26 13:32:43 +08:00
hidden: true
},
// 密码登录
{
2019-08-08 13:47:30 +08:00
path: '/dp/login1',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/login/loginScreen'),
2019-07-26 13:32:43 +08:00
hidden: true
},
// 扫码登录
{
2019-08-08 13:47:30 +08:00
path: '/plan/login',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/login/loginNewPlan'),
2019-07-26 13:32:43 +08:00
hidden: true
},
// 密码登录
{
2019-08-08 13:47:30 +08:00
path: '/plan/login1',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/login/loginPlan'),
2019-07-26 13:32:43 +08:00
hidden: true
},
{
2019-08-08 13:47:30 +08:00
path: '/jlmap3d/edit',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/jlmap3d/jlmap3dedit'),
2019-07-26 13:32:43 +08:00
hidden: true
},
2019-07-02 16:29:52 +08:00
{
path: '/401',
component: () => import('@/views/error-page/401'),
hidden: true
},
{
path: '/404',
component: () => import('@/views/error-page/404'),
hidden: true
},
{
path: '/',
component: Layout,
redirect: '/dashboard',
children: [{
path: 'dashboard',
component: () => import('@/views/dashboard/index'),
2019-08-09 15:10:13 +08:00
meta: {
i18n: 'router.homePage',
icon: 'dashboard'
}
2019-07-02 16:29:52 +08:00
}]
2019-07-26 13:32:43 +08:00
},
{ path: '*', redirect: '/404', hidden: true }
2019-07-04 10:59:40 +08:00
];
2019-07-02 16:29:52 +08:00
2019-07-26 13:32:43 +08:00
export const asyncRouter = [
{
path: '/',
component: Layout,
redirect: '/dashboard',
hidden: true,
children: [
{
path: 'dashboard',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/dashboard/index.vue')
2019-07-26 13:32:43 +08:00
}
]
},
{
path: '/display/:mode',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/display/index'),
2019-07-26 13:32:43 +08:00
meta: {
},
hidden: true
},
{
path: '/trainroom',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/trainRoom/index'),
2019-07-26 13:32:43 +08:00
meta: {
},
hidden: true
},
{
path: '/jointTraining',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/jointTraining/index'),
2019-07-26 13:32:43 +08:00
hidden: true
},
{
path: '/jlmap3d',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/jlmap3d/index'),
2019-07-26 13:32:43 +08:00
meta: {
},
hidden: true
},
{
path: '/map',
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.mapManage',
2019-07-26 13:32:43 +08:00
roles: [admin, mapCreater]
},
component: Layout,
children: [
{
path: 'skinStyle',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/map/skinStyle/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.skinManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'skinStyle/draft/:mode/:skinStyleId',
hidden: true,
2019-08-12 09:36:27 +08:00
component: () => import('@/views/map/skinStyle/draft')
2019-07-26 13:32:43 +08:00
},
{
path: 'draw',
redirect: '/map/draw/0/draft',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/map/mapdraft/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.mapDraw'
2019-07-26 13:32:43 +08:00
},
children: [
{
path: ':mapId/:view',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/map/mapdraft/mapedit/index'),
2019-07-26 13:32:43 +08:00
hidden: true
}
]
},
{
path: 'runPlan',
redirect: '/map/runPlan/view/draft',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/map/runplan/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.runPlanManage'
2019-07-26 13:32:43 +08:00
},
children: [{
path: 'view/:mode',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/map/runplan/chart'),
2019-07-25 13:26:20 +08:00
hidden: true
2019-07-26 13:32:43 +08:00
}]
},
{
path: 'product',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/lesson/trainingcategory/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.productEdit'
2019-07-25 13:26:20 +08:00
}
2019-07-26 13:32:43 +08:00
}
]
},
{
path: '/lesson',
component: Layout,
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.lessaonManage',
2019-07-26 13:32:43 +08:00
roles: [admin, lessonCreater]
},
children: [
{
path: 'record',
redirect: '/lesson/record/training/0/null',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/lesson/trainingrecord/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.trainingRecord'
2019-07-26 13:32:43 +08:00
},
children: [
{
path: 'training/:trainingId/:trainingName',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/lesson/trainingrecord/manage/index'),
2019-07-26 13:32:43 +08:00
hidden: true
}
]
},
{
2019-08-09 15:10:13 +08:00
path: 'manage/taskManage',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/lesson/taskmanage/list'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.taskManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'manage/trainingRule',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/lesson/trainingRule/list'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.trainingRule'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'manage/trainingRule/detail',
hidden: true,
2019-08-12 09:36:27 +08:00
component: () => import('@/views/lesson/trainingRule/detail/index'),
2019-07-26 13:32:43 +08:00
meta: {
}
},
{
path: 'manage/training',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/lesson/trainingmanage/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.trainingManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'edit',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/lesson/lessoncategory/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.lessonEdit'
2019-07-26 13:32:43 +08:00
}
2019-08-08 10:31:46 +08:00
}
]
},
{
path: '/script',
component: Layout,
meta: {
2019-08-09 10:33:11 +08:00
roles: [admin, lessonCreater]
2019-08-08 10:31:46 +08:00
},
children: [
2019-07-26 13:32:43 +08:00
{
2019-08-09 15:10:13 +08:00
path: 'scriptManage',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/lesson/scriptmanage/list'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.scriptManage'
2019-07-26 13:32:43 +08:00
}
}
]
},
{
path: '/teach',
redirect: '/teach/home',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/teach/index'),
2019-07-26 13:32:43 +08:00
meta: {
roles: [admin, userLesson, user]
},
children: [
{
path: 'home',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/teach/home'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.teachSystem'
2019-07-26 13:32:43 +08:00
}
},
{
2019-08-09 10:10:26 +08:00
// 课程详情
2019-07-26 13:32:43 +08:00
path: 'detail/:lessonId',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/teach/detail/index'),
2019-07-26 13:32:43 +08:00
meta: {
},
hidden: true
},
{
2019-08-09 10:10:26 +08:00
// 实训详情
2019-07-26 13:32:43 +08:00
path: 'practical/:trainingId/:lessonId',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/teach/practical/index'),
2019-07-26 13:32:43 +08:00
meta: {
},
hidden: true
},
{
path: 'pay/:lessonId',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/components/pay/index'),
2019-07-26 13:32:43 +08:00
meta: {
},
hidden: true
}
]
},
{
path: '/exam',
redirect: '/exam/home',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/exam/index'),
2019-07-26 13:32:43 +08:00
meta: {
roles: [admin, userExam, user]
},
children: [
{
path: 'home',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/exam/home'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.examSystem'
2019-07-26 13:32:43 +08:00
}
},
{
2019-08-09 10:10:26 +08:00
// 试卷详情
2019-07-26 13:32:43 +08:00
path: 'detail/:examId',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/exam/detail/examDetail'),
2019-07-26 13:32:43 +08:00
hidden: true
},
{
path: 'course/:lessonId',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/exam/detail/courseDetail'),
2019-07-26 13:32:43 +08:00
hidden: true
},
{
2019-08-09 10:10:26 +08:00
// 规则管理
2019-07-26 13:32:43 +08:00
path: 'examRule/manage',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/publish/examRule/index'),
2019-07-26 13:32:43 +08:00
hidden: true
},
{
path: 'examRule/draft/:mode/:ruleId/:lessonId',
hidden: true,
2019-08-12 09:36:27 +08:00
component: () => import('@/views/publish/examRule/draft/index')
2019-07-26 13:32:43 +08:00
},
{
path: 'pay/:lessonId',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/components/pay/index'),
2019-07-26 13:32:43 +08:00
hidden: true
},
{
2019-08-09 10:10:26 +08:00
// 开始考试
2019-07-26 13:32:43 +08:00
path: 'questionDetail/:examQuestionId',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/exam/detail/questionDetail'),
2019-07-26 13:32:43 +08:00
hidden: true
},
{
2019-08-09 10:10:26 +08:00
// 考试结果
2019-07-26 13:32:43 +08:00
path: 'result/:userExamId',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/exam/result'),
2019-07-26 13:32:43 +08:00
hidden: true
}
]
},
{
path: '/demonstration',
redirect: '/demonstration/home',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/demonstration/index'),
2019-07-26 13:32:43 +08:00
meta: {
roles: [admin, userSimulation, user]
},
children: [
{
path: 'home',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/demonstration/home'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.demonstrationSystem'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'detail/:mapId',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/demonstration/detail/index'),
2019-07-26 13:32:43 +08:00
hidden: true
},
{
path: 'pay/:lessonId',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/components/pay/index'),
2019-07-26 13:32:43 +08:00
hidden: true
}
]
},
{
path: '/dp',
redirect: '/dp/home',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/screenMonitor/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-08 13:47:30 +08:00
roles: [admin, userScreen, user]
2019-07-26 13:32:43 +08:00
},
children: [
{
path: 'home',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/screenMonitor/home'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.dpSystem'
2019-07-26 13:32:43 +08:00
},
target: true
},
{
path: 'detail/:lessonId',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/screenMonitor/detail/index'),
2019-07-26 13:32:43 +08:00
hidden: true
},
{
path: 'pay/:lessonId',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/components/pay/index'),
2019-07-26 13:32:43 +08:00
hidden: true
}
]
},
{
path: '/plan/tool',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/planMonitor/editTool/index'),
2019-07-26 13:32:43 +08:00
meta: {
},
hidden: true
},
{
path: '/plan',
redirect: '/plan/home',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/planMonitor/index'),
2019-07-26 13:32:43 +08:00
meta: {
roles: [admin, user]
},
children: [
{
path: 'home',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/planMonitor/home'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.planSystem'
2019-07-26 13:32:43 +08:00
},
target: true
},
{
path: 'detail/:lessonId',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/planMonitor/detail'),
2019-07-26 13:32:43 +08:00
hidden: true
},
{
path: 'pay/:lessonId',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/components/pay/index'),
2019-07-26 13:32:43 +08:00
hidden: true
}
]
},
{
path: '/replay',
component: Layout,
meta: {
roles: [admin]
},
children: [
{
path: 'manage',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/replay/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.replayManage'
2019-07-26 13:32:43 +08:00
}
}
]
},
{
path: '/permission',
component: Layout,
meta: {
roles: [admin, user]
},
children: [
{
path: 'manage',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/package/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.permissionManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'draft',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/package/draft/ruleForm'),
2019-07-26 13:32:43 +08:00
hidden: true
}
]
},
{
path: '/publish',
component: Layout,
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.pulishManage',
2019-07-26 13:32:43 +08:00
roles: [admin]
},
children: [
{
path: 'map',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/publish/publishMap/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.publishMapManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'product',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/publish/productStatus/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.productStateManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'lesson',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/publish/publishLesson/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.publishLessonManage'
2019-07-26 13:32:43 +08:00
}
},
// {
// path: 'script',
2019-08-12 09:36:27 +08:00
// component:() => import('@/views/publish/simulationScript/index'),
2019-07-26 13:32:43 +08:00
// meta: {
// title: '仿真脚本管理',
// }
// },
{
path: 'runPlan/template',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/publish/runPlanTemplate/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.runPlanTemplateManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'runPlan/common',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/publish/runPlanCommon/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.runPlanCommonManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'runPlan/everyDay',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/publish/runPlanEveryDay/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.runPlanEveryDayManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'examRule/manage',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/publish/examRule/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.examRuleManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'map/draft/:mode/:mapId',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/publish/publishMap/draft'),
2019-07-26 13:32:43 +08:00
hidden: true
},
{
path: 'examRule/draft/:mode/:ruleId/:lessonId',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/publish/examRule/draft/index'),
2019-08-09 15:10:13 +08:00
hidden: true
2019-07-26 13:32:43 +08:00
},
{
path: 'runPlan/common/:mode',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/publish/runPlanCommon/draft'),
2019-07-26 13:32:43 +08:00
hidden: true
},
{
path: 'runPlan/view/:mode',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/map/runplan/chart'),
2019-07-26 13:32:43 +08:00
hidden: true
}
]
},
{
path: '/orderauthor',
component: Layout,
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.orderAuthorityManage',
2019-07-26 13:32:43 +08:00
roles: [admin]
},
children: [
{
path: 'commodity/manage',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/orderauthor/commodity/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.commodityManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'order/manage',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/orderauthor/order/list'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.orderManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'author/manage',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/orderauthor/author/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.authorityManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'transfer/manage',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/orderauthor/permission/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.authorityTransferManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'commodity/draft/:mode/:commodityId',
hidden: true,
2019-08-12 09:36:27 +08:00
component: () => import('@/views/orderauthor/commodity/draft'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.addCommodity'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'order/draft/:mode/:orderId',
hidden: true,
2019-08-12 09:36:27 +08:00
component: () => import('@/views/orderauthor/order/draft'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.addOrder'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'author/draft/:mode/:userId',
hidden: true,
2019-08-12 09:36:27 +08:00
component: () => import('@/views/orderauthor/author/draft'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.addCoursePermissions'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'transfer/detail/:permissionId',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/orderauthor/permission/detail'),
2019-07-26 13:32:43 +08:00
hidden: true
},
{
path: 'transfer/package',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/orderauthor/permission/draft/ruleForm'),
2019-07-26 13:32:43 +08:00
hidden: true
}
]
},
{
path: '/system',
component: Layout,
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.systemManage',
2019-07-26 13:32:43 +08:00
roles: [admin]
},
children: [
{
path: 'dictionary',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/management/dictionary/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.dataDictionary'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'dictionary/detail',
hidden: true,
2019-08-12 09:36:27 +08:00
component: () => import('@/views/management/dictionaryDetail/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.dataDictionaryDetails'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'userManage',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/management/userControl/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.userManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'userTrainingManage',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/management/userTraining/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.userTrainingManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'userExamManage',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/management/userExam/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.userExamManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'userSimulationManage',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/management/userSimulation/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.userSimulationManage'
2019-07-26 13:32:43 +08:00
}
},
{
path: 'existingSimulation',
2019-08-12 09:36:27 +08:00
component: () => import('@/views/management/existingSimulation/index'),
2019-07-26 13:32:43 +08:00
meta: {
2019-08-09 15:10:13 +08:00
i18n: 'router.existingSimulation'
2019-07-26 13:32:43 +08:00
}
}
]
}
2019-07-04 10:59:40 +08:00
];
2019-07-02 16:29:52 +08:00
const createRouter = () => new Router({
mode: 'history', // require service support
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
2019-07-04 10:59:40 +08:00
});
2019-07-02 16:29:52 +08:00
2019-07-04 10:59:40 +08:00
const router = createRouter();
2019-07-02 16:29:52 +08:00
2019-08-09 15:10:13 +08:00
router.beforeEach((to, from, next) => {
const name = to.fullPath;
if (name.includes('/dp/') || name.includes('display/dp')) {
document.title = '琏课堂-大屏系统';
} else if (name.includes('/plan/') || name.includes('/planEdit/')) {
document.title = '琏计划';
} else {
document.title = '琏课堂';
}
next();
});
2019-07-04 10:59:40 +08:00
export default router;