فهرست منبع

选择题考试 状态更新

dengshaobo 1 ماه پیش
والد
کامیت
bce2ecac57

+ 10 - 0
src/api/exam.ts

@@ -429,4 +429,14 @@ export const recognizeAgain= (data:any):Promise<ApiResponse> => {
     method: 'post',
     data
   })
+}
+
+
+// 47. 扫描学生 获取考试流程步骤
+export const getExamProcess= (data:any):Promise<ApiResponse> => {
+  return request({
+    url: '/api/v1/ai_exam_step/find_ai_exam_step',
+    method: 'get',
+    params: data
+  })
 }

+ 8 - 6
src/components/AddExam.vue

@@ -6,19 +6,19 @@
     class="page_dialog"
     :before-close="handleClose"
   >
-    <el-form ref="formRef"   :model="formData"  :rules="rules"  label-width="100px">
-      <el-form-item label="考试名称:" prop="examSubjectName">
+    <el-form ref="formRef"   :model="formData"  :rules="rules"  label-width="105px">
+      <el-form-item label="考试名称" prop="examSubjectName">
         <el-input v-model="formData.examSubjectName" placeholder="请输入考试名称" style="width: 300px;"/>
       </el-form-item>
       
-      <el-form-item label="考试年级:" prop="gradeCode">
-        <el-radio-group v-model="formData.gradeCode" @change="HandleGradeChange">
+      <el-form-item label="考试年级" prop="gradeCode">
+        <el-radio-group v-model="formData.gradeCode" @change="HandleGradeChange" :disabled="formData.canDelete==0">
           <el-radio :value="grade.gradeCode"  v-for="grade in gradeList">{{grade.gradeName}}</el-radio>
 
         </el-radio-group>
       </el-form-item>
-      <el-form-item label="考试科目:" prop="courseCode">
-        <el-radio-group v-model="formData.courseCode" @change="HandleCourseChange">
+      <el-form-item label="考试科目" prop="courseCode">
+        <el-radio-group v-model="formData.courseCode" @change="HandleCourseChange" :disabled="formData.canDelete==0">
           <el-radio :value="subject.courseCode"  v-for="subject in subjectList">{{subject.courseName}}</el-radio>
         </el-radio-group>
       </el-form-item>
