浏览代码

确保交卷前抓拍;fix抓拍结果队列

Michael Wang 6 年之前
父节点
当前提交
55732c08e4
共有 2 个文件被更改,包括 14 次插入4 次删除
  1. 8 4
      src/components/FaceRecognition/FaceRecognition.vue
  2. 6 0
      src/features/OnlineExam/Examing/ExamingHome.vue

+ 8 - 4
src/components/FaceRecognition/FaceRecognition.vue

@@ -158,21 +158,22 @@ export default {
             "&examRecordDataId=" +
             "&examRecordDataId=" +
             this.$route.params.examRecordDataId
             this.$route.params.examRecordDataId
         );
         );
-        await this.showSnapResult(fileName);
+        const examRecordDataId = this.$route.params.examRecordDataId;
+        await this.showSnapResult(fileName, examRecordDataId);
       } catch (e) {
       } catch (e) {
         console.log(e);
         console.log(e);
         this.$Message.error(e.message);
         this.$Message.error(e.message);
         return;
         return;
       }
       }
     },
     },
-    async showSnapResult(fileName) {
+    async showSnapResult(fileName, examRecordDataId) {
       try {
       try {
         // 获取抓拍结果
         // 获取抓拍结果
         const snapRes = (await this.$http.get(
         const snapRes = (await this.$http.get(
           "/api/ecs_oe_student_face/examCaptureQueue/getExamCaptureResult?fileName=" +
           "/api/ecs_oe_student_face/examCaptureQueue/getExamCaptureResult?fileName=" +
             fileName +
             fileName +
             "&examRecordDataId=" +
             "&examRecordDataId=" +
-            this.$route.params.examRecordDataId
+            examRecordDataId
         )).data;
         )).data;
         if (snapRes.isCompleted) {
         if (snapRes.isCompleted) {
           if (snapRes.isStranger) {
           if (snapRes.isStranger) {
@@ -181,7 +182,10 @@ export default {
             this.$Message.error("请保持正确坐姿");
             this.$Message.error("请保持正确坐姿");
           }
           }
         } else {
         } else {
-          setTimeout(this.showSnapResult.bind(this, fileName), 10 * 1000);
+          setTimeout(
+            this.showSnapResult.bind(this, fileName, examRecordDataId),
+            10 * 1000
+          );
         }
         }
       } catch (e) {
       } catch (e) {
         console.log(e);
         console.log(e);

+ 6 - 0
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -190,7 +190,12 @@ export default {
       });
       });
     },
     },
     async realSubmitPaper() {
     async realSubmitPaper() {
+      this.$Spin.show();
       this.toggleSnapNow();
       this.toggleSnapNow();
+      // 确保抓拍指令在交卷前执行
+      setTimeout(() => this.realSubmitPaperStep2(), 1500);
+    },
+    async realSubmitPaperStep2() {
       try {
       try {
         const res = await this.$http.get(
         const res = await this.$http.get(
           "/api/ecs_oe_student/examControl/endExam"
           "/api/ecs_oe_student/examControl/endExam"
@@ -210,6 +215,7 @@ export default {
       } catch (e) {
       } catch (e) {
         console.log(e);
         console.log(e);
       }
       }
+      this.$Spin.hide();
     },
     },
     examQuestion() {
     examQuestion() {
       return (
       return (