import Vue from 'vue' import Router from 'vue-router' import Layout from '@/layout' Vue.use(Router) const constantRoutes = [ { path: '/redirect', component: Layout, hidden: true, children: [ { path: '/redirect/:path*', component: () => import('@/views/redirect/index') } ] }, { path: '/login', name: 'Login', hidden: true, component: () => import('@/views/login/index'), meta: { title: '登录' } }, { path: '/', component: Layout, redirect: '/login', children: [ { path: 'dashboard', component: () => import('@/views/dashboard/index'), name: 'Dashboard', meta: { title: '主页', icon: 'home', affix: true } } ] }, { path: '/user', component: Layout, name: 'UserPage', meta: { title: '用户管理', icon: 'users' }, children: [ { path: 'student/list', component: () => import('@/views/user/student/list'), name: 'UserStudentPageList', meta: { title: '学生列表', noCache: false } }, { path: 'student/edit', component: () => import('@/views/user/student/edit'), name: 'UserStudentEdit', meta: { title: '学生编辑', noCache: true, activeMenu: '/user/student/list' }, hidden: true }, { path: 'admin/list', component: () => import('@/views/user/admin/list'), name: 'UserAdminPageList', meta: { title: '管理员列表', noCache: true } }, { path: 'admin/edit', component: () => import('@/views/user/admin/edit'), name: 'UserAdminEdit', meta: { title: '管理员编辑', noCache: true, activeMenu: '/user/admin/list' }, hidden: true }, { path: 'departmentExamine/list', component: () => import('@/views/user/departmentExamine/list'), name: 'departmentExamineList', meta: { title: '调动审核', noCache: true } }, { path: 'UserConditionExamine/list', component: () => import('@/views/user/UserConditionExamine/list'), name: 'UserConditionExamineList', meta: { title: '状态审核', noCache: true } }, { path: 'tag/list', component: () => import('@/views/user/tag/list'), name: 'TagAdminPageList', meta: { title: '学生标签', noCache: true } }, { path: 'tag/edit', component: () => import('@/views/user/tag/edit'), name: 'TagAdminEdit', meta: { title: '标签编辑', noCache: true, activeMenu: '/user/tag/list' }, hidden: true } ] }, { path: '/education', component: Layout, name: 'EducationPage', meta: { title: '部门管理', icon: 'education' }, alwaysShow: true, children: [ { path: 'subject/list', component: () => import('@/views/education/subject/list'), name: 'EducationSubjectPage', meta: { title: '部门课目', noCache: true } }, { path: 'subject/manager', hidden: true, component: () => import('@/views/education/subject/manager'), name: 'SubjectManager', meta: { title: '课目管理', noCache: true } }, { path: 'department/list', component: () => import('@/views/education/department/list'), name: 'EducationDepartmentPage', meta: { title: '部门列表', noCache: true } }, { path: 'subject/edit', component: () => import('@/views/education/subject/edit'), name: 'EducationSubjectEditPage', meta: { title: '课目编辑', noCache: true, activeMenu: '/education/subject/list' }, hidden: true }, { path: 'department/edit', component: () => import('@/views/education/department/edit'), name: 'EducationSubjectEditPage', meta: { title: '部门编辑', noCache: true, activeMenu: '/education/department/list' }, hidden: true } ] }, { path: '/exam', component: Layout, name: 'ExamPage', meta: { title: '卷题管理', icon: 'exam' }, children: [ { path: 'paper/list', component: () => import('@/views/exam/paper/list'), name: 'ExamPaperPageList', meta: { title: '试卷列表', noCache: true } }, { path: 'paper/edit', component: () => import('@/views/exam/paper/edit'), name: 'ExamPaperEdit', meta: { title: '试卷编辑', noCache: true, activeMenu: '/exam/paper/list' }, hidden: true }, { path: 'question/list', component: () => import('@/views/exam/question/list'), name: 'ExamQuestionPageList', meta: { title: '题目列表', noCache: true } }, { path: 'question/edit/singleChoice', component: () => import('@/views/exam/question/edit/single-choice'), name: 'singleChoicePage', meta: { title: '单选题编辑', noCache: true, activeMenu: '/exam/question/list' }, hidden: true }, // { // path: 'simulation/list', // component: () => import('@/views/exam/simulation/list'), // name: 'personalSimulationList', // meta: { title: '模拟列表', noCache: true } // }, // { // path: 'personalSimulation/list', // component: () => import('@/views/exam/personalSimulation/list'), // name: 'personalSimulation', // meta: { title: '个人模拟', noCache: true } // }, { path: 'personalRandomTemplate/list', component: () => import('@/views/exam/personalRandomTemplate/list'), name: 'personalSimulation', meta: { title: '随机试卷', noCache: true } }, { path: 'personalRandomTemplate/config', component: () => import('@/views/exam/personalRandomTemplate/config'), name: 'personalSimulationConfig', meta: { title: '随机试卷配置', noCache: true } }, { path: 'personalRandomTemplate/edit', component: () => import('@/views/exam/personalRandomTemplate/edit'), name: 'personalSimulationEdit', meta: { title: '随机试卷', noCache: true, activeMenu: '/exam/personalRandomTemplate/list' }, hidden: true }, { path: 'personalSimulation/edit', component: () => import('@/views/exam/personalSimulation/edit'), name: 'personalSimulationEdit', meta: { title: '试卷编辑', noCache: true, activeMenu: '/exam/personalSimulation/list' }, hidden: true }, { path: 'feedback/list', component: () => import('@/views/feedback/list'), name: 'feedback', meta: { title: '错题反馈', noCache: true } }, // { // path: 'personalSimulation/list/mathList', // component: () => import('@/views/exam/mathList/list.vue'), // name: 'multiplemathList', // meta: { title: '模拟列表详情', noCache: true, activeMenu: '/exam/mathList/list' }, // hidden: true // }, { path: 'question/edit/multipleChoice', component: () => import('@/views/exam/question/edit/multiple-choice'), name: 'multipleChoicePage', meta: { title: '多选题编辑', noCache: true, activeMenu: '/exam/question/list' }, hidden: true }, { path: 'question/edit/trueFalse', component: () => import('@/views/exam/question/edit/true-false'), name: 'trueFalsePage', meta: { title: '判断题编辑', noCache: true, activeMenu: '/exam/question/list' }, hidden: true }, { path: 'question/edit/gapFilling', component: () => import('@/views/exam/question/edit/gap-filling'), name: 'gapFillingPage', meta: { title: '填空题编辑', noCache: true, activeMenu: '/exam/question/list' }, hidden: true }, { path: 'question/edit/shortAnswer', component: () => import('@/views/exam/question/edit/short-answer'), name: 'shortAnswerPage', meta: { title: '简答题编辑', noCache: true, activeMenu: '/exam/question/list' }, hidden: true } ] }, { path: '/answer', component: Layout, name: 'AnswerPage', meta: { title: '成绩管理', icon: 'answer' }, alwaysShow: true, children: [ { path: 'list', component: () => import('@/views/answer/list'), name: 'AnswerPageList', meta: { title: '答卷记录', noCache: true } }, { path: 'sheetStatistics', component: () => import('@/views/answer/sheetStatistics.vue'), name: 'AnswerPageList', meta: { title: '分数统计', noCache: true } }, { path: 'dataStatistics', component: () => import('@/views/answer/dataStatistics.vue'), name: 'AnswerPageList', meta: { title: '分数统计(全)', noCache: true } }, { path: 'achievementStatistics', component: () => import('@/views/answer/achievementStatistics.vue'), name: 'AnswerPageList', meta: { title: '成绩统计', noCache: true } }, { path: 'achievementStatistics/gradeDetails', component: () => import('@/views/exam/gradeDetails/list.vue'), name: 'AnswerPageList', meta: { title: '成绩统计详情', noCache: true, activeMenu: '/exam/gradeDetails/list' }, hidden: true } ] }, { path: '/online/study', component: Layout, name: 'OnLineStudy', meta: { title: '在线学习', icon: 'exam' }, alwaysShow: true, children: [ { path: 'type', component: () => import('@/views/onlineStudy/type'), name: 'Type', meta: { title: '学习类型', noCache: true } }, { path: 'file', component: () => import('@/views/onlineStudy/file'), name: 'File', meta: { title: '学习文件', noCache: true } } ] }, { path: '/questionAnswer', component: Layout, name: 'questionAnswerPage', meta: { title: '问答管理', icon: 'question' }, alwaysShow: true, children: [ { path: '/list', component: () => import('@/views/questionAnswer/list'), name: 'questionAnswerPage', meta: { title: '问答列表', noCache: true } }, { path: '/edit', component: () => import('@/views/questionAnswer/edit'), name: 'questionAnswerEdit', meta: { title: '问答编辑', noCache: true, activeMenu: '/questionAnswer/list' }, hidden: true } ] }, { path: '/task', component: Layout, name: 'TaskPage', meta: { title: '任务管理', icon: 'task' }, alwaysShow: true, children: [ { path: 'list', component: () => import('@/views/task/list'), name: 'TaskListPage', meta: { title: '任务列表', noCache: true } }, { path: 'edit', component: () => import('@/views/task/edit'), name: 'TaskEditPage', meta: { title: '任务创建', noCache: true } } ] }, // { // path: '/message', // component: Layout, // name: 'MessagePage', // meta: { // title: '消息中心', // icon: 'message' // }, // alwaysShow: true, // children: [ // { // path: 'list', // component: () => import('@/views/message/list'), // name: 'MessageListPage', // meta: { title: '消息列表', noCache: true } // }, // { // path: 'send', // component: () => import('@/views/message/send'), // name: 'MessageSendPage', // meta: { title: '消息发送', noCache: true } // } // ] // }, // { // path: '/log', // component: Layout, // name: 'LogPage', // meta: { // title: '日志中心', // icon: 'log' // }, // alwaysShow: true, // children: [ // { // path: 'user/list', // component: () => import('@/views/log/list'), // name: 'LogUserPage', // meta: { title: '用户日志', noCache: true } // } // ] // }, // { // path: '/meeting', // component: Layout, // name: 'MeetingPage', // meta: { // title: '在线会议', // icon: 'log' // }, // alwaysShow: true, // children: [ // { // path: 'meeting/index', // component: () => import('@/views/meeting/list'), // name: 'MeetingUserPage', // meta: { title: '在线会议', noCache: true } // } // ] // }, { path: '/profile', component: Layout, hidden: true, children: [ { path: 'index', component: () => import('@/views/profile/index'), name: 'Profile', meta: { title: '个人简介', icon: 'user', noCache: true } } ] }, { path: '*', hidden: true, component: () => import('@/views/error-page/404'), meta: { title: '404', noCache: true } } ] const deptAdminRoutes = [ { path: '/redirect', component: Layout, hidden: true, children: [ { path: '/redirect/:path*', component: () => import('@/views/redirect/index') } ] }, { path: '/login', name: 'Login', hidden: true, component: () => import('@/views/login/index'), meta: { title: '登录' } }, { path: '/', component: Layout, redirect: '/login', children: [ { path: 'dashboard', component: () => import('@/views/dashboard/index'), name: 'Dashboard', meta: { title: '主页', icon: 'home', affix: true } } ] }, { path: '/user', component: Layout, name: 'UserPage', meta: { title: '用户管理', icon: 'users' }, alwaysShow: true, children: [ { path: 'student/list', component: () => import('@/views/user/student/list'), name: 'UserStudentPageList', meta: { title: '学生列表', noCache: true } }, // { // path: 'tag/list', // component: () => import('@/views/user/tag/list'), // name: 'TagAdminPageList', // meta: { title: '学生标签', noCache: true } // }, { path: 'departmentExamine/list', component: () => import('@/views/user/departmentExamine/list'), name: 'departmentExamineList', meta: { title: '调动提审记录', noCache: true } }, { path: 'UserConditionExamine/list', component: () => import('@/views/user/UserConditionExamine/list'), name: 'UserConditionExamineList', meta: { title: '状态提审记录', noCache: true } }, ] }, { path: '/exam', component: Layout, name: 'ExamPage', meta: { title: '卷题管理', icon: 'exam' }, alwaysShow: true, children: [ // { // path: 'paper/list', // component: () => import('@/views/exam/paper/list'), // name: 'ExamPaperPageList', // meta: { title: '试卷列表', noCache: true } // }, // { // path: 'paper/edit', // component: () => import('@/views/exam/paper/edit'), // name: 'ExamPaperEdit', // meta: { title: '试卷编辑', noCache: true, activeMenu: '/exam/paper/list' }, // hidden: true // }, { path: 'personalRandomTemplate/list', component: () => import('@/views/exam/personalRandomTemplate/list'), name: 'personalSimulation', meta: { title: '随机试卷', noCache: true } }, { path: 'personalRandomTemplate/edit', component: () => import('@/views/exam/personalRandomTemplate/edit'), name: 'personalSimulationEdit', meta: { title: '随机试卷', noCache: true, activeMenu: '/exam/personalRandomTemplate/list' }, hidden: true }, { path: 'personalSimulation/edit', component: () => import('@/views/exam/personalSimulation/edit'), name: 'personalSimulationEdit', meta: { title: '试卷编辑', noCache: true, activeMenu: '/exam/personalSimulation/list' }, hidden: true } ] }, { path: '/answer', component: Layout, name: 'AnswerPage', meta: { title: '成绩管理', icon: 'answer' }, alwaysShow: true, children: [ { path: 'achievementStatistics', component: () => import('@/views/answer/achievementStatistics.vue'), name: 'AnswerPageList', meta: { title: '成绩统计', noCache: true } }, { path: 'achievementStatistics/gradeDetails', component: () => import('@/views/exam/gradeDetails/list.vue'), name: 'AnswerPageList', meta: { title: '成绩统计详情', noCache: true, activeMenu: '/exam/gradeDetails/list' }, hidden: true }, { path: 'sheetStatistics', component: () => import('@/views/answer/sheetStatistics.vue'), name: 'AnswerPageList', meta: { title: '分数统计', noCache: true } }, ] }, { path: '/profile', component: Layout, hidden: true, children: [ { path: 'index', component: () => import('@/views/profile/index'), name: 'Profile', meta: { title: '个人简介', icon: 'user', noCache: true } } ] }, { path: '*', hidden: true, component: () => import('@/views/error-page/404'), meta: { title: '404', noCache: true } } ] const router = new Router({ routes: constantRoutes }) export { constantRoutes, router, deptAdminRoutes }