Pārlūkot izejas kodu

列表图片预览更新 扫描设置更新 考号识别设置更新

dengshaobo 1 mēnesi atpakaļ
vecāks
revīzija
92ce42bb63

+ 27 - 0
src/api/exam.ts

@@ -344,4 +344,31 @@ export const finishScanned= (data:any):Promise<ApiResponse> => {
     method: 'post',
     data ,
   })
+}
+
+// 38 扫描学生 设置扫描弹窗设置
+export const setExamScanSetting= (data:any):Promise<ApiResponse> => {
+  return request({
+    url: '/api/v1/scan_setting/setting_alter_window',
+    method: 'get',
+    params: data
+  })
+}
+
+// 39. 扫描学生 获取扫描弹窗设置
+export const saveChooseCode= (data:any):Promise<ApiResponse> => {
+  return request({
+    url: '/api/v1/ai_exam_scan/save_choose_code',
+    method: 'post',
+    data
+  })
+}
+
+// 40. 扫描学生 获取成绩发布汇总接口
+export const getExamScoreSummary= (data:any):Promise<ApiResponse> => {
+  return request({
+    url: '/api/v1/ai_analysis/calculateAiExam',
+    method: 'post',
+    data
+  })
 }

BIN
src/assets/icon/scan_set_icon.png


+ 5 - 1
src/router/index.ts

@@ -59,7 +59,11 @@ const routes: Array<RouteRecordRaw> = [
         name: 'scanDetail',
         component: () => import('@/views/exam/scanDetail.vue')
       },
