2019-11-13 09:06:57 +08:00
|
|
|
// import Vue from 'vue';
|
2019-07-04 10:59:40 +08:00
|
|
|
import Router from 'vue-router';
|
2019-11-13 09:06:57 +08:00
|
|
|
// import VueRouter from 'vue-router';
|
2019-07-02 16:29:52 +08:00
|
|
|
|
2019-11-13 09:06:57 +08:00
|
|
|
// Vue.use(Router);
|
2019-07-02 16:29:52 +08:00
|
|
|
|
|
|
|
/* Layout */
|
2019-11-12 17:20:23 +08:00
|
|
|
const Layout = () => import('@/layout');
|
|
|
|
const Login = () => import('@/views/login/index');
|
|
|
|
|
|
|
|
const Jlmap3dedit = () => import('@/views/jlmap3d/edit/jlmap3dedit');
|
|
|
|
const Jlmap3d = () => import('@/views/jlmap3d/drive/jl3ddrive');
|
|
|
|
const Display = () => import('@/views/display/index');
|
|
|
|
const DesignDisplay = () => import('@/views/display/designIndex');
|
|
|
|
|
|
|
|
const TrainRoom = () => import('@/views/trainRoom/index');
|
|
|
|
const JointTraining = () => import('@/views/jointTraining/index');
|
|
|
|
|
|
|
|
const Error401 = () => import('@/views/error-page/401');
|
|
|
|
const Errpr404 = () => import('@/views/error-page/404');
|
|
|
|
|
|
|
|
const MapProduct = () => import('@/views/system/product/index');
|
|
|
|
const Dictionary = () => import('@/views/system/dictionary/index');
|
|
|
|
const DictionaryDetail = () => import('@/views/system/dictionaryDetail/index');
|
|
|
|
const UserControl = () => import('@/views/system/userControl/index');
|
|
|
|
const UserTraining = () => import('@/views/system/userTraining/index');
|
|
|
|
const UserExam = () => import('@/views/system/userExam/index');
|
|
|
|
const UserSimulation = () => import('@/views/system/userSimulation/index');
|
|
|
|
const ExistingSimulation = () => import('@/views/system/existingSimulation/index');
|
|
|
|
const CacheControl = () => import('@/views/system/cacheControl/index');
|
|
|
|
const SystemGenerate = () => import('@/views/system/systemGenerate/index');
|
|
|
|
const IbpDraw = () => import('@/views/system/ibpDraw/index');
|
2019-11-14 14:10:20 +08:00
|
|
|
const News = () => import('@/views/system/news/index');
|
2019-11-15 16:31:48 +08:00
|
|
|
const CommandDictionary = () => import('@/views/system/commandDictionary/index');
|
2019-11-12 17:20:23 +08:00
|
|
|
|
|
|
|
const Mapedit = () => import('@/views/mapdraft/index');
|
|
|
|
|
|
|
|
const Taskmanage = () => import('@/views/lesson/taskmanage/list');
|
|
|
|
const TrainingRuleList = () => import('@/views/lesson/trainingRule/list');
|
|
|
|
const TrainingRuleEdit = () => import('@/views/lesson/trainingRule/detail/index');
|
|
|
|
const Trainingmanage = () => import('@/views/lesson/trainingmanage/index');
|
|
|
|
const LessonEdit = () => import('@/views/lesson/lessoncategory/index');
|
|
|
|
const LessonHome = () => import('@/views/lesson/home');
|
|
|
|
const LessonDetail = () => import('@/views/lesson/details');
|
|
|
|
|
|
|
|
const ScriptmanageHome = () => import('@/views/scriptManage/home');
|
|
|
|
const ScriptDisplay = () => import('@/views/scriptManage/display/index');
|
|
|
|
|
|
|
|
const TeachDetail = () => import('@/views/teach/detail/index');
|
|
|
|
const TeachHome = () => import('@/views/teach/index');
|
|
|
|
const Pay = () => import('@/views/components/pay/index');
|
|
|
|
|
|
|
|
const ExamHome = () => import('@/views/exam/index');
|
|
|
|
const ExamResult = () => import('@/views/exam/result');
|
|
|
|
const ExamDetail = () => import('@/views/exam/detail/examDetail');
|
|
|
|
const ExamCourseDetail = () => import('@/views/exam/detail/courseDetail');
|
|
|
|
|
|
|
|
const DemonstrationDetail = () => import('@/views/demonstration/detail/index');
|
|
|
|
|
|
|
|
const PlanMonitorEditTool = () => import('@/views/planMonitor/editTool/index');
|
|
|
|
const PlanMonitorEditUserTool = () => import('@/views/planMonitor/editTool/userindex');
|
|
|
|
const PlanMonitorDetail = () => import('@/views/planMonitor/detail');
|
|
|
|
|
|
|
|
const DesignPlatformHome = () => import('@/views/designPlatform/home');
|
|
|
|
const DesignPlatform = () => import('@/views/designPlatform/index');
|
|
|
|
const MapPreview = () => import('@/views/designPlatform/mapPreview');
|
|
|
|
|
|
|
|
const DesignPlatformUser = () => import('@/views/designUser/index');
|
|
|
|
|
|
|
|
const Package = () => import('@/views/package/index');
|
|
|
|
const PackageDraft = () => import('@/views/package/draft/ruleForm');
|
|
|
|
const PackageDetail = () => import('@/views/package/detail');
|
|
|
|
|
|
|
|
const PublishMap = () => import('@/views/publish/publishMap/index');
|
|
|
|
const PublishMapDetail = () => import('@/views/publish/publishMap/list'); // 发布历史
|
|
|
|
const ProductStatus = () => import('@/views/publish/productStatus/index');
|
|
|
|
const PublishLesson = () => import('@/views/publish/publishLesson/index');
|
|
|
|
const RunPlanTemplate = () => import('@/views/publish/runPlanTemplate/index');
|
|
|
|
const RunPlanCommon = () => import('@/views/publish/runPlanCommon/index');
|
|
|
|
const RunPlanCommonDraft = () => import('@/views/publish/runPlanCommon/draft');
|
|
|
|
const RunPlanEveryDay = () => import('@/views/publish/runPlanEveryDay/index');
|
|
|
|
const RunplanView = () => import('@/views/publish/runPlanEveryDay/runPlanView');
|
|
|
|
const PublishExamRule = () => import('@/views/publish/examRule/index');
|
|
|
|
const PublishExamRuleDraft = () => import('@/views/publish/examRule/draft/index');
|
|
|
|
|
|
|
|
const TrainingPlatform = () => import('@/views/trainingPlatform/index');
|
|
|
|
|
|
|
|
const Commodity = () => import('@/views/orderauthor/commodity/index');
|
|
|
|
const CommodityDraft = () => import('@/views/orderauthor/commodity/draft');
|
|
|
|
const OrderList = () => import('@/views/orderauthor/order/list');
|
|
|
|
const OrderDraft = () => import('@/views/orderauthor/order/draft');
|
|
|
|
const Author = () => import('@/views/orderauthor/author/index');
|
|
|
|
const AuthorDraft = () => import('@/views/orderauthor/author/draft/ruleForm');
|
|
|
|
const Permission = () => import('@/views/orderauthor/permission/index');
|
|
|
|
const PermissionDetail = () => import('@/views/orderauthor/permission/detail');
|
|
|
|
const PermissionDraft = () => import('@/views/orderauthor/permission/package/ruleForm');
|
|
|
|
const PermissionCreate = () => import('@/views/orderauthor/permission/create/index');
|
|
|
|
const UserRules = () => import('@/views/orderauthor/rules/index');
|
|
|
|
const UserRulesDetail = () => import('@/views/orderauthor/rules/detail');
|
|
|
|
|
|
|
|
const LessonApproval = () => import('@/views/approval/lesson/index');
|
|
|
|
const ScriptApproval = () => import('@/views/approval/script/index');
|
|
|
|
const RunPlanApproval = () => import('@/views/approval/runPlan/index');
|
2019-10-17 17:11:15 +08:00
|
|
|
|
2019-11-14 13:59:33 +08:00
|
|
|
import { loginInfo } from '@/scripts/ConstDic';
|
2019-10-16 15:28:29 +08:00
|
|
|
import { getSessionStorage } from '@/utils/auth';
|
2019-10-11 08:55:02 +08:00
|
|
|
|
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-11-14 16:31:31 +08:00
|
|
|
export const userTrainingPlatform = '016'; // 实训平台
|
2019-11-12 13:36:21 +08:00
|
|
|
// const isDev = process.env.NODE_ENV === 'development';
|
2019-07-02 16:29:52 +08:00
|
|
|
|
|
|
|
export const UrlConfig = {
|
2019-10-29 13:15:57 +08:00
|
|
|
display: '/display',
|
|
|
|
scriptDisplay: '/scriptDisplay',
|
|
|
|
examRuleDraft: '/examRule/draft',
|
|
|
|
examRuleManage: '/examRule/manage',
|
|
|
|
lesson: {
|
|
|
|
prefix: '/lesson',
|
|
|
|
record: '/system/record/training',
|
|
|
|
manage: '/lesson/manage/training'
|
|
|
|
},
|
|
|
|
design: {
|
|
|
|
prefix: '/design/home',
|
|
|
|
mapDraw: '/design/map/draw',
|
|
|
|
lessonEdit: '/design/lesson/edit',
|
|
|
|
lessonHome: '/design/lesson/home',
|
|
|
|
lessonManage: '/design/lesson/manage',
|
|
|
|
taskManage: '/design/lesson/taskManage',
|
|
|
|
trainingRule: '/design/lesson/trainingRule',
|
|
|
|
trainingRuleDetail: '/design/lesson/trainingRule/detail',
|
|
|
|
trainingManage: '/design/lesson/trainingManage',
|
|
|
|
lessonTraining: '/design/lesson/training',
|
|
|
|
trainingRecord: '/design/lesson/training',
|
|
|
|
runPlan: '/design/runPlan/detail',
|
|
|
|
scriptHome: '/design/script/home',
|
|
|
|
display: '/design/display',
|
|
|
|
mapPreview: '/design/mapPreview'
|
|
|
|
},
|
|
|
|
designUser: {
|
|
|
|
prefix: '/design/userlist/home',
|
|
|
|
scriptHome: '/design/userlist/script/home',
|
|
|
|
mapDraw: '/design/userlist/map/draw',
|
|
|
|
lessonHome: '/design/userlist/lesson/home',
|
|
|
|
runPlan: '/design/userlist/runPlan/detail'
|
|
|
|
},
|
|
|
|
replay: {
|
|
|
|
prefix: '/replay'
|
|
|
|
},
|
|
|
|
publish: {
|
|
|
|
prefix: '/publish',
|
|
|
|
map: '/publish/map',
|
|
|
|
runPlanEveryDay: '/publish/runPlan/everyDay',
|
|
|
|
runPlanTemplate: '/publish/runPlan/template',
|
|
|
|
runPlanCommon: '/publish/runPlan/common',
|
|
|
|
runPlanView: '/publish/runPlan/view'
|
|
|
|
},
|
|
|
|
orderauthor: {
|
|
|
|
prefix: '/orderauthor',
|
|
|
|
commodityManage: '/orderauthor/commodity/manage',
|
|
|
|
commodityDraft: '/orderauthor/commodity/draft',
|
|
|
|
orderManage: '/orderauthor/order/manage',
|
|
|
|
orderDraft: '/orderauthor/order/draft',
|
|
|
|
authorMange: '/orderauthor/author/manage',
|
|
|
|
authorDetail: '/orderauthor/author/detail',
|
|
|
|
authorDraft: '/orderauthor/author/draft',
|
|
|
|
transferDetail: '/orderauthor/transfer/detail',
|
|
|
|
trainferPackage: '/orderauthor/transfer/package',
|
|
|
|
createPackage: '/orderauthor/transfer/create'
|
|
|
|
},
|
|
|
|
script: {
|
|
|
|
prefix: '/script',
|
|
|
|
detail: '/script/detail',
|
|
|
|
display: '/script/display'
|
|
|
|
},
|
|
|
|
ibp: {
|
|
|
|
prefix: 'ibp',
|
|
|
|
draft: '/ibp/draft',
|
|
|
|
edit: 'ibp/edit'
|
|
|
|
},
|
|
|
|
trainingPlatform: {
|
|
|
|
trainingPlatform: '/trainingPlatform',
|
|
|
|
prodDetail: '/trainingPlatform/detail',
|
|
|
|
teachDetail: '/trainingPlatform/teach',
|
|
|
|
teachHome: '/trainingPlatform/teachHome',
|
|
|
|
examDetail: '/trainingPlatform/exam',
|
|
|
|
examHome: '/trainingPlatform/examHome',
|
|
|
|
examRuleManage: '/trainingPlatform/examRule/manage',
|
|
|
|
examRuleDraft: '/trainingPlatform/examRule/Draft',
|
|
|
|
course: '/trainingPlatform/course',
|
|
|
|
practical: '/trainingPlatform/practical',
|
|
|
|
permission: '/trainingPlatform/permission',
|
|
|
|
permissionDetails: '/trainingPlatform/permission/detail',
|
|
|
|
draft: '/trainingPlatform/draft',
|
|
|
|
pay: '/trainingPlatform/pay',
|
|
|
|
runPlan: '/trainingPlatform/runPlan/manage'
|
|
|
|
}
|
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 = [
|
2019-10-29 13:15:57 +08:00
|
|
|
// 实训平台登录
|
|
|
|
{
|
|
|
|
path: '/login',
|
|
|
|
component: Login,
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
// 项目系统登录
|
|
|
|
{
|
|
|
|
path: '/xty/login',
|
|
|
|
component: Login,
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-29 15:06:15 +08:00
|
|
|
{
|
|
|
|
path: '/xty',
|
|
|
|
redirect: '/xty/login',
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-29 13:15:57 +08:00
|
|
|
// 设计平台登录
|
|
|
|
{
|
|
|
|
path: '/design/login',
|
|
|
|
component: Login,
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-29 15:06:15 +08:00
|
|
|
{
|
|
|
|
path: '/designxty/login',
|
|
|
|
component: Login,
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/designxty',
|
|
|
|
redirect: '/designxty/login',
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-29 13:15:57 +08:00
|
|
|
{
|
|
|
|
path: '/design/jlmap3d/edit',
|
|
|
|
component: Jlmap3dedit,
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/401',
|
|
|
|
component: Error401,
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-07-02 16:29:52 +08:00
|
|
|
|
2019-10-29 13:15:57 +08:00
|
|
|
{
|
|
|
|
path: '/404',
|
|
|
|
component: Errpr404,
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{ 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 = [
|
2019-10-30 13:58:34 +08:00
|
|
|
{ // 公共地图
|
2019-10-29 13:15:57 +08:00
|
|
|
path: '/design',
|
|
|
|
component: Layout,
|
|
|
|
redirect: '/design/home',
|
|
|
|
meta: {
|
2019-11-14 16:31:31 +08:00
|
|
|
roles: [admin, user]
|
2019-10-29 13:15:57 +08:00
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: '',
|
|
|
|
redirect: '/design/home',
|
|
|
|
component: DesignPlatform,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.designhomePage',
|
|
|
|
icon: 'design'
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'home',
|
|
|
|
component: DesignPlatformHome,
|
|
|
|
meta: {
|
|
|
|
}
|
|
|
|
},
|
2019-10-31 15:44:43 +08:00
|
|
|
{ // 运行图设计
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'runPlan/detail/:mapId',
|
|
|
|
component: PlanMonitorDetail,
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-31 15:44:43 +08:00
|
|
|
{ // 剧本
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'script/home/:mapId',
|
|
|
|
component: ScriptmanageHome,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.scriptManage'
|
|
|
|
},
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-31 15:44:43 +08:00
|
|
|
{ // 课程列表
|
2019-10-31 13:56:42 +08:00
|
|
|
path: 'lesson/home/:mapId',
|
2019-10-29 13:15:57 +08:00
|
|
|
component: LessonHome,
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-31 15:44:43 +08:00
|
|
|
{ // 操作定义
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'lesson/trainingRule',
|
|
|
|
component: TrainingRuleList,
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-31 15:44:43 +08:00
|
|
|
{ // 操作定义步骤
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'lesson/trainingRule/detail',
|
|
|
|
hidden: true,
|
|
|
|
component: TrainingRuleEdit
|
|
|
|
},
|
2019-10-31 15:44:43 +08:00
|
|
|
{ // 任务管理
|
|
|
|
path: 'lesson/taskManage',
|
|
|
|
component: Taskmanage,
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{ // 实训管理
|
2019-10-31 15:56:07 +08:00
|
|
|
path: 'lesson/trainingManage',
|
2019-10-29 13:15:57 +08:00
|
|
|
component: Trainingmanage,
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-31 15:44:43 +08:00
|
|
|
{ // 创建课程
|
|
|
|
path: 'lesson/edit/:type',
|
|
|
|
component: LessonEdit,
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{ // 课程详情
|
|
|
|
path: 'lesson/details',
|
|
|
|
component: LessonDetail,
|
|
|
|
hidden: true,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'edit/:type',
|
|
|
|
component: LessonEdit,
|
|
|
|
hidden: true
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{ // 地图预览
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'mapPreview/:mapId',
|
|
|
|
component: MapPreview,
|
|
|
|
hidden: true
|
2019-10-24 18:11:58 +08:00
|
|
|
|
2019-10-29 13:15:57 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2019-10-30 13:58:34 +08:00
|
|
|
{ // 个人地图
|
2019-10-29 13:15:57 +08:00
|
|
|
path: '/design/userlist',
|
|
|
|
redirect: '/design/userlist/home',
|
|
|
|
component: Layout,
|
|
|
|
meta: {
|
2019-11-14 16:31:31 +08:00
|
|
|
roles: [admin, user]
|
2019-10-29 13:15:57 +08:00
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: '',
|
|
|
|
redirect: '/design/userlist/home',
|
|
|
|
component: DesignPlatformUser,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.designUserPage',
|
|
|
|
icon: 'design'
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'home',
|
|
|
|
component: DesignPlatformHome,
|
|
|
|
meta: {
|
|
|
|
}
|
|
|
|
},
|
2019-10-31 15:44:43 +08:00
|
|
|
{ // 地图绘制
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'map/draw/:mapId/:view',
|
|
|
|
component: Mapedit,
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-31 15:44:43 +08:00
|
|
|
{ // 运行图设计
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'runPlan/detail/:mapId',
|
|
|
|
component: PlanMonitorDetail,
|
|
|
|
hidden: true
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2019-10-30 13:58:34 +08:00
|
|
|
{ // 全屏战场图
|
2019-10-29 13:15:57 +08:00
|
|
|
path: '/display/:mode',
|
|
|
|
component: Display,
|
|
|
|
meta: {
|
|
|
|
},
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/design/display/:mode',
|
|
|
|
component: DesignDisplay,
|
|
|
|
meta: {
|
|
|
|
},
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-11-01 15:19:15 +08:00
|
|
|
{ // 剧本编辑 战场图
|
2019-10-29 13:15:57 +08:00
|
|
|
path: '/scriptDisplay/:mode',
|
|
|
|
component: ScriptDisplay,
|
|
|
|
meta: {
|
|
|
|
},
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-30 13:58:34 +08:00
|
|
|
{ // 综合演练室
|
2019-10-29 13:15:57 +08:00
|
|
|
path: '/trainroom',
|
|
|
|
component: TrainRoom,
|
|
|
|
meta: {
|
|
|
|
},
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/jointTraining',
|
|
|
|
component: JointTraining,
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/jlmap3d',
|
|
|
|
component: Jlmap3d,
|
|
|
|
meta: {
|
|
|
|
},
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-30 10:15:18 +08:00
|
|
|
{ // 实训平台
|
2019-10-29 13:15:57 +08:00
|
|
|
path: '/trainingPlatform',
|
|
|
|
component: Layout,
|
|
|
|
hidden: true,
|
|
|
|
meta: {
|
2019-11-14 16:31:31 +08:00
|
|
|
roles: [admin, userSimulation, user, userTrainingPlatform]
|
2019-10-29 13:15:57 +08:00
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: '',
|
|
|
|
component: TrainingPlatform,
|
|
|
|
meta: {
|
|
|
|
},
|
|
|
|
children: [
|
2019-10-31 15:44:43 +08:00
|
|
|
{ // 仿真详情
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'detail/:subSystem',
|
|
|
|
component: DemonstrationDetail,
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-31 15:44:43 +08:00
|
|
|
{ // 教学系统 课程列表
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'teachHome/:subSystem',
|
|
|
|
component: TeachHome,
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-31 15:44:43 +08:00
|
|
|
{ // 课程详情
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'teach/:subSystem',
|
|
|
|
component: TeachDetail,
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-31 17:30:24 +08:00
|
|
|
{ // 试卷列表
|
|
|
|
path: 'course/:subSystem',
|
|
|
|
component: ExamCourseDetail,
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{ // 考试系统 课程列表
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'examHome/:subSystem',
|
|
|
|
component: ExamHome,
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-31 17:30:24 +08:00
|
|
|
{ // 试卷详情
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'exam/:examId',
|
|
|
|
component: ExamDetail,
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-31 17:30:24 +08:00
|
|
|
{ // 试卷列表
|
|
|
|
path: 'examRule/manage',
|
|
|
|
component: PublishExamRule,
|
2019-10-29 13:15:57 +08:00
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-31 17:30:24 +08:00
|
|
|
{ // 创建试卷
|
|
|
|
path: 'examRule/draft/:mode/:ruleId/:lessonId',
|
|
|
|
component: PublishExamRuleDraft,
|
2019-10-29 13:15:57 +08:00
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-31 17:30:24 +08:00
|
|
|
{ // 购买
|
|
|
|
path: 'pay/:lessonId',
|
|
|
|
component: Pay,
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{ // 考试结果
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'result/:userExamId',
|
|
|
|
component: ExamResult,
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-31 17:30:24 +08:00
|
|
|
{ // 线路权限列表
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'permission/:mapId',
|
|
|
|
component: Package,
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-31 17:30:24 +08:00
|
|
|
{ // 打包详情
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'permission/detail/:id',
|
|
|
|
component: PackageDetail,
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-31 17:30:24 +08:00
|
|
|
{ // 权限打包
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'draft',
|
|
|
|
component: PackageDraft,
|
|
|
|
hidden: true
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2019-10-30 13:58:34 +08:00
|
|
|
{ // 运行图编辑
|
2019-10-29 13:15:57 +08:00
|
|
|
path: '/plan/usertool',
|
|
|
|
component: PlanMonitorEditUserTool,
|
|
|
|
meta: {
|
|
|
|
},
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-30 13:58:34 +08:00
|
|
|
{ // 运行图编辑
|
2019-10-29 13:15:57 +08:00
|
|
|
path: '/plan/tool',
|
|
|
|
component: PlanMonitorEditTool,
|
|
|
|
meta: {
|
|
|
|
},
|
|
|
|
hidden: true
|
|
|
|
},
|
2019-10-30 13:58:34 +08:00
|
|
|
{ // 发布内容管理
|
2019-10-29 13:15:57 +08:00
|
|
|
path: '/publish',
|
|
|
|
component: Layout,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.pulishManage',
|
2019-11-14 16:31:31 +08:00
|
|
|
roles: [admin]
|
2019-10-29 13:15:57 +08:00
|
|
|
},
|
|
|
|
children: [
|
2019-10-31 18:43:05 +08:00
|
|
|
{ // 发布地图
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'map',
|
|
|
|
component: PublishMap,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.publishMapManage'
|
|
|
|
}
|
|
|
|
},
|
2019-10-31 18:43:05 +08:00
|
|
|
{ // 发布历史
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'map/detail',
|
|
|
|
hidden: true,
|
|
|
|
component: PublishMapDetail
|
|
|
|
},
|
2019-10-31 18:43:05 +08:00
|
|
|
{ // 产品状态
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'product',
|
|
|
|
component: ProductStatus,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.productStateManage'
|
|
|
|
}
|
|
|
|
},
|
2019-10-31 18:43:05 +08:00
|
|
|
{ // 发布课程
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'lesson',
|
|
|
|
component: PublishLesson,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.publishLessonManage'
|
|
|
|
}
|
|
|
|
},
|
2019-10-31 18:43:05 +08:00
|
|
|
{ // 模板运行图
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'runPlan/template',
|
|
|
|
component: RunPlanTemplate,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.runPlanTemplateManage'
|
|
|
|
}
|
|
|
|
},
|
2019-10-31 18:43:05 +08:00
|
|
|
{ // 加载运行图管理
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'runPlan/common',
|
|
|
|
component: RunPlanCommon,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.runPlanCommonManage'
|
|
|
|
}
|
|
|
|
},
|
2019-10-31 18:43:05 +08:00
|
|
|
{ // 新增加载运行图
|
|
|
|
path: 'runPlan/common/:mode',
|
|
|
|
component: RunPlanCommonDraft,
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{ // 运行图预览
|
|
|
|
path: 'runPlan/view/:mode',
|
|
|
|
component: RunplanView,
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{ // 每日运行图
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'runPlan/everyDay',
|
|
|
|
component: RunPlanEveryDay,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.runPlanEveryDayManage'
|
|
|
|
}
|
|
|
|
},
|
2019-10-31 18:43:05 +08:00
|
|
|
{ // 考试规则列表
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'examRule/manage',
|
|
|
|
component: PublishExamRule,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.examRuleManage'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'examRule/draft/:mode/:ruleId/:lessonId',
|
|
|
|
component: PublishExamRuleDraft,
|
|
|
|
hidden: true
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2019-10-30 13:58:34 +08:00
|
|
|
{ // 订单权限管理
|
2019-10-29 13:15:57 +08:00
|
|
|
path: '/orderauthor',
|
|
|
|
component: Layout,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.orderAuthorityManage',
|
2019-11-14 16:31:31 +08:00
|
|
|
roles: [admin]
|
2019-10-29 13:15:57 +08:00
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'author/manage',
|
|
|
|
component: Author,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.authorityManage'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'commodity/manage',
|
|
|
|
component: Commodity,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.commodityManage'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'order/manage',
|
|
|
|
component: OrderList,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.orderManage'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'transfer/manage',
|
|
|
|
component: Permission,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.authorityTransferManage'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'rules/manage',
|
|
|
|
component: UserRules,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.userRulesManage'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'rules/manage/detail/:id',
|
|
|
|
hidden: true,
|
|
|
|
component: UserRulesDetail,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.userRulesManage'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'commodity/draft/:mode/:commodityId',
|
|
|
|
hidden: true,
|
|
|
|
component: CommodityDraft,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.addCommodity'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'order/draft/:mode/:orderId',
|
|
|
|
hidden: true,
|
|
|
|
component: OrderDraft,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.addOrder'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'author/manage/rules',
|
|
|
|
hidden: true,
|
|
|
|
component: AuthorDraft,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.addCoursePermissions'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'transfer/detail/:permissionId',
|
|
|
|
component: PermissionDetail,
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'transfer/package',
|
|
|
|
component: PermissionDraft,
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'transfer/create',
|
|
|
|
component: PermissionCreate,
|
|
|
|
hidden: true
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2019-10-30 13:58:34 +08:00
|
|
|
{ // 系统管理
|
2019-10-29 13:15:57 +08:00
|
|
|
path: '/system',
|
|
|
|
component: Layout,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.systemManage',
|
2019-11-14 16:31:31 +08:00
|
|
|
roles: [admin]
|
2019-10-29 13:15:57 +08:00
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'ibp/edit',
|
2019-10-31 15:43:37 +08:00
|
|
|
component: IbpDraw,
|
2019-10-29 13:15:57 +08:00
|
|
|
meta: {
|
|
|
|
i18n: 'router.ibpDraw'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'dictionary',
|
|
|
|
component: Dictionary,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.dataDictionary'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'dictionary/detail',
|
|
|
|
hidden: true,
|
|
|
|
component: DictionaryDetail,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.dataDictionaryDetails'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2019-11-01 15:12:00 +08:00
|
|
|
// 用户管理
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'userManage',
|
|
|
|
component: UserControl,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.userManage'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2019-11-01 15:12:00 +08:00
|
|
|
// 缓存管理
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'cache',
|
|
|
|
component: CacheControl,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.cacheManage'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'userTrainingManage',
|
|
|
|
component: UserTraining,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.userTrainingManage'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'userExamManage',
|
|
|
|
component: UserExam,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.userExamManage'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'userSimulationManage',
|
|
|
|
component: UserSimulation,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.userSimulationManage'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'existingSimulation',
|
|
|
|
component: ExistingSimulation,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.existingSimulation'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2019-11-01 15:12:00 +08:00
|
|
|
// 子系统生成
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'systemGenerate',
|
|
|
|
component: SystemGenerate,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.subsystemGeneration'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2019-11-01 15:12:00 +08:00
|
|
|
// 产品编辑
|
2019-10-29 13:15:57 +08:00
|
|
|
path: 'product',
|
|
|
|
component: MapProduct,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.productEdit'
|
|
|
|
}
|
|
|
|
},
|
2019-11-15 16:31:48 +08:00
|
|
|
{ // 消息公告
|
2019-11-05 16:40:36 +08:00
|
|
|
path: 'news',
|
|
|
|
component: News,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.newsBulletin'
|
|
|
|
}
|
2019-11-15 16:31:48 +08:00
|
|
|
},
|
|
|
|
{ // 命令管理
|
|
|
|
path: 'commands',
|
|
|
|
component: CommandDictionary,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.commandDictionary'
|
|
|
|
}
|
2019-10-29 13:15:57 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2019-10-30 13:58:34 +08:00
|
|
|
{ // 发布申请
|
2019-10-29 13:15:57 +08:00
|
|
|
path: '/apply',
|
|
|
|
component: Layout,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.releaseApplication',
|
2019-11-14 16:31:31 +08:00
|
|
|
roles: [admin]
|
2019-10-29 13:15:57 +08:00
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'lesson',
|
|
|
|
component: LessonApproval,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.courseApplication'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'script',
|
|
|
|
component: ScriptApproval,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.scriptReleaseApplication'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'runGraph',
|
|
|
|
component: RunPlanApproval,
|
|
|
|
meta: {
|
|
|
|
i18n: 'router.runGraphReleaseApplication'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2019-07-04 10:59:40 +08:00
|
|
|
];
|
2019-07-02 16:29:52 +08:00
|
|
|
|
|
|
|
const createRouter = () => new Router({
|
2019-10-29 13:15:57 +08:00
|
|
|
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) => {
|
2019-10-29 13:15:57 +08:00
|
|
|
const project = getSessionStorage('project');
|
2019-11-14 13:59:33 +08:00
|
|
|
document.title = loginInfo[project || 'login'].title;
|
2019-10-29 13:15:57 +08:00
|
|
|
next();
|
2019-08-09 15:10:13 +08:00
|
|
|
});
|
|
|
|
|
2019-07-04 10:59:40 +08:00
|
|
|
export default router;
|