index.ts 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
  2. import type { RouteRecordRaw } from 'vue-router'
  3. import Layout from '@/views/layout/index.vue'
  4. // 示例路由配置
  5. const routes: Array<RouteRecordRaw> = [
  6. {
  7. path: '/',
  8. name: '',
  9. component: () => import('../views/login/login.vue')
  10. },
  11. {
  12. path: '/login',
  13. name: '',
  14. component: () => import('../views/login/login.vue')
  15. },
  16. {
  17. path: '/logins',
  18. name: 'Login',
  19. component: () => import('../views/login/login_other.vue')
  20. },//工作台三方跳转
  21. //主页面
  22. {
  23. path: '/main',
  24. name: 'main',
  25. component: Layout,
  26. children: [
  27. {
  28. path: 'choice',
  29. name: 'school',
  30. component: () => import('@/views/choice/index.vue')
  31. },
  32. {
  33. path: 'fillblank',
  34. name: 'manager',
  35. component: () => import('@/views/fillblank/index.vue')
  36. },
  37. {
  38. path: 'essay',
  39. name: 'essay',
  40. component: () => import('@/views/essay/index.vue')
  41. }
  42. ]
  43. },
  44. //考试详情页面
  45. {
  46. path: '/exam',
  47. name: 'exam',
  48. component: () => import('@/views/exam/index.vue'),
  49. children:[
  50. {
  51. path: 'question',
  52. name: 'question',
  53. component: () => import('@/views/exam/question.vue')
  54. },
  55. {
  56. path: 'scanList',
  57. name: 'scanList',
  58. component: () => import('@/views/exam/scanList.vue')
  59. },
  60. {
  61. path: 'scanDetail',
  62. name: 'scanDetail',
  63. component: () => import('@/views/exam/scanDetail.vue')
  64. },
  65. // {
  66. // path: 'selectExamination',
  67. // name: 'selectExamination',
  68. // component: () => import('@/views/exam/selectExamination.vue')
  69. // },
  70. {
  71. path: 'selectExamination',
  72. name: 'selectExamination',
  73. component: () => import('@/views/exam/selectStudent.vue')
  74. },
  75. {
  76. path: 'examList',
  77. name: 'examList',
  78. component: () => import('@/views/exam/examList.vue')
  79. },
  80. {
  81. path: 'analysis',
  82. name: 'analysis',
  83. component: () => import('@/views/analysis/index.vue'),
  84. redirect: 'score', // 默认跳转到 score
  85. children:[
  86. {
  87. path: 'score',
  88. name: 'score',
  89. component: () => import('@/views/analysis/score.vue')
  90. },//成绩单
  91. {
  92. path: 'errorAnalysis',
  93. name: 'errorAnalysis',
  94. component: () => import('@/views/analysis/errorAnalysis.vue')
  95. },//错题分析
  96. {
  97. path: 'optionDetail',
  98. name: 'optionDetail',
  99. component: () => import('@/views/analysis/optionDetail.vue')
  100. },//选项明细
  101. {
  102. path: 'levelDistribution',
  103. name: 'levelDistribution',
  104. component: () => import('@/views/analysis/levelDistribution.vue')
  105. },//水平分布
  106. {
  107. path: 'classComparison',
  108. name: 'classComparison',
  109. component: () => import('@/views/analysis/classComparison.vue')
  110. },//班级对比
  111. {
  112. path: 'questionAnalysis',
  113. name: 'questionAnalysis',
  114. component: () => import('@/views/analysis/questionAnalysis.vue')
  115. },//小题分析
  116. {
  117. path: 'groupAnalysis',
  118. name: 'groupAnalysis',
  119. component: () => import('@/views/analysis/groupAnalysis.vue')
  120. },//分组分析
  121. {
  122. path: 'optionAnalysis',
  123. name: 'optionAnalysis',
  124. component: () => import('@/views/analysis/optionAnalysis.vue')
  125. },//选项分析
  126. {
  127. path: 'propositionAnalysis',
  128. name: 'propositionAnalysis',
  129. component: () => import('@/views/analysis/propositionAnalysis.vue')
  130. },//命题分析
  131. ]
  132. },
  133. ]
  134. },
  135. {
  136. path: '/:pathMatch(.*)*', // 捕获所有未匹配路径
  137. name: 'NotFound',
  138. component: () => import('../views/login/login.vue') // 未匹配到路由跳转到登录页面
  139. }
  140. ]
  141. const router = createRouter({
  142. history: createWebHashHistory(),
  143. routes
  144. })
  145. export default router