Browse Source

选择题判分bug修复优化更新

dengshaobo 1 month ago
parent
commit
8ab3fbec32

+ 1 - 1
src/components/AddExam.vue

@@ -22,7 +22,7 @@
         </el-radio-group>
       </el-form-item>
       <el-form-item label="班级类型:" prop="classType" v-if="showClassType">
-        <el-radio-group v-model="formData.classType" @change="HandleCourseChange" >
+        <el-radio-group v-model="formData.classType" >
           <el-radio :value="subject.value"  v-for="subject in classTypeList" :key="subject.value">{{subject.label}}</el-radio>
         </el-radio-group>
       </el-form-item>

+ 2 - 1
src/styles/common.scss

@@ -3960,7 +3960,8 @@ body {
   }
 
   .editor_disable {
-    color: #bbbbbb !important;
+    color: #c0c4cc !important;
+    
     cursor: not-allowed !important;
   }
 

+ 1 - 1
src/utils/request.ts

@@ -44,7 +44,7 @@ service.interceptors.response.use(
         return response;
       }else if (res.code === 401) {
         // 跳转登录页
-        window.location.href = '/login'
+        window.location.href = '/#/login'
       }else
       {
         return res

+ 41 - 38
src/utils/scanCommon.ts

@@ -102,47 +102,50 @@ class ScanCommonService {
           try {
             const objectData: ScanMessage = JSON.parse(evt.data);
             console.log("处理扫描结果的objectData:", objectData);
-            if (objectData.code === 200) {
-              if (objectData.action === 'connectMessage') {
-                  
-                  this.clientVersion = objectData.param.appVersion || '';
-                  const version = objectData.param.appVersion || '未知版本';
-
-                  ElMessage({
-                    type: 'success',
-                    message: `客户端连接成功……版本号:${version}`
-                  });
-              } else if (objectData.action === 'getScannerList') {
-                // 获取扫描仪结果
-                if (objectData.data && Array.isArray(objectData.data) && objectData.data.length > 0) {
-                  // 有扫描仪连接 
-                  this.isScanned = true;
-                  ElMessage({
-                    type: 'success',
-                    message: '扫描仪连接成功……'
-                  });
+            if(objectData)
+            {
+              if (objectData?.code === 200) {
+                if (objectData?.action === 'connectMessage') {
+                    
+                    this.clientVersion = objectData.param.appVersion || '';
+                    const version = objectData.param.appVersion || '未知版本';
+
+                    ElMessage({
+                      type: 'success',
+                      message: `客户端连接成功……版本号:${version}`
+                    });
+                } else if (objectData?.action === 'getScannerList') {
+                  // 获取扫描仪结果
+                  if (objectData.data && Array.isArray(objectData.data) && objectData.data.length > 0) {
+                    // 有扫描仪连接 
+                    this.isScanned = true;
+                    ElMessage({
+                      type: 'success',
+                      message: '扫描仪连接成功……'
+                    });
+                  } else {
+                    // 没有扫描仪连接
+                    this.isScanned = false;
+                  }
                 } else {
-                  // 没有扫描仪连接
-                  this.isScanned = false;
+                  // 其他业务数据回调
+                  if (this.scanCallback) this.scanCallback(objectData);
                 }
               } else {
-                // 其他业务数据回调
-                if (this.scanCallback) this.scanCallback(objectData);
-              }
-            } else {
-              // 未检测到纸张或卡纸
-              
-              console.log("未检测到纸张或者卡纸:", callback);
-              if (this.scanCallback)
-              {
-                this.scanCallback(objectData);
-              } 
-              else
-              {
-                ElMessage({
-                  type: 'error',
-                  message: '未检测到纸张或者卡纸'
-                });
+                // 未检测到纸张或卡纸
+                
+                console.log("未检测到纸张或者卡纸:", callback);
+                if (this.scanCallback)
+                {
+                  this.scanCallback(objectData);
+                } 
+                else
+                {
+                  ElMessage({
+                    type: 'error',
+                    message: '未检测到纸张或者卡纸'
+                  });
+                }
               }
             }
             

+ 68 - 2
src/views/exam/abnormal/tableList.vue

@@ -41,7 +41,10 @@
         <div class="right_search">
             <div class="search_input">
                 <el-input type="text" v-model="keyWord" placeholder="学生姓名、考号" >
-                    <el-button slot="append" icon="el-icon-search" ></el-button>
+                    
+                    <template #append>
+                        <el-button :icon="Search"/>
+                    </template>
                 </el-input>
             </div>
             <div class="search_button el_button">
@@ -51,7 +54,7 @@
                 <el-button style="padding:0px 10px;"  @click="OpenReldentify()" v-if="scanState == 1">重新识别客观题</el-button>
                 <el-button :class="multiSelection.length>0?'marke_normal_btn':'marke_normal_btn_disable'" @click="MarkStudent(0)"  v-if="scanState == 2" :disabled="!multiSelection.length">标记为正常</el-button>
                 <el-button :class="multiSelection.length>0?'marke_anomaly_btn':'marke_anomaly_btn_disable'" @click="MarkCardNumberAbnormal()"  v-if="scanState == 1" :disabled="!multiSelection.length>0">标记为异常</el-button>
-                <el-button :class="multiSelection.length>0?'delete_btn':'delete_btn_disable'"  @click="MarkStudent(4)" v-if="scanState == 1" :disabled=" !multiSelection.length"> 批量删除</el-button>
+                <el-button :class="multiSelection.length>0?'delete_btn':'delete_btn_disable'"  @click="AllUploadDelete()" v-if="scanState == 1" :disabled=" !multiSelection.length"> 批量删除</el-button>
             </div>
         </div>
         <div class="page_table table_row_42" style="width: calc(100% - 40px); margin: auto;" v-loading="isLoading" element-loading-text="加载中……" element-loading-spinner="el-icon-loading" element-loading-background="#ffffff">
@@ -334,6 +337,7 @@ import { ElMessageBox, ElMessage } from 'element-plus'
 import PaperPreview from '../components/PaperPreview.vue'//图片预览组件
 import ActionImage from '@/components/ActionImage.vue'// 画布图片组件
 import ReIdentify from '@/views/exam/components/ReIdentify.vue';//重新识别弹窗
+import { Search } from '@element-plus/icons-vue'
 // 实例化 Store
 const examStore = useExamStore()
 const userStore = useUserStore()
@@ -782,6 +786,7 @@ const GetTemplateDetail = async () => {
 
         };
         currentTemplateList.value.push(obj);
+        localStorage.setItem("templateData",JSON.stringify(currentTemplateList.value));//保存模板数据到本地
        
        })
        
@@ -1137,6 +1142,67 @@ const UploadDelete = async (item: any) => {
 }
 
 
+/**
+ * 批量已上传删除 - 实际为修改状态为未扫描
+ * @param item - 要删除的学生对象
+ * @description 调用删除接口移除学生的答题卡数据,并刷新列表
+ */
+const AllUploadDelete = async () => {
+
+    console.log("已上传删除item",multiSelection.value);
+    if(multiSelection.value.length==0)
+    {
+        ElMessage.warning("请选择需要操作的学生");
+        return;
+    }
+    try {
+        // 显示确认对话框
+        await ElMessageBox.confirm('是否要批量删除所选的数据?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            closeOnClickModal: false,
+            type: 'warning',
+            customClass: 'page_dialog'
+        });
+
+        // 确定按钮点击事件处理
+        let studentScanIds=[];
+        for(let i=0;i<multiSelection.value.length;i++)
+        {
+            studentScanIds.push(multiSelection.value[i].id);   
+        }
+        
+        // 构建请求参数
+        const param = {
+            ids: studentScanIds,
+            examSubjectId: examSubjectId.value,
+            schoolId: schoolId.value
+            // scannedStatus: 2, // 扫描状态 0-未扫描 2-缺考(修改时传,删除不传)
+        };
+        
+        console.log("删除参数:", param);
+        
+        // 调用删除接口
+        const res = await deleteAnswerCard(param);
+        
+        if (res.code === 200) {
+            ElMessage.success('删除成功');
+            
+            // 刷新列表数据
+            GetExamScanList();
+        } else {
+            ElMessage.error('删除失败!' + (res.msg || '未知错误'));
+        }
+    } catch (error) {
+        // 用户点击取消或发生错误
+        if (error !== 'cancel') {
+            console.error("删除操作错误:", error);
+            ElMessage.error('操作失败');
+        }
+    }
+}
+
+
 //单个标缺
 const MarkToMiss=(item:any)=>{ 
     console.log("打印选择的学生数据",item);

+ 1 - 1
src/views/exam/abnormalDetail.vue

@@ -551,7 +551,7 @@ onMounted(() => {
         console.warn('当前没有选中的考试信息')
         // 可选:如果没有数据,可以重定向回列表页或提示用户
     }
-    HasImportStudent();//查询是否导入了学生名单
+    // HasImportStudent();//查询是否导入了学生名单
 
     CalculateTableHeight();//初始化计算表格高度
   

+ 2 - 2
src/views/exam/components/addStudent.vue

@@ -52,14 +52,14 @@
         <el-form-item label="考号:" prop="exCode">
           <el-input v-model="addStudentData.examCode" placeholder=""></el-input>
         </el-form-item>
-        <el-form-item label="考场:" prop="examRoomCode">
+        <!-- <el-form-item label="考场:" prop="examRoomCode">
           <el-select  v-model="addStudentData.examRoomCode"  placeholder="请选择">
             <el-option  v-for="(item, index) in examRoomList"  :key="'exam_room_' + index"
               :label="item.label"
               :value="item.value"
             ></el-option>
           </el-select>
-        </el-form-item>
+        </el-form-item> -->
 
         <el-form-item label="行政班:" prop="adminClassIdCode">
           <el-select

+ 7 - 3
src/views/exam/examList.vue

@@ -4,7 +4,10 @@
     <div class="search_content">
         <div class="content_left">
             <el-input placeholder="请输入学生姓名"  v-model="searchContent" @input="GoSearch" @change="GoSearch()" style="width:240px;" >
-                <el-button @click="GoSearch()"  slot="append" icon="el-icon-search"></el-button>
+                <!-- <el-button @click="GoSearch()"  slot="append" icon="el-icon-search"></el-button> -->
+                <template #append>
+                    <el-button :icon="Search" @click="GoSearch()"/>
+                </template>
             </el-input>
         </div>
         <div class="content_right el_button">
@@ -28,7 +31,7 @@
                     </el-table-column>
                 <el-table-column prop="examRoomName" label="班级" width="80" align="center">
                 </el-table-column>
-                <el-table-column prop="date" label="缺考/学生数" min-width="120" align="center">
+                <el-table-column prop="date" label="缺考/学生数" min-width="100" align="center">
                     <template v-slot="scope">
                         <div class="answer_input">
                             {{scope.row.missExamNum}}/{{scope.row.totalStudentNum}}
@@ -42,7 +45,7 @@
                         </div>
                     </template>
                 </el-table-column>
-                <el-table-column prop="name" label="已上传/学生数(%)" align="center"  width="160" fixed="right">
+                <el-table-column prop="name" label="已上传/学生数(%)" align="center"  width="200" fixed="right">
                     <template v-slot="scope">
                         <!-- <div class="full_mark_input">
                             {{scope.row.uploadedNum}}/{{scope.row.totalStudentNum}}
@@ -149,6 +152,7 @@ import { ElMessageBox, ElMessage } from 'element-plus'
 import AddStudent from './components/addStudent.vue' // 新增学生弹窗
 import PaperPreview from '@/views/exam/components/PaperPreview.vue';//试卷预览
 import CircleProcess from '@/views/exam/components/CircleProcess.vue'//圆形进度条
+import { Search } from '@element-plus/icons-vue'
 // 实例化 Store
 const examStore = useExamStore()
 const router = useRouter()

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

@@ -2,8 +2,8 @@
   <div class="detail_main">
     <div class="question_header">
         <div class="item_title">
-            <div class="item_step">1</div>
-            扫描标准答案:<el-button type="primary"  @click="GotoScan()" :loading="scanLoading" style="width: 88px;">{{scanText}}</el-button>  
+            <!-- <div class="item_step">1</div>
+            扫描标准答案:<el-button type="primary"  @click="GotoScan()" :loading="scanLoading" style="width: 88px;">{{scanText}}</el-button>   -->
             <!-- <span class="preview_btn">预览</span> -->
             <!-- <el-button style="margin-left: 10px;width: 116px;">引用试题结构</el-button> -->
         </div>
@@ -15,8 +15,8 @@
     <div class="page_jg_20"></div>
     <div class="page_module">
         <div class="item_title">
-            <div class="item_step">2</div>
-            设置分值:
+            <!-- <div class="item_step">2</div> -->
+            设置试题结构:
             <div class="item_search">
                 <div class="search_name">题目从</div>
                 <el-select  v-model="queryParams.start"   placeholder="请选择"  class="select_width" >

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

@@ -301,8 +301,8 @@ const isfilter=ref(1);//是否过滤
 const currentBatchNoId=ref('');//当前批次号id
 const loadingText=ref('');//加载文本
 const baseUrl=import.meta.env.VITE_API_BASE_URL;
-const uploadUrl=`https://dev3.k12100.net/teaching/api/v1/ai_exam_scan/upload_multi_img`;//图片上传地址
-const updateCountUrl=`https://dev3.k12100.net/teaching/api/v1/ai_exam_scan/record_batch_scan_number`;
+const uploadUrl=`https://www.k12100.com/teaching/api/v1/ai_exam_scan/upload_multi_img`;//图片上传地址
+const updateCountUrl=`https://www.k12100.com/teaching/api/v1/ai_exam_scan/record_batch_scan_number`;
 
 const webSocket=ref<InstanceType<typeof WebSocketManager> | null>(null);//websocket
 let websocketUrl=import.meta.env.VITE_WEB_SOCKET_URL;//websocket链接地址
@@ -536,7 +536,7 @@ const ConfigRequestUrlByEnv= () =>{
     {
         //开发环境
         console.log("打印import.meta.env.VITE_API_BASE_URL", import.meta.env.VITE_WEB_SOCKET_URL);
-        websocketUrl = 'wss://index.k12100.net/teaching/api/v1/teaching/websocket/'
+        websocketUrl = 'wss://www.k12100.com/teaching/api/v1/teaching/websocket/'
         console.log("设置webSocket地址",websocketUrl);
     } else if (import.meta.env.MODE === 'production') 
     {