-      
+      {
+        path: 'selectStudent',
+        name: 'selectStudent',
+        component: () => import('@/views/exam/selectExamStudent.vue')
+      },
       {
         path: 'examList',
         name: 'examList',

+ 38 - 1
src/styles/common.scss

@@ -622,12 +622,49 @@ body {
       width: 100%;
       height: 48px;
       line-height: 48px;
-      padding: 0 10px;
+      padding: 0 0px;
       box-sizing: border-box;
       border-bottom: 1px solid #ebeef5;
 
       display: flex;
       justify-content: space-between;
+
+      .scan_set 
+      {
+          width: 100px;
+          height: 48px;
+          line-height: 48px;
+          font-weight: 400;
+          font-size: 14px;
+          color: #666666;
+          margin-right: 20px;
+          background-image: url('../assets/icon/scan_set_icon.png');
+          background-size: 16px 16px;
+          background-repeat: no-repeat;
+          background-position: 5px 50%;
+          text-align: right;
+          cursor: pointer;
+      }
+
+      .scan_set_scan_code {
+        width: calc(100% - 100px);
+        height: 48px;
+        display: flex;
+        justify-content: flex-end;
+        align-items: center;
+        font-size: 14px;
+        color: #666666;
+
+        .el-input__icon {
+          line-height: 36px;
+        }
+
+        .el-input__inner {
+          line-height: 36px;
+          height: 36px;
+        }
+
+      }
     }
     .right_center {
       width: 100%;

+ 26 - 6
src/views/exam/scanDetail.vue

@@ -107,7 +107,7 @@
                         <div class="item_batch_img" :class="image.abnormalType!=0 && image.abnormalType!=null?'item_batch_img_error':''" >
                             <img :src="image.recognizeUrl" alt=""  loading="lazy"></img>
                             <div class="button_group">
-                                <div class="pic_button_view" @click="OpenViewPaper(image)">
+                                <div class="pic_button_view" @click="OpenViewPapers(image)">
                                     <i class="iconfont icon_xianshimima"></i>查看
                                 </div>
                             </div>
@@ -171,8 +171,8 @@ const stateList = ref<OptionItem[]>([])
 
 const listMode=ref('list');
 
-const tableData=ref([]);
-const imageData=ref([]);//图片数据
+const tableData=ref<any[]>([]);//列表数据
+const imageData=ref<any[]>([]);//图片数据
 const loading=ref(false); //加载状态
 
 
@@ -183,8 +183,8 @@ const imageHeight=ref(500);
 const isImportStudent=ref(false);//是否导入了学生名单
 const showSelectStudent=ref(false);//是否显示选择学生名单弹窗
 const showPaperDialog=ref(false);//显示图片详情弹窗
-const previewImageList=ref([]);//图片列表
-const previewAnswerData=ref({});
+const previewImageList=ref<any[]>([]);//图片列表
+const previewAnswerData=ref<any[]>([]);
 // 打开导入学生名单
 const OpenImportStudent = () => {
     showSelectStudent.value=true;
@@ -278,7 +278,7 @@ const LoadData = () => {
 
 
 
-//查看图片
+//查看图片 按人  可能有多张图片
 const OpenViewPaper = (item:any) => {
 
     console.log("查看图片",item);
@@ -300,6 +300,26 @@ const OpenViewPaper = (item:any) => {
     showPaperDialog.value=true;
 }
 
+//查看图片 按单张图片来
+const OpenViewPapers = (item:any) => {
+
+    console.log("查看图片",item);
+    previewImageList.value=[];//初始清空
+    
+    let obj={
+        url:item.recognizeUrl,
+        pageNo:item.pageNo,//页面页码
+    };
+    previewImageList.value.push(obj);
+    
+    previewAnswerData.value=[];
+
+    // // 合并两个对象
+    // this.previewAnswerData = { ...item.objectiveQuestionMap, ...item.selectiveQuestionMap };
+    // this.showPaperPreview=true;
+    showPaperDialog.value=true;
+}
+
 //切换分页
 const HandlePageChange=(page:number)=>{
     pageInfo.value.pageNum=page;

+ 116 - 29
src/views/exam/scanList.vue

@@ -91,13 +91,17 @@
         </div>
         <div class="content_right">
             <div class="right_header">
-               <span> 扫描 设置</span>
-               <span>
-                识别号:
-                <el-select v-model="params.batchNo" placeholder="请选择" @change="GoSearch()" style="width: 120px;">
-                    <el-option v-for="item in scanIdentifyList" :key="item.value" :label="item.label" :value="item.value"></el-option>
-                </el-select>
-               </span>
+               <div class="scan_set"> 扫描设置</div>
+               <div class="scan_set_scan_code">
+    
+                    <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 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>
+                </div>
             </div>
             <div class="right_center">
                 <div class="scan_buttons">
@@ -152,7 +156,7 @@
                 </div>
             </div>
             <div class="right_button">
-                <el-button type="primary" @click="FinishScanned()" style="width:calc(100% - 40px);">扫描完成</el-button>
+                <el-button type="primary" @click="FinishScanned()" :loading="finishLoading" style="width:calc(100% - 40px);">扫描完成</el-button>
             </div>
         </div>
     </div>
@@ -167,7 +171,7 @@ import { useRouter } from 'vue-router'
 import { onMounted ,ref,computed,onUnmounted,nextTick } from 'vue';
 import ScanButton from './components/scanButton.vue'
 import SelectStudent from './components/selectStudent.vue'
-import { finishScanned,hasImportStudent,getBatchList,getCurrentBatchNo,deleteBatch,updateScanCount } from '@/api/exam'
+import { finishScanned,getExamScoreSummary,hasImportStudent,getBatchList,getCurrentBatchNo,deleteBatch,updateScanCount,setExamScanSetting,saveChooseCode} from '@/api/exam'
 import scanCommon from '@/utils/scanCommon';
 import { ElMessageBox, ElMessage } from 'element-plus'
 import { formatTimestamp } from '@/utils/common';
@@ -200,6 +204,34 @@ const examSubjectCode=computed(() => {
 const currentUserName=computed(() => {
     return userStore.userName;
 })
+//查询是否导入了学生名单
+const HasImportStudent = async () => { 
+    const params = {
+      examSubjectId: examSubjectId.value,
+      schoolId: 0,//单校 0 
+    };
+    const res = await hasImportStudent(params);
+    console.log("打印是否导入了学生名单",res);
+    if(res.code==200)
+    {
+        isImportStudent.value=res.data;
+    }
+    else{
+        isImportStudent.value=false;
+    }
+    if(!isImportStudent.value)
+    {
+        console.log("未导入学生名单,跳转到选择学生名单界面");
+        //跳转导入学生名单界面
+        router.push({
+            name: 'selectStudent',
+           
+        });
+    }
+}
+
+// 组件创建时立即执行
+HasImportStudent();//查询是否导入了学生名单();
 
 const selectSchoolId=ref(0);//学校ID
 const showAbnormalDialog=ref(false);//异常弹窗
@@ -248,9 +280,22 @@ const scanIdentifyList=[
         value:'1',
     }
 ];//识别号列表
+const scanTypeList=[
+    {
+        label:'不弹窗',
+        value:0,
+    },
+    {
+        label:'弹窗',
+        value:1,
+    }
+];
+const scanIdentifyCode=ref('1');////识别号 1-学号 2-考号 
+const useDriveUI=ref(0);//1是会弹框,其他值或不写则不弹
 
 const isImportStudent=ref(false);//是否导入了学生名单
 const showSelectStudent=ref(false);//是否显示选择学生名单弹窗
+const finishLoading=ref(false);//扫描完成加载中
 const scanDataInfo=ref({
     abnormalNum:0,//异常数量
     examMissNum:0,//缺考数量
@@ -294,16 +339,34 @@ const FinishScanned= async () =>{
         let param={
             id:examSubjectId.value
         };
-
+        finishLoading.value=true;
         const res = await finishScanned(param)
         if(res.code == 200) 
         {
-            ElMessage.success("完成成功!")
+            // ElMessage.success("完成成功!")
+            let idList=res.data.split(",");
+            let analysisParam = {
+                examId:idList[0],
+                examPaperIds:[idList[1]],//多科传0  单科传科目ID
+            }
+            //扫描完成 调用汇总接口
+
+            const analysisRes = await getExamScoreSummary(analysisParam);
+            if(analysisRes.code == 200) 
+            {
+                ElMessage.success("完成成功!")
+                finishLoading.value=false;
+            }
+            else
+            {
+                ElMessage.error(analysisRes.msg);
+                finishLoading.value=false;
+            }
         }
         else
         {
             ElMessage.error(res.msg);
-        
+            finishLoading.value=false;
         }
     })
 }
@@ -328,6 +391,44 @@ const ConfigRequestUrlByEnv= () =>{
           
 }
 
+//切换弹窗模式
+const ChangeDriveUI=()=>{
+    console.log("打印弹窗模式", useDriveUI.value);
+    let params={
+        alterWindow:useDriveUI.value
+    };
+    setExamScanSetting(params).then(res => {
+        if(res.code == 200) 
+        {
+            ElMessage.success("设置成功!")
+        }
+        else
+        {
+            ElMessage.error(res.msg);
+        
+        }
+    })
+}
+
+//改变识别码
+const ChangeCode=()=>{
+    let param={
+        examSubjectId:examSubjectId.value,
+        chooseCode:scanIdentifyCode.value//识别号 1-学号 2-平台号 3-学籍号 4-考号
+    };
+    saveChooseCode(param).then(res=>{
+        console.log("打印识别码设置结果",res);
+        if(res.code==200)
+        {
+            ElMessage.success("设置成功!")
+        }
+        else
+        {
+            ElMessage.error(res.msg);
+        }
+    })
+}
+
 //获取未上传图片的数量
 const GetNoUploadNumber=(item:BatchItem)=>
 {
@@ -648,22 +749,7 @@ const StudentSuccess = () => {
 
 
 
-//查询是否导入了学生名单
-const HasImportStudent = async () => { 
-    const params = {
-      examSubjectId: examSubjectId.value,
-      schoolId: 0,//单校 0 
-    };
-    const res = await hasImportStudent(params);
-    console.log("打印是否导入了学生名单",res);
-    if(res.code==200)
-    {
-        isImportStudent.value=res.data;
-    }
-    else{
-        isImportStudent.value=false;
-    }
-}
+
 
 //获取扫描批次列表
 const GetScanBatchList=async()=>{
@@ -963,7 +1049,7 @@ onMounted(() => {
         console.warn('当前没有选中的考试信息')
         // 可选:如果没有数据,可以重定向回列表页或提示用户
     }
-    HasImportStudent();//查询是否导入了学生名单
+    
     GetScanBatchList();//获取扫描批次列表
     CalculateTableHeight();//初始化计算表格高度
     console.log("打印当前的配置",import.meta.env.VUE_APP_BASE);
@@ -980,6 +1066,7 @@ onMounted(() => {
     // 监听窗口大小变化
     window.addEventListener('resize', CalculateTableHeight);
 });
+
 // 卸载时移除监听,防止内存泄漏
 onUnmounted(() => {
   window.removeEventListener('resize', CalculateTableHeight);

+ 138 - 0
src/views/exam/selectExamination.vue

@@ -0,0 +1,138 @@
+<template>
+  <div class="page_list">
+    
+
+  </div>
+</template>
+<script lang="ts" setup>
+import { useExamStore } from '@/store/exam'
+import { useUserStore } from '@/store/user'
+import { useRouter } from 'vue-router'
+import { onMounted ,ref,computed,onUnmounted,nextTick } from 'vue';
+import ScanButton from './components/scanButton.vue'
+import SelectStudent from './components/selectStudent.vue'
+import { finishScanned,hasImportStudent,getBatchList,getCurrentBatchNo,deleteBatch,updateScanCount,setExamScanSetting,saveChooseCode} from '@/api/exam'
+import scanCommon from '@/utils/scanCommon';
+import { ElMessageBox, ElMessage } from 'element-plus'
+import { formatTimestamp } from '@/utils/common';
+import AbnormalDetail from './abnormalDetail.vue';
+import WebSocketManager from '@/utils/webSocket'//后端websocket链接js
+// 实例化 Store
+const examStore = useExamStore()
+const userStore = useUserStore()
+
+const router = useRouter()
+
+// 考试科目 ID
+const examSubjectId = computed(() => {
+  return examStore.currentExam?.id
+})//计算属性
+
+const userInfo=computed(() => {
+    return userStore.userInfo;
+})//用户信息
+
+const schoolType=computed(() => {
+    return ''
+})
+
+//考试科目code
+const examSubjectCode=computed(() => {
+    return examStore.currentExam?.examSubjectCode
+})
+//当前登录人姓名
+const currentUserName=computed(() => {
+    return userStore.userName;
+})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+onMounted(() => {
+    
+
+   
+});
+
+// 卸载时移除监听,防止内存泄漏
+onUnmounted(() => {
+  
+});
+</script>
+ 
+<style lang="scss" scoped>
+.page_list
+{
+    width: 100%;
+    height: 100%;
+    padding: 20px;
+    background-color: #fff;
+    border-radius: 4px;
+    box-sizing: border-box;
+
+}
+
+.scan_state_title
+{
+    font-size: 14px;
+    color:#333;
+    font-weight: 400;
+
+}
+.scan_state_open
+{   margin-left: 5px;
+    font-size: 14px;
+    font-weight: 400;
+    color: #2BC644;
+     i
+    {
+        margin-right: 5px;
+    }
+}
+
+.scan_state_close
+{
+    font-size: 14px;
+    font-weight: 400;
+    margin-left: 5px;
+    color:#F56C6C;
+    i
+    {
+        margin-right: 5px;
+    }
+    
+}
+</style>