Преглед на файлове

增加成绩分析子菜单路由

dengshaobo преди 2 седмици
родител
ревизия
ec5f69cc36
променени са 4 файла, в които са добавени 71 реда и са изтрити 8 реда
  1. 1 1
      src/api/login.ts
  2. 41 1
      src/router/index.ts
  3. 26 0
      src/views/analysis/errorAnalysis.vue
  4. 3 6
      src/views/exam/components/stepItem.vue

+ 1 - 1
src/api/login.ts

@@ -1,4 +1,4 @@
-// src/api/login.ts
+// src/api/login.ts  用户以及登录相关的接口
 import request from '../utils/request.ts'
 import type { ApiResponse } from '@/types/types' // 引入类型
 // 登录接口

+ 41 - 1
src/router/index.ts

@@ -74,7 +74,47 @@ const routes: Array<RouteRecordRaw> = [
             path: 'score',
             name: 'score',
             component: () => import('@/views/analysis/score.vue')
-          }
+          },//成绩单
+          {
+            path: 'errorAnalysis',
+            name: 'errorAnalysis',
+            component: () => import('@/views/analysis/errorAnalysis.vue')
+          },//错题分析
+          {
+            path: 'optionDetail',
+            name: 'optionDetail',
+            component: () => import('@/views/analysis/score.vue')
+          },//选项明细
+          {
+            path: 'levelDistribution',
+            name: 'levelDistribution',
+            component: () => import('@/views/analysis/score.vue')
+          },//水平分布
+          {
+            path: 'classComparison',
+            name: 'classComparison',
+            component: () => import('@/views/analysis/score.vue')
+          },//班级对比
+          {
+            path: 'questionAnalysis',
+            name: 'questionAnalysis',
+            component: () => import('@/views/analysis/score.vue')
+          },//小题分析
+          {
+            path: 'groupAnalysis',
+            name: 'groupAnalysis',
+            component: () => import('@/views/analysis/score.vue')
+          },//分组分析
+          {
+            path: 'optionAnalysis',
+            name: 'optionAnalysis',
+            component: () => import('@/views/analysis/score.vue')
+          },//选项分析
+          {
+            path: 'propositionAnalysis',
+            name: 'propositionAnalysis',
+            component: () => import('@/views/analysis/score.vue')
+          },//命题分析
         ]
       },
     ]

+ 26 - 0
src/views/analysis/errorAnalysis.vue

@@ -0,0 +1,26 @@
+<template>
+    <!-- 成绩查询 成绩单 -->
+  <div >
+    
+  </div>
+</template>
+<script lang="ts" setup>
+import { useExamStore } from '@/store/exam'
+import { useRouter } from 'vue-router'
+import { onMounted ,ref} from 'vue';
+
+// 实例化 Store
+const examStore = useExamStore()
+const router = useRouter()
+
+
+onMounted(() => {
+  
+
+  
+})
+</script>
+ 
+<style lang="scss" scoped>
+
+</style>

+ 3 - 6
src/views/exam/components/stepItem.vue

@@ -189,18 +189,15 @@ const MenuSelect = (menu: any) => {
   console.log('选择的子菜单', menu)
   stepOnIndex.value = 2;
   childMenuPath.value = menu.path;
+  // 执行路由跳转
+  router.push(`/exam/analysis/${menu.path}`)
 }
 // --- 生命周期 & 监听 ---
 
 // 定义 emits
 const emit = defineEmits(['menuChange'])
 
-// 监听 examStateStr 变化,虽然 menuList 是 computed 会自动更新,
-// 但如果原逻辑中有副作用,可以保留 watch。
-// 注意:在 Vue3 computed 中直接修改返回对象的属性是不推荐的,
-// 原代码在 computed 中修改了 menuList 内部对象的 status,这在 Vue3 中可能导致警告。
-// 更好的做法是在 computed 中返回新对象,或者将 status 的计算逻辑完全放在 computed 内部(如上所示)。
-// 因此,下面的 watch 可能不再需要,因为 menuList computed 已经包含了 status 的逻辑。
+
 watch(examStateStr, (newVal) => {
   // 由于 menuList 是 computed 且依赖 examStateStr,它会自动重新计算
   // 如果这里有其他副作用,请保留