@@ -65,6 +65,7 @@ const subjectList=ref<any[]>([]);
 // 表单数据
 const formData = reactive({
     id:'',//考试科目列表id 不为空表示修改
+    canDelete:1,//是否可删除 0-否 1-是
     schoolYearId:'',//学年id
     schoolYearGradeId:'',//学年表id
     schoolYearCode:'',//学年code
@@ -85,6 +86,7 @@ const ResetForm = () => {
   Object.assign(formData, {
     id:'',//考试科目列表id 不为空表示修改
     schoolYearId:'',//学年id
+    canDelete:1,//是否可删除 0-否 1-是
     schoolYearGradeId:'',//学年表id
     schoolYearCode:'',//学年code
     levelCode:'',//学段code

+ 10 - 0
src/store/exam.ts

@@ -38,6 +38,9 @@ export const useExamStore = defineStore('exam', () => {
     const abnormalNum=ref(0);//异常人数
     const scannedNum=ref(0);//已上传人数
 
+    const examStateStr=ref('');//考试状态
+
+    //设置考试信息
     const setExamInfoCount = (info: any) => {
 
         unScanned.value = info.unScanned;
@@ -47,6 +50,11 @@ export const useExamStore = defineStore('exam', () => {
         localStorage.setItem('current_exam_info_count', JSON.stringify(info));//当前考试异常数据信息
     }
 
+    //设置考试状态
+    const setExamState = (info: string) => {
+        examStateStr.value = info;
+        localStorage.setItem('current_exam_state', JSON.stringify(info));//当前考试状态
+    }
 
 
 
@@ -64,6 +72,8 @@ export const useExamStore = defineStore('exam', () => {
     setExamInfo,
     clearExamInfo,
     setExamInfoCount,
+    setExamState,
+    examStateStr,
     unScanned,
     examMissNum,
     abnormalNum,

+ 1 - 1
src/styles/common.scss

@@ -641,7 +641,7 @@ body {
           background-image: url('../assets/icon/scan_set_icon.png');
           background-size: 16px 16px;
           background-repeat: no-repeat;
-          background-position: 5px 50%;
+          background-position: 15px 50%;
           text-align: right;
           cursor: pointer;
       }

+ 3 - 2
src/views/choice/index.vue

@@ -52,10 +52,11 @@
         <div class="item_right">
           <div class="ele_button right_button">
             
-            <span @click="OpenDeleteExam(exam)" class="btn_delete" v-if="exam.canDelete==1">删除</span>
-            <span class="btn_disabled" v-else>删除</span>
+            
             <span @click="OpenEditorExam(exam)" class="btn_editor">编辑</span>
             <span @click="GotoExam(exam)" class="btn_editor">进入考试</span>
+            <span @click="OpenDeleteExam(exam)" class="btn_delete" v-if="exam.canDelete==1">删除</span>
+            <span class="btn_disabled" v-else>删除</span>
           </div>
         </div>
       </div>

+ 2 - 1
src/views/exam/components/selectStudent.vue

@@ -43,6 +43,7 @@ const examStore = useExamStore()
 // 定义 Props 和 Emits
 const props = defineProps<{
   modelValue: boolean,
+  reuse: number//是否是重新使用名单 0-否 1-是
 
 }>()
 
@@ -140,7 +141,7 @@ const HandleSubmit= () => {
   const params={
     examSubjectId:examSubjectId.value,
     classIds:selectedIds,
-    reuse:0,//是否是重新使用名单 0-否 1-是
+    reuse:props.reuse,//是否是重新使用名单 0-否 1-是
     schoolId:0,//学校id
   };
   loading.value=true;

+ 52 - 34
src/views/exam/components/stepItem.vue

@@ -4,7 +4,9 @@
     <div class="step_item" v-for="(item, index) in menuList" :key="index"  :class="activeIndex==index?(activeIndex==2?'active_score':'active'):''">
       <div class="step_title" @click="MenuChange(index, item)">
         <div class="num_box">
-          <span v-if="item.status === 1" class="el-icon-success"></span>
+          <span v-if="item.status === 1" class="icon_success">
+            <el-icon><Check /></el-icon>
+          </span>
           <span v-else class="step_num">{{ index + 1 }}</span>
         </div>
         <span>{{ item.name }}</span>
@@ -27,6 +29,7 @@ import { useRoute, useRouter } from 'vue-router'
 import { useExamStore } from '@/store/exam'
 import { useAnalysisStore } from '@/store/analysis'
 import { queryQuestionGroupByAiId } from '@/api/analysis'
+import {getExamProcess } from '@/api/exam'
 
 const examStore = useExamStore()
 const analysisStore = useAnalysisStore()
@@ -50,7 +53,7 @@ const examSubjectId = computed(() => {
 // 2. 考试状态字符串
 const examStateStr = computed(() => {
   // 替换为: return makeTemplateStore.examStateStr
-  return examStore.currentExam?.examStateStr
+  return examStore.examStateStr
 })
 
 // 3. 考试类型 1 选择题 2 填空题 3 Ai作文
@@ -72,7 +75,7 @@ const menuList = computed(() => {
     //选择题判分
     if(stepFlow.value < 2){
       list = [
-        { name: '试题结构', number: '1', path: 'question', desc: '建立考试试题结构、设置标答、分组等信息', status: 0 },
+        { name: '试题结构', number: '1', path: 'question', desc: '建立考试试题结构、设置标答、分组等信息', status:0 },
         { name: '扫描学生', number: '2', path: 'scanList', desc: '扫描学生,处理扫描异常学生等', status: 0 },
       ];
     }else{
@@ -121,19 +124,18 @@ const menuList = computed(() => {
 
   }
   
- 
 
-  
 
-  // // 更新状态
-  // const stateStr = String(examStateStr.value || '')
-  // list.forEach((item) => {
-  //   if (stateStr.includes(item.number)) {
-  //     item.status = 1
-  //   } else {
-  //     item.status = 0
-  //   }
-  // })
+  // 更新状态
+  const stateStr = String(examStateStr.value || '')
+  console.log('打印菜单stateStr', examStateStr.value)
+  list.forEach((item) => {
+    if (stateStr.includes(item.number)) {
+      item.status = 1
+    } else {
+      item.status = 0
+    }
+  })
 
   return list
 })
@@ -158,16 +160,14 @@ const activeIndex = computed(() => {
 // --- 方法 ---
 
 // 获取模板数据
-const GetThirdCardData = () => {
+const GetExamProcess = () => {
   if (!examSubjectId.value) return
 
   const param = {
     examSubjectId: examSubjectId.value
   }
-  
-  // 假设 $api 已全局挂载或在 utils 中引入
-  // import { examApi } from '@/api/exam'
-  ;(window as any).$api?.exam.getExamThirdCardData(param).then((res: any) => {
+  //获取考试流程状态
+  getExamProcess(param).then((res: any) => {
     console.log('获取模板相关数据 包含第三方卡和系统卡', res)
     if (res.code === 200) {
       localStorage.setItem('templateData', JSON.stringify(res.data.examCardPageVOS))
@@ -181,22 +181,25 @@ const GetThirdCardData = () => {
   })
 }
 
-// // 获取考试流程状态
-// const GetExamState = () => {
-//   const param = {
-//     examSubjectId: route.query.id
-//   }
+// 获取考试流程状态
+const GetExamState = () => {
+  const param = {
+    examSubjectId:examSubjectId.value
+  }
   
-//   ;(window as any).$api?.reviewBlock.getExamFlowStatus(param).then((res: any) => {
-//     console.log('打印考试流程状态返回', res)
-//     if (res.code === 200) {
-//       const newStateStr = res.data.finished.join(',')
-//       // 替换为 Store Commit/Action
-//       // makeTemplateStore.setExamStateStr(newStateStr)
-//       console.warn('请在此处调用 Store 的 action 更新 examStateStr')
-//     }
-//   })
-// }
+  getExamProcess(param).then((res: any) => {
+    console.log('打印考试流程状态返回', res)
+    if (res.code === 200) {
+      const newStateStr = res.data;
+      console.log('打印考试流程状态', newStateStr)
+      // 替换为 Store Commit/Action
+      examStore.setExamState(newStateStr);//设置状态数据
+      
+      // makeTemplateStore.setExamStateStr(newStateStr)
+      console.warn('请在此处调用 Store 的 action 更新 examStateStr')
+    }
+  })
+}
 
 // 菜单点击事件
 const MenuChange = (index: number, item: any) => {
@@ -238,6 +241,8 @@ onMounted(async () => {
     stepOnIndex.value = 0
    
   }
+  GetExamState()//获取流程状态
+
   const res = await queryQuestionGroupByAiId(examSubjectId.value)
   if (res.code === 200) {
     analysisStore.setIsShowGroupAnalysis(true);
@@ -287,8 +292,21 @@ onMounted(async () => {
       justify-content: center;
       align-items: center;
 
+      .icon_success
+      {
+        width:16px;
+        height:16px;
+        background: #15BC83;
+        border-radius: 50%;
+        color:#fff;
+        font-size: 16px;
+        text-align: center;
+        line-height: 16px;
+      }
+
       .el-icon-success::before {
         font-size: 19px;
+        color:red;
       }
     }
     .step_num {

+ 25 - 0
src/views/exam/examList.vue

@@ -219,7 +219,32 @@ const GoSearch=()=>{
 //重新导入名单
 const BackToTemplate =() =>
 {
+    
 
+    ElMessageBox.confirm('确认重新导入名单吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+        customClass: 'page_dialog',
+    }).then(() => {
+        router.push({
+            path: '/exam/selectExamination',
+            query: {
+                id: examSubjectId.value,
+                reuse: 1,
+                // schoolId: selectSchoolId.value,
+            }
+        })
+
+        // router.push({
+        //     path: '/exam/selectExamination',
+        //     query: {
+        //         examSubjectId: examSubjectId.value,
+        //     },
+        // });
+    }).catch(() => {
+        // 用户取消操作
+    })
 }
 
 //导出学生名单

+ 14 - 7
src/views/exam/scanDetail.vue

@@ -5,11 +5,11 @@
     <div class="search_content">
         <div class="content_left">
             <el-select  v-model="paramInfo.batchNo"   placeholder="选择批次" @change="GoSearch()" class="select_width" >
-                <el-option label="全部批次" value=""></el-option>
+                <el-option label="全部批次" value="all"></el-option>
                 <el-option v-for="item in batchList" :key="item.value"  :label="'批次'+item.label" :value="item.value"></el-option>
             </el-select>
             <el-select  v-model="paramInfo.statusStr"   placeholder="选择状态" @change="GoSearch()" class="select_width" >
-                <el-option label="全部状态" value=""></el-option>
+                <el-option label="全部状态" value="all"></el-option>
                 <el-option v-for="item in stateList"
                 :key="item.value"
                 :label="item.label" :value="item.value"></el-option>
@@ -18,7 +18,7 @@
                 <el-button @click="GoSearch()"  slot="append" icon="el-icon-search"></el-button>
             </el-input>
         </div>
-        <div class="content_right">
+        <div class="content_right el_button">
             <el-button @click="Refresh" >
                 <i class="iconfont icon_shuaxin"></i>刷新
             </el-button>
@@ -155,8 +155,8 @@ const examSubjectId = computed(() => {
 })//计算属性
 
 const paramInfo=ref({
-    batchNo:'',
-    statusStr:'',//状态
+    batchNo:'all',
+    statusStr:'all',//状态
     keyWord:''
 })//筛选数据
 const pageInfo=ref({
@@ -360,6 +360,8 @@ const HandlePageChange=(page:number)=>{
 //搜索
 const GoSearch = () => { 
 
+    console.log("打印搜索条件",paramInfo.value);
+    GetScanDetailList();
 }
 
 //刷新
@@ -390,8 +392,8 @@ const CalculateTableHeight = () => {
 const GetScanDetailList = async () => {
     const params = {
       examSubjectId: examSubjectId.value,
-      batchNo:paramInfo.value.batchNo,//批次号
-      statusStr:paramInfo.value.statusStr,//状态
+      batchNo: paramInfo.value.batchNo === 'all' ? '' : paramInfo.value.batchNo,//批次号
+      statusStr: paramInfo.value.statusStr === 'all' ? '' : paramInfo.value.statusStr,//状态
       nameCode:paramInfo.value.keyWord,//搜索条件 姓名 考号
       schoolId: 0,//单校 0 
       pageNum:pageInfo.value.pageNum,//当前页码
@@ -442,8 +444,13 @@ const GetScanDetailImage = async () => {
 onMounted(() => {
 
     // 3. 获取地址栏参数 batchNo 并赋值
+    // if (route.query.batchNo) {
+    //     paramInfo.value.batchNo = route.query.batchNo as string;
+    // }
     if (route.query.batchNo) {
         paramInfo.value.batchNo = route.query.batchNo as string;
+    }else {
+        paramInfo.value.batchNo = 'all';
     }
     
     LoadData();//加载数据

+ 4 - 4
src/views/exam/scanList.vue

@@ -93,13 +93,13 @@
         </div>
         <div class="content_right">
             <div class="right_header">
-               <div class="scan_set scan_state_title" @click="OpenNumberSet()"> <span>考号设置</span></div>
+               <div class="scan_set scan_state_title" @click="OpenNumberSet()"> 考号设置</div>
                <div class="scan_set_scan_code">
     
-                    <el-select style="width: 100px;margin-right: 6px;" v-model="useDriveUI" placeholder="是否显示驱动弹窗" @change="ChangeDriveUI">
+                    <!-- <el-select style="width: 100px;margin-right: 6px;" v-model="useDriveUI" placeholder="是否显示驱动弹窗" @change="ChangeDriveUI">
                         <el-option v-for="item in scanTypeList" :key="item.value" :label="item.label" :value="item.value"></el-option>
-                    </el-select>
-                    <!-- 识别号: -->
+                    </el-select> -->
+                    识别号:
                     <el-select style="width: 100px;margin-right: 6px;" v-model="scanIdentifyCode" placeholder="选择识别号" @change="ChangeCode" >
                         <el-option v-for="item in scanIdentifyList" :key="item.value" :label="item.label" :value="item.value"></el-option>
                     </el-select>

+ 6 - 1
src/views/exam/selectExamination.vue

@@ -68,7 +68,7 @@
           </div>
         </div>
       </div>
-      <SelectStudent v-model="showSelectStudent"  @success="StudentSuccess"></SelectStudent>
+      <SelectStudent v-model="showSelectStudent" :reuse="reuse"  @success="StudentSuccess"></SelectStudent>
       <!-- <SelectHistoryList ref="selectHistoryListRef" @GoToScanExamHome="GoToScanExamHome" typeValue="1" :schoolId="selectSchoolId" v-if="showHistoryList" @historyCancel="CancelHistoryDialog"></SelectHistoryList>
       <DialogSystemQuery ref="selectSystemListRef" @GoToScanExamHome="GoToScanExamHome" :schoolId="selectSchoolId" v-if="showSystemList" @sysCancel="CancelSystemDialog"></DialogSystemQuery> -->
     </div>
@@ -96,6 +96,7 @@ const uploadText = ref('立即上传')
 const uploadRef = ref<HTMLInputElement | null>(null)
 const showSelectStudent = ref(false);
 const selectSystemListRef = ref<any>(null)
+const reuse=ref(0);//是否重新使用名单 0 否 1是
 
 // 计算属性
 const examSubjectId = computed(() => {
@@ -285,6 +286,10 @@ onMounted(() => {
       selectSchoolId.value = route.query.schoolId as string
     }
   }
+  if(route.query.reuse)
+  {
+    reuse.value = Number(route.query.reuse);
+  }
   
   GetExamSchoolList()
 })

+ 8 - 8
src/views/layout/components/header.vue

@@ -87,14 +87,14 @@ const menuList=ref([
     menuName: '选择题智能批阅',
     externalLink: '/main/choice'
   },
-  {
-    menuName: '填空题AI批阅',
-    externalLink: '/main/fillblank'
-  },
-  {
-    menuName: '作文题A批阅',
-    externalLink: '/main/essay'
-  },
+  // {
+  //   menuName: '填空题AI批阅',
+  //   externalLink: '/main/fillblank'
+  // },
+  // {
+  //   menuName: '作文题AI批阅',
+  //   externalLink: '/main/essay'
+  // },
 ])
 // 使用计算属性根据当前路由自动设置激活菜单
 const activeMenuName = computed(() => {