Răsfoiți Sursa

prettier: add trailing comma

Michael Wang 6 ani în urmă
părinte
comite
7f9bfb39cf
58 a modificat fișierele cu 453 adăugiri și 450 ștergeri
  1. 4 4
      .eslintrc.js
  2. 4 4
      babel.config.js
  3. 4 4
      jest.config.js
  4. 2 2
      postcss.config.js
  5. 3 0
      prettier.config.js
  6. 2 2
      src/App.vue
  7. 24 24
      src/components/FaceRecognition/FaceRecognition.vue
  8. 4 4
      src/components/MainLayout/MainLayout.vue
  9. 31 31
      src/features/Login/Login.vue
  10. 6 6
      src/features/OfflineExam/OfflineExamHome.vue
  11. 8 8
      src/features/OfflineExam/OfflineExamList.vue
  12. 16 16
      src/features/OfflineExam/OfflineExamUpload.vue
  13. 7 7
      src/features/OnlineExam/Examing/ArrowNavView.vue
  14. 7 7
      src/features/OnlineExam/Examing/BooleanQuestionView.vue
  15. 11 11
      src/features/OnlineExam/Examing/ExamPaper.vue
  16. 7 7
      src/features/OnlineExam/Examing/ExamingEnd.vue
  17. 32 32
      src/features/OnlineExam/Examing/ExamingHome.vue
  18. 17 17
      src/features/OnlineExam/Examing/FaceId.vue
  19. 4 4
      src/features/OnlineExam/Examing/FaceTracking.vue
  20. 9 9
      src/features/OnlineExam/Examing/FillBlankQuestionView.vue
  21. 9 9
      src/features/OnlineExam/Examing/MultipleQuestionView.vue
  22. 3 3
      src/features/OnlineExam/Examing/OverallProgress.vue
  23. 6 6
      src/features/OnlineExam/Examing/QuestionBody.vue
  24. 4 4
      src/features/OnlineExam/Examing/QuestionFilters.vue
  25. 3 3
      src/features/OnlineExam/Examing/QuestionIndex.vue
  26. 6 6
      src/features/OnlineExam/Examing/QuestionNavView.vue
  27. 9 9
      src/features/OnlineExam/Examing/QuestionView.vue
  28. 9 9
      src/features/OnlineExam/Examing/RemainTime.vue
  29. 9 9
      src/features/OnlineExam/Examing/SingleQuestionView.vue
  30. 9 9
      src/features/OnlineExam/Examing/TextQuestionView.vue
  31. 10 10
      src/features/OnlineExam/Examing/UploadPhotos.vue
  32. 9 9
      src/features/OnlineExam/Examing/ws.js
  33. 12 12
      src/features/OnlineExam/OnlineExamFaceCheckModal.vue
  34. 4 4
      src/features/OnlineExam/OnlineExamHome.vue
  35. 19 19
      src/features/OnlineExam/OnlineExamList.vue
  36. 4 4
      src/features/OnlineExam/OnlineExamOverview.vue
  37. 4 4
      src/features/OnlineExam/OnlineExamResultList.vue
  38. 6 6
      src/features/OnlineExam/PhoneVerifyForDD.vue
  39. 7 7
      src/features/OnlinePractice/OnlinePracticeHome.vue
  40. 10 10
      src/features/OnlinePractice/OnlinePracticeList.vue
  41. 6 6
      src/features/OnlinePractice/OnlinePracticeRecordDetail.vue
  42. 4 4
      src/features/OnlinePractice/OnlinePracticeRecordList.vue
  43. 17 17
      src/features/Password/Password.vue
  44. 10 10
      src/main.js
  45. 1 1
      src/plugins/iview.js
  46. 2 2
      src/plugins/vueLifecylceLogs.js
  47. 1 1
      src/registerServiceWorker.js
  48. 14 14
      src/router.js
  49. 10 10
      src/store.js
  50. 11 11
      src/utils/axios.js
  51. 1 1
      src/utils/monitors.js
  52. 2 2
      src/views/NotFoundComponent.vue
  53. 3 3
      tests/unit/.eslintrc.js
  54. 1 1
      tests/unit/HelloWorld.spec.js
  55. 4 4
      tests/vue/child.vue
  56. 4 4
      tests/vue/event.vue
  57. 2 2
      tests/vue/props.vue
  58. 6 6
      vue.config.js

+ 4 - 4
.eslintrc.js

@@ -1,16 +1,16 @@
 module.exports = {
   root: true,
   env: {
-    node: true
+    node: true,
   },
   extends: ["plugin:vue/essential", "@vue/prettier"],
   rules: {
     // "no-console": process.env.NODE_ENV === "production" ? "error" : "off",
     "no-console": "off",
     "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
-    "vue/no-parsing-error": [2, { "x-invalid-end-tag": false }]
+    "vue/no-parsing-error": [2, { "x-invalid-end-tag": false }],
   },
   parserOptions: {
-    parser: "babel-eslint"
-  }
+    parser: "babel-eslint",
+  },
 };

+ 4 - 4
babel.config.js

@@ -5,8 +5,8 @@ module.exports = {
       "import",
       {
         libraryName: "iview",
-        libraryDirectory: "src/components"
-      }
-    ]
-  ]
+        libraryDirectory: "src/components",
+      },
+    ],
+  ],
 };

+ 4 - 4
jest.config.js

@@ -4,14 +4,14 @@ module.exports = {
     "^.+\\.vue$": "vue-jest",
     ".+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$":
       "jest-transform-stub",
-    "^.+\\.jsx?$": "babel-jest"
+    "^.+\\.jsx?$": "babel-jest",
   },
   moduleNameMapper: {
-    "^@/(.*)$": "<rootDir>/src/$1"
+    "^@/(.*)$": "<rootDir>/src/$1",
   },
   snapshotSerializers: ["jest-serializer-vue"],
   testMatch: [
-    "**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"
+    "**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)",
   ],
-  testURL: "http://localhost/"
+  testURL: "http://localhost/",
 };

+ 2 - 2
postcss.config.js

@@ -1,5 +1,5 @@
 module.exports = {
   plugins: {
-    autoprefixer: {}
-  }
+    autoprefixer: {},
+  },
 };

+ 3 - 0
prettier.config.js

@@ -0,0 +1,3 @@
+module.exports = {
+  trailingComma: "es5",
+};

+ 2 - 2
src/App.vue

@@ -34,8 +34,8 @@ export default {
       } else {
         this.transitionName = "";
       }
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 24 - 24
src/components/FaceRecognition/FaceRecognition.vue

@@ -36,7 +36,7 @@ export default {
     width: String,
     height: String,
     showRecognizeButton: Boolean,
-    closeCamera: Boolean // optional
+    closeCamera: Boolean, // optional
   },
   async mounted() {
     this.openCamera();
@@ -66,7 +66,7 @@ export default {
       } else {
         this.openCamera();
       }
-    }
+    },
   },
   beforeDestroy() {
     this.$refs.video.srcObject.getTracks().forEach(function(track) {
@@ -82,10 +82,10 @@ export default {
           console.log("启动摄像头");
           const stream = await navigator.mediaDevices.getUserMedia({
             video: {
-              facingMode: "user"
+              facingMode: "user",
               // width: 400,
               // height: this.showRecognizeButton ? 300 : 250
-            }
+            },
           });
           if (stream) {
             video.srcObject = stream;
@@ -96,46 +96,46 @@ export default {
               this.$Message.error({
                 content: "摄像头没有正常启用",
                 duration: 15,
-                closable: true
+                closable: true,
               });
             }
           } else {
             this.$Message.error({
               content: "没有可用的视频流",
               duration: 15,
-              closable: true
+              closable: true,
             });
             window._hmt.push([
               "_trackEvent",
               "摄像头框",
               "摄像头状态",
-              "没有可用的视频流"
+              "没有可用的视频流",
             ]);
           }
         } catch (error) {
           this.$Message.error({
             content: "无法启用摄像头",
             duration: 15,
-            closable: true
+            closable: true,
           });
           window._hmt.push([
             "_trackEvent",
             "摄像头框",
             "摄像头状态",
-            "无法启用摄像头"
+            "无法启用摄像头",
           ]);
         }
       } else {
         this.$Message.error({
           content: "没有找到可用的摄像头",
           duration: 15,
-          closable: true
+          closable: true,
         });
         window._hmt.push([
           "_trackEvent",
           "摄像头框",
           "摄像头状态",
-          "没有找到可用的摄像头"
+          "没有找到可用的摄像头",
         ]);
       }
     },
@@ -209,14 +209,14 @@ export default {
           this.$Message.error({
             content: "摄像头没有正常启用",
             duration: 5,
-            closable: true
+            closable: true,
           });
           window._hmt.push([
             "_trackEvent",
             "摄像头框",
             "摄像头状态",
             "摄像头没有正常启用-退出" +
-              (this.lastSnapTime ? "(非初次抓拍)" : "")
+              (this.lastSnapTime ? "(非初次抓拍)" : ""),
           ]);
           reject("摄像头没有正常启用");
           this.logout(
@@ -246,8 +246,8 @@ export default {
       try {
         const res = await this.$http.put(fileUrl, captureBlob, {
           headers: {
-            "Content-Type": "image/png"
-          }
+            "Content-Type": "image/png",
+          },
         });
         resultUrl = res.data;
         this.serverLog("debug/S-005001", "抓拍照片保存成功:");
@@ -257,7 +257,7 @@ export default {
         this.$Message.error({
           content: "保存抓拍照片到服务器失败!",
           duration: 15,
-          closable: true
+          closable: true,
         });
         throw "保存抓拍照片到服务器失败!";
       }
@@ -283,7 +283,7 @@ export default {
         this.$emit("on-recognize-result", {
           error: null,
           pass: res.data.isPass,
-          stranger: res.data.isStranger
+          stranger: res.data.isStranger,
         });
       } catch (e) {
         console.log(e);
@@ -327,7 +327,7 @@ export default {
 
         let body = {
           fileUrl: captureFilePath,
-          examRecordDataId
+          examRecordDataId,
         };
 
         if (cameraInfos) {
@@ -345,7 +345,7 @@ export default {
           this.$Message.error({
             content: "设置获取抓拍结果失败!",
             duration: 15,
-            closable: true
+            closable: true,
           });
         }
       } catch (e) {
@@ -375,13 +375,13 @@ export default {
             this.$Message.error({
               content: "请独立完成考试",
               duration: 5,
-              closable: true
+              closable: true,
             });
           } else if (!snapRes.isPass) {
             this.$Message.error({
               content: "请调整坐姿,诚信考试",
               duration: 5,
-              closable: true
+              closable: true,
             });
           }
         } else {
@@ -399,12 +399,12 @@ export default {
         this.$Message.error(e.message);
         throw e.message;
       }
-    }
+    },
   },
   computed: {
     ...globalMapState(["user"]),
-    ...mapState(["snapNow"])
-  }
+    ...mapState(["snapNow"]),
+  },
 };
 </script>
 

+ 4 - 4
src/components/MainLayout/MainLayout.vue

@@ -103,7 +103,7 @@ export default {
     },
     goBack() {
       window.history.back();
-    }
+    },
   },
   computed: {
     ...mapState(["user"]),
@@ -114,11 +114,11 @@ export default {
     ifShowQr() {
       const domain = localStorage.getItem("domain") || "";
       return domain.includes("ecs-dev") || domain.includes("exam.qmth.com.cn");
-    }
+    },
   },
   components: {
-    qrcode: VueQrcode
-  }
+    qrcode: VueQrcode,
+  },
 };
 </script>
 

+ 31 - 31
src/features/Login/Login.vue

@@ -21,7 +21,7 @@
             :class="[
               'qm-big-text',
               'login-type',
-              loginType === 'STUDENT_CODE' && 'active-type'
+              loginType === 'STUDENT_CODE' && 'active-type',
             ]"
             @click="loginType = 'STUDENT_CODE'"
             style="border-top-left-radius: 6px"
@@ -32,7 +32,7 @@
             :class="[
               'qm-big-text',
               'login-type',
-              loginType !== 'STUDENT_CODE' && 'active-type'
+              loginType !== 'STUDENT_CODE' && 'active-type',
             ]"
             @click="loginType = 'STUDENT_IDENTITY_NUMBER'"
             style="border-top-right-radius: 6px"
@@ -122,26 +122,26 @@ export default {
       errorInfo: "",
       loginForm: {
         accountValue: "",
-        password: ""
+        password: "",
       },
       loginFormRule: {
         accountValue: [
           {
             required: true,
             message: "请填写登录账号",
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         password: [
           {
             required: true,
             message: "请填写密码",
-            trigger: "blur"
-          }
-        ]
+            trigger: "blur",
+          },
+        ],
       },
       disableLoginBtn: true,
-      VUE_APP_GIT_REPO_VERSION: process.env.VUE_APP_GIT_REPO_VERSION
+      VUE_APP_GIT_REPO_VERSION: process.env.VUE_APP_GIT_REPO_VERSION,
     };
   },
   async mounted() {
@@ -154,7 +154,7 @@ export default {
     this.$Message.config({
       duration: 15,
       size: "large",
-      closable: true // 没有影响到所有的组件。。。  https://github.com/iview/iview/issues/2962
+      closable: true, // 没有影响到所有的组件。。。  https://github.com/iview/iview/issues/2962
     });
 
     try {
@@ -185,7 +185,7 @@ export default {
       [
         "xjtu.ecs.qmth.com.cn",
         "snnu.ecs.qmth.com.cn",
-        "cup.ecs.qmth.com.cn"
+        "cup.ecs.qmth.com.cn",
       ].includes(this.$route.params.domain)
     ) {
       this.disableLoginBtn = true;
@@ -195,7 +195,7 @@ export default {
       ) {
         this.$Message.error({
           content: "请与学校申请最新的客户端,进行考试!",
-          duration: 2 * 24 * 60 * 60
+          duration: 2 * 24 * 60 * 60,
         });
 
         return; // 避免 disableLoginBtn 被覆盖
@@ -226,7 +226,7 @@ export default {
         this.$Message.error({
           content: "获取机构的客户端设置失败,请退出后重试!",
           duration: 15,
-          closable: true
+          closable: true,
         });
         return;
       }
@@ -245,7 +245,7 @@ export default {
                 "在考试期间,请关掉" +
                 applicationNames.trim() +
                 "软件,诚信考试。",
-              duration: 2 * 24 * 60 * 60
+              duration: 2 * 24 * 60 * 60,
             });
           } else {
             that.disableLoginBtn = false;
@@ -281,7 +281,7 @@ export default {
         ...repPara,
         accountType: this.loginType,
         domain: this.schoolDomain,
-        alwaysOK: true
+        alwaysOK: true,
       });
       let data = response.data;
       // if (
@@ -316,7 +316,7 @@ export default {
             ...data,
             ...student,
             specialty: specialty.join(),
-            schoolDomain: this.schoolDomain
+            schoolDomain: this.schoolDomain,
           };
           this.updateUser(user);
           window.localStorage.setItem("user-for-reload", JSON.stringify(user));
@@ -325,7 +325,7 @@ export default {
             "_trackEvent",
             "登录页面",
             "登录",
-            this.$route.query.LogoutReason
+            this.$route.query.LogoutReason,
           ]);
           await this.checkExamInProgress();
           window._hmt.push(["_trackEvent", "登录页面", "登录成功"]);
@@ -334,12 +334,12 @@ export default {
             "_trackEvent",
             "登录页面",
             "登录失败",
-            "getStudentInfoBySession失败"
+            "getStudentInfoBySession失败",
           ]);
           this.$Message.error({
             content: "获取学生信息失败,请重试!",
             duration: 15,
-            closable: true
+            closable: true,
           });
         }
       } else {
@@ -360,7 +360,7 @@ export default {
               examingRes.maxInterruptNum
             }),正在自动交卷...`,
             duration: 15,
-            closable: true
+            closable: true,
           });
           this.$Spin.show({
             render: () => {
@@ -370,7 +370,7 @@ export default {
                   ),正在自动交卷...
                 </div>
               );
-            }
+            },
           });
           const res = await this.$http.get(
             "/api/ecs_oe_student/examControl/endExam"
@@ -379,14 +379,14 @@ export default {
             this.$router.replace({
               path: `/online-exam/exam/${examingRes.examId}/examRecordData/${
                 examingRes.examRecordDataId
-              }/end`
+              }/end`,
             });
             this.$Spin.hide();
           } else {
             this.$Message.error({
               content: "交卷失败",
               duration: 15,
-              closable: true
+              closable: true,
             });
           }
           return;
@@ -395,7 +395,7 @@ export default {
           this.$Spin.show({
             render: () => {
               return <div style="font-size: 24px">正在进入断点续考...</div>;
-            }
+            },
           });
           window._hmt.push(["_trackEvent", "登录页面", "断点续考", "重新登录"]);
           this.$router.push(
@@ -414,7 +414,7 @@ export default {
         this.$Message.error({
           content: "获取断点续考信息异常,退出登录",
           duration: 15,
-          closable: true
+          closable: true,
         });
         this.logout("?LogoutReason=登录页面获取断点续考信息异常");
         return;
@@ -427,21 +427,21 @@ export default {
       const response = await fetch(
         document.scripts[document.scripts.length - 1].src,
         {
-          headers: myHeaders
+          headers: myHeaders,
         }
       );
       if (!response.ok) {
         window._hmt.push([
           "_trackEvent",
           "登录页面",
-          "新版本发布后,客户端自动刷新"
+          "新版本发布后,客户端自动刷新",
         ]);
         location.reload(true);
       }
     },
     closeApp() {
       window.close();
-    }
+    },
   },
   computed: {
     logoPath() {
@@ -453,7 +453,7 @@ export default {
         this.$Message.error({
           content: "机构地址出错,请关闭程序后再登录。",
           duration: 15,
-          closable: true
+          closable: true,
         });
       }
       return domain;
@@ -471,8 +471,8 @@ export default {
       } else {
         return "初始密码为身份证号后6位";
       }
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 6 - 6
src/features/OfflineExam/OfflineExamHome.vue

@@ -24,7 +24,7 @@ export default {
   name: "OfflineExamHome",
   data() {
     return {
-      courses: []
+      courses: [],
     };
   },
   async mounted() {
@@ -35,7 +35,7 @@ export default {
       this.$Message.error({
         content: "获取离线考试列表失败",
         duration: 15,
-        closable: true
+        closable: true,
       });
     }
   },
@@ -55,13 +55,13 @@ export default {
         startTime: c.startTime,
         endTime: c.endTime,
         offlineFileUrl: c.offlineFileUrl,
-        paperId: c.paperId
+        paperId: c.paperId,
       }));
-    }
+    },
   },
   components: {
-    "ecs-offline-list": EcsOfflineList
-  }
+    "ecs-offline-list": EcsOfflineList,
+  },
 };
 </script>
 

+ 8 - 8
src/features/OfflineExam/OfflineExamList.vue

@@ -109,17 +109,17 @@ export default {
   data() {
     return {
       tk_server_url: TK_SERVER_URL,
-      disableDownloadPaperBtn: false
+      disableDownloadPaperBtn: false,
     };
   },
   props: {
-    courses: Array
+    courses: Array,
   },
   methods: {
     async enterExam(course) {
       // 若出错,直接报网络异常
       await this.$http.get("/api/ecs_oe_student/offlineExam/startOfflineExam", {
-        params: { examStudentId: course.examStudentId }
+        params: { examStudentId: course.examStudentId },
       });
       this.$emit("reloadList");
     },
@@ -128,7 +128,7 @@ export default {
       var user = {
         loginName: course.examStudentId,
         backUrl: window.document.location.href,
-        isOnlineExam: true
+        isOnlineExam: true,
       };
       window.name = JSON.stringify(user);
       window.location.href =
@@ -158,14 +158,14 @@ export default {
         this.user.key +
         "&$token=" +
         this.user.token;
-    }
+    },
   },
   components: {
-    "ecs-offline-exam-upload": OfflineExamUpload
+    "ecs-offline-exam-upload": OfflineExamUpload,
   },
   computed: {
-    ...globalMapState(["user", "timeDifference"])
-  }
+    ...globalMapState(["user", "timeDifference"]),
+  },
 };
 </script>
 

+ 16 - 16
src/features/OfflineExam/OfflineExamUpload.vue

@@ -42,17 +42,17 @@ export default {
     return {
       headers: {
         token: window.sessionStorage.getItem("token"),
-        key: window.localStorage.getItem("key")
+        key: window.localStorage.getItem("key"),
       },
       file: null,
       fileType: null,
       loadingStatus: false,
       uploadFileFormat: [],
-      uploadFileAccept: ""
+      uploadFileAccept: "",
     };
   },
   props: {
-    course: Object
+    course: Object,
   },
   async created() {
     const res = await this.$http.get(
@@ -104,14 +104,14 @@ export default {
             filename: file.name,
             filetype: file.type ? file.type : "Unknown/Extension missing",
             binaryFileType: getMimetype(hex),
-            hex: hex
+            hex: hex,
           });
 
           if (["application/pdf"].includes(getMimetype(hex))) {
             if (!file.name.endsWith(".pdf")) {
               this.loadingStatus = false;
               this.$Notice.warning({
-                title: "文件内容与文件的后缀不一致"
+                title: "文件内容与文件的后缀不一致",
                 // desc: file.name + " 文件是pdf文档,但文件名后缀不是.pdf!"
               });
               this.file = null;
@@ -125,7 +125,7 @@ export default {
               // this.$refs.uploadComp.fileList.splice(0);
               // this.$refs.uploadComp.fileList = [];
               this.$Notice.warning({
-                title: "文件内容与文件的后缀不一致"
+                title: "文件内容与文件的后缀不一致",
                 // desc: file.name + " 文件是zip压缩包,但文件名后缀不是.zip!"
               });
               this.file = null;
@@ -139,7 +139,7 @@ export default {
               "_trackEvent",
               "离线考试页面",
               "上传作答",
-              "文件格式非zip或pdf"
+              "文件格式非zip或pdf",
             ]);
             this.$Notice.warning({
               title: "作答文件损坏",
@@ -147,7 +147,7 @@ export default {
                 file.name +
                 " 文件无法以 " +
                 this.uploadFileFormat.join(" 或 ") +
-                " 格式读取。"
+                " 格式读取。",
             });
             this.file = null;
             this.loadingStatus = false;
@@ -165,7 +165,7 @@ export default {
       this.$Message.success({
         content: "上传成功",
         duration: 5,
-        closable: true
+        closable: true,
       });
       this.$emit("reloadList");
     },
@@ -176,7 +176,7 @@ export default {
       this.$Message.error({
         content: "上传失败",
         duration: 15,
-        closable: true
+        closable: true,
       });
     },
     handleFormatError(file) {
@@ -188,7 +188,7 @@ export default {
           file.name +
           " 文件格式不对,请选择 " +
           this.uploadFileFormat.join(" 或 ") +
-          "  文件。"
+          "  文件。",
       });
     },
     handleMaxSize(file) {
@@ -196,7 +196,7 @@ export default {
       this.loadingStatus = false;
       this.$Notice.warning({
         title: "超出文件大小限制",
-        desc: file.name + " 太大,作答文件不能超过30M."
+        desc: file.name + " 太大,作答文件不能超过30M.",
       });
     },
     handleBeforeUpload(file) {
@@ -204,7 +204,7 @@ export default {
       if (suffix.toLowerCase() !== suffix) {
         this.$Notice.error({
           title: "文件名后缀必须是小写",
-          desc: file.name + " 文件名后缀必须是小写。"
+          desc: file.name + " 文件名后缀必须是小写。",
         });
         return Promise.reject("file suffix should be lower case");
       }
@@ -213,7 +213,7 @@ export default {
         this.$Modal.confirm({
           title: "已有作答附件,是否覆盖?",
           onCancel: () => reject(-1),
-          onOk: () => resolve()
+          onOk: () => resolve(),
         });
       }).then(() => {
         if (file.type.includes("/pdf")) {
@@ -227,8 +227,8 @@ export default {
           this.fileFormatCheck(file, resolve, reject)
         );
       });
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 7 - 7
src/features/OnlineExam/Examing/ArrowNavView.vue

@@ -7,7 +7,7 @@
           :to="{
             path: `/online-exam/exam/${$route.params.examId}/examRecordData/${
               $route.params.examRecordDataId
-            }/order/${previousQuestionOrder}`
+            }/order/${previousQuestionOrder}`,
           }"
         >
           上一题
@@ -26,7 +26,7 @@
           :to="{
             path: `/online-exam/exam/${$route.params.examId}/examRecordData/${
               $route.params.examRecordDataId
-            }/order/${nextQuestionOrder}`
+            }/order/${nextQuestionOrder}`,
           }"
         >
           下一题
@@ -48,7 +48,7 @@ export default {
   },
   props: {
     previousQuestionOrder: Number,
-    nextQuestionOrder: Number
+    nextQuestionOrder: Number,
   },
   created: function() {
     window.addEventListener("keyup", this.keyup);
@@ -79,17 +79,17 @@ export default {
       this.$router.push({
         path: `/online-exam/exam/${this.$route.params.examId}/examRecordData/${
           this.$route.params.examRecordDataId
-        }/order/${this.nextQuestionOrder}`
+        }/order/${this.nextQuestionOrder}`,
       });
     },
     goToPreviousQuestion() {
       this.$router.push({
         path: `/online-exam/exam/${this.$route.params.examId}/examRecordData/${
           this.$route.params.examRecordDataId
-        }/order/${this.previousQuestionOrder}`
+        }/order/${this.previousQuestionOrder}`,
       });
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 7 - 7
src/features/OnlineExam/Examing/BooleanQuestionView.vue

@@ -68,12 +68,12 @@ export default {
   name: "BooleanQuestionView",
   data() {
     return {
-      isShowAnswer: false
+      isShowAnswer: false,
     };
   },
   props: {
     question: Object,
-    examQuestion: Object
+    examQuestion: Object,
   },
   created: function() {
     window.addEventListener("keyup", this.keyup);
@@ -111,13 +111,13 @@ export default {
       if (studentAnswer !== this.examQuestion.studentAnswer) {
         this.updateExamQuestion({
           order: this.examQuestion.order,
-          studentAnswer
+          studentAnswer,
         });
       }
     },
     showAnswer() {
       this.isShowAnswer = !this.isShowAnswer;
-    }
+    },
   },
   watch: {
     // examQuestion: function() {
@@ -131,11 +131,11 @@ export default {
     isSyncState() {
       return this.examQuestion.order == this.$route.params.order;
     },
-    studentAnswer: vm => vm.examQuestion.studentAnswer
+    studentAnswer: vm => vm.examQuestion.studentAnswer,
   },
   components: {
-    QuestionBody
-  }
+    QuestionBody,
+  },
 };
 </script>
 

+ 11 - 11
src/features/OnlineExam/Examing/ExamPaper.vue

@@ -81,12 +81,12 @@ export default {
       exam: null,
       questionGroupList: null,
       examQuestionList: null,
-      practiceType: null
+      practiceType: null,
     };
   },
   props: {
     examId: Number,
-    examRecordDataId: Number
+    examRecordDataId: Number,
   },
   async created() {
     await this.initData();
@@ -105,7 +105,7 @@ export default {
         paperStructData,
         examQuestionListData,
         examRecordDataData,
-        courseInfoData
+        courseInfoData,
       ] = await Promise.all([
         this.$http.get("/api/ecs_exam_work/exam/" + this.examId),
         this.$http.get(
@@ -123,13 +123,13 @@ export default {
         this.$http.get(
           "/api/ecs_oe_student/practice/getPracticeDetailInfo?examRecordDataId=" +
             this.examRecordDataId
-        )
+        ),
       ]);
       const [exam, paperStruct, examRecordData, courseInfo] = [
         examData.data,
         paperStructData.data,
         examRecordDataData.data,
-        courseInfoData.data
+        courseInfoData.data,
       ];
 
       let examQuestionList = examQuestionListData.data.examQuestionEntities;
@@ -142,7 +142,7 @@ export default {
         this.$Message.error({
           content: "获取试卷信息失败",
           duration: 15,
-          closable: true
+          closable: true,
         });
         return;
       }
@@ -195,7 +195,7 @@ export default {
           eq.mainNumber - 1
         ].questionWrapperList.find(q => q.questionId === eq.questionId);
         return Object.assign(eq, {
-          limitedPlayTimes: paperStructQuestion.limitedPlayTimes
+          limitedPlayTimes: paperStructQuestion.limitedPlayTimes,
         });
       });
 
@@ -228,7 +228,7 @@ export default {
           //   });
           // } else {
           Object.assign(question, {
-            eqs: qs
+            eqs: qs,
           });
           // }
         }
@@ -256,7 +256,7 @@ export default {
           questionId: questionId,
           examId: this.exam.id,
           courseCode: courseInfo.courseCode,
-          groupCode: examRecordData.examRecord.paperType
+          groupCode: examRecordData.examRecord.paperType,
         }
       );
 
@@ -319,8 +319,8 @@ export default {
           ? studentAnswer
           : studentAnswer.join("");
       return result;
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 7 - 7
src/features/OnlineExam/Examing/ExamingEnd.vue

@@ -74,7 +74,7 @@ export default {
       showObjectScore: null,
       cheatingRemark: null,
       examResult: null,
-      getResultTimes: 0
+      getResultTimes: 0,
     };
   },
   async mounted() {
@@ -103,7 +103,7 @@ export default {
           "_trackEvent",
           "考试结束页面",
           "等待分数",
-          "等待次数=" + this.waitingNumber
+          "等待次数=" + this.waitingNumber,
         ]);
         this.examResult = examResult;
       } catch (error) {
@@ -151,7 +151,7 @@ export default {
       this.$Message.error({
         content: "获取考试设置错误,请在待考列表查看成绩!",
         duration: 15,
-        closable: true
+        closable: true,
       });
       this.$router.push("/");
     }
@@ -163,16 +163,16 @@ export default {
       exam: null,
       paperStruct: null,
       examQuestionList: null,
-      questionAudioFileUrl: []
+      questionAudioFileUrl: [],
     });
   },
   computed: {
-    ...globalMapState(["user"])
+    ...globalMapState(["user"]),
     // ...mapState(["exam"])
   },
   methods: {
-    ...mapMutations(["updateExamState"])
-  }
+    ...mapMutations(["updateExamState"]),
+  },
 };
 </script>
 

+ 32 - 32
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -71,7 +71,7 @@ export default {
       showFaceId: false,
       faceEnable: false,
       timeouted: false,
-      PRODUCTION: process.env.NODE_ENV === "production"
+      PRODUCTION: process.env.NODE_ENV === "production",
     };
   },
   async created() {
@@ -93,7 +93,7 @@ export default {
         this.$Message.info({
           content: "30秒后开始活体检测",
           duration: 15,
-          closable: true
+          closable: true,
         });
       }, this.$route.query.faceVerifyMinute * 60 * 1000 - 30 * 1000); // 活体检测提醒
       this.faceIdDivTimeout = setTimeout(() => {
@@ -120,7 +120,7 @@ export default {
       this.$Message.error({
         content: "获取人脸检测设置失败",
         duration: 15,
-        closable: true
+        closable: true,
       });
       this.logout("?LogoutReason=获取人脸检测设置失败");
       return;
@@ -178,7 +178,7 @@ export default {
         this.$Message.error({
           content: "获取人脸抓拍间隔设置失败",
           duration: 15,
-          closable: true
+          closable: true,
         });
         this.logout("?LogoutReason=获取人脸抓拍间隔设置失败");
         return;
@@ -191,7 +191,7 @@ export default {
       this.$Message.error({
         content: "获取试卷信息失败,退出登录",
         duration: 15,
-        closable: true
+        closable: true,
       });
       this.logout("?LogoutReason=获取试卷信息失败");
       return;
@@ -255,7 +255,7 @@ export default {
       exam: null,
       paperStruct: null,
       examQuestionList: null,
-      questionAudioFileUrl: []
+      questionAudioFileUrl: [],
     });
     this.$Modal.remove();
   },
@@ -268,20 +268,20 @@ export default {
       "updateExamQuestion",
       "toggleSnapNow",
       "updateExamResult",
-      "resetExamQuestionDirty"
+      "resetExamQuestionDirty",
     ]),
     async initData() {
       const [
         examData,
         paperStructData,
-        examQuestionListData
+        examQuestionListData,
       ] = await Promise.all([
         this.$http.get("/api/ecs_exam_work/exam/" + this.$route.params.examId),
         this.$http.get(
           "/api/ecs_oe_student/examRecordPaperStruct/getExamRecordPaperStruct?examRecordDataId=" +
             this.$route.params.examRecordDataId
         ),
-        this.$http.get("/api/ecs_oe_student/examQuestion/findExamQuestionList")
+        this.$http.get("/api/ecs_oe_student/examQuestion/findExamQuestionList"),
       ]);
       const [exam, paperStruct] = [examData.data, paperStructData.data];
 
@@ -295,7 +295,7 @@ export default {
         this.$Message.error({
           content: "获取试卷信息失败",
           duration: 15,
-          closable: true
+          closable: true,
         });
         this.logout("?LogoutReason=获取试卷信息失败");
         return;
@@ -370,7 +370,7 @@ export default {
           eq.mainNumber - 1
         ].questionWrapperList.find(q => q.questionId === eq.questionId);
         return Object.assign(eq, {
-          limitedPlayTimes: paperStructQuestion.limitedPlayTimes
+          limitedPlayTimes: paperStructQuestion.limitedPlayTimes,
         });
       });
 
@@ -379,7 +379,7 @@ export default {
         paperStruct: paperStruct,
         examQuestionList: examQuestionList,
         allAudioPlayTimes: JSON.parse(examQuestionList[0].audioPlayTimes) || [],
-        questionAudioFileUrl: []
+        questionAudioFileUrl: [],
       });
       // console.log(examQuestionList);
       // console.log(examQuestionList.find(v => v.answerType === "SINGLE_AUDIO"));
@@ -414,7 +414,7 @@ export default {
           return Object.assign(
             {
               order: eq.order,
-              studentAnswer: eq.studentAnswer
+              studentAnswer: eq.studentAnswer,
             },
             eq.audioPlayTimes && { audioPlayTimes: eq.audioPlayTimes },
             eq.isSign && { isSign: eq.isSign }
@@ -432,7 +432,7 @@ export default {
           this.$Message.error({
             content: "提交答案失败",
             duration: 15,
-            closable: true
+            closable: true,
           });
           window._hmt.push([
             "_trackEvent",
@@ -440,7 +440,7 @@ export default {
             "提交答案失败",
             error.message +
               " |||| " +
-              (((error.response || {}).data || {}).desc || "")
+              (((error.response || {}).data || {}).desc || ""),
           ]);
           this.serverLog(
             "debug/S-008001",
@@ -465,7 +465,7 @@ export default {
         this.$Message.info({
           content: `考试开始${this.exam.freezeTime}分钟后才允许交卷。`,
           duration: 5,
-          closable: true
+          closable: true,
         });
         return;
       }
@@ -480,14 +480,14 @@ export default {
       this.$Modal.confirm({
         title: "确认交卷",
         content: `<p>已答题目:${answered}</p><p>未答题目:${unanswered}</p><p>标记题目:${signed}</p>`,
-        onOk: this.realSubmitPaper
+        onOk: this.realSubmitPaper,
       });
     },
     async realSubmitPaper() {
       this.$Spin.show({
         render: () => {
           return <div style="font-size: 44px">正在交卷,请耐心等待...</div>;
-        }
+        },
       });
       if (this.faceEnable) {
         this.serverLog("debug/S-002001", "交卷前抓拍");
@@ -525,7 +525,7 @@ export default {
         );
         if (res.status === 200) {
           this.$router.replace({
-            path: `/online-exam/exam/${examId}/examRecordData/${examRecordDataId}/end`
+            path: `/online-exam/exam/${examId}/examRecordData/${examRecordDataId}/end`,
           });
           // 确保交卷成功后,不会再次交卷
           this.submitLock = true;
@@ -535,7 +535,7 @@ export default {
           this.$Message.error({
             content: "交卷失败",
             duration: 15,
-            closable: true
+            closable: true,
           });
         }
         this.submitLock = false;
@@ -543,7 +543,7 @@ export default {
         this.$Message.error({
           content: "交卷失败",
           duration: 15,
-          closable: true
+          closable: true,
         });
         console.log(e);
       }
@@ -564,10 +564,10 @@ export default {
         "_trackEvent",
         "正在考试页面",
         "页面加载失败",
-        "reload"
+        "reload",
       ]);
       window.location.reload();
-    }
+    },
   },
   computed: {
     ...mapState([
@@ -578,7 +578,7 @@ export default {
       "snapProcessingCount",
       "shouldSubmitPaper",
       "remainTime",
-      "questionAudioFileUrl"
+      "questionAudioFileUrl",
     ]),
     previousQuestionOrder: vm => {
       if (vm.examQuestion().order > 1) {
@@ -593,7 +593,7 @@ export default {
       } else {
         return null;
       }
-    }
+    },
   },
   watch: {
     $route: function() {
@@ -615,31 +615,31 @@ export default {
               {
                 examRecordDataId,
                 filePath: q.audioFileUrl,
-                order: q.order
+                order: q.order,
               }
             )
             .then(() => {
               that.updateExamQuestion({
                 order: q.order,
-                studentAnswer: q.audioFileUrl
+                studentAnswer: q.audioFileUrl,
               });
               q.saved = true;
               this.$Message.info({
                 content: "音频题作答已更新",
                 duration: 5,
-                closable: true
+                closable: true,
               });
             })
             .catch(() => {
               this.$Message.error({
                 content: "更新音频题答案失败!",
                 duration: 15,
-                closable: true
+                closable: true,
               });
             });
         }
       }
-    }
+    },
     // examQuestionList(val, oldVal) {
     //   // console.log(val, oldVal);
     // }
@@ -653,8 +653,8 @@ export default {
     QuestionNavView,
     FaceRecognition,
     FaceId,
-    FaceTracking
-  }
+    FaceTracking,
+  },
 };
 </script>
 

+ 17 - 17
src/features/OnlineExam/Examing/FaceId.vue

@@ -54,7 +54,7 @@
 <script>
 import {
   FACEID_LINENESS_URL,
-  VUE_APP_WK_SERVER_SOCKET
+  VUE_APP_WK_SERVER_SOCKET,
 } from "@/constants/constants.js";
 
 export default {
@@ -64,7 +64,7 @@ export default {
       showIframe: false,
       redoBtnShow: false,
       timeCount: 60,
-      redoBtnMsg: ""
+      redoBtnMsg: "",
     };
   },
   mounted() {
@@ -126,7 +126,7 @@ export default {
       window._hmt.push([
         "_trackEvent",
         "活体检测弹出框",
-        "FaceID页面iframe加载成功"
+        "FaceID页面iframe加载成功",
       ]);
       try {
         var iframe = document.getElementById("myFrame");
@@ -167,7 +167,7 @@ export default {
               this.$Message.error({
                 content: "人脸检测超时,系统退出,请重新登录",
                 duration: 30,
-                closable: true
+                closable: true,
               });
             }
             this.logout(
@@ -195,13 +195,13 @@ export default {
               window._hmt.push([
                 "_trackEvent",
                 "活体检测弹出框",
-                "活体检测失败"
+                "活体检测失败",
               ]);
             } else {
               window._hmt.push([
                 "_trackEvent",
                 "活体检测弹出框",
-                "活体检测成功"
+                "活体检测成功",
               ]);
             }
           })
@@ -209,7 +209,7 @@ export default {
             this.$Message.error({
               content: "上传人脸检测结果出错!",
               duration: 15,
-              closable: true
+              closable: true,
             });
             this.logout("?LogoutReason=上传人脸检测结果出错!");
           });
@@ -224,7 +224,7 @@ export default {
             this.$Message.error({
               content: "第一次人脸检测超时,检测失败,系统退出,请重新登录",
               duration: 30,
-              closable: true
+              closable: true,
             });
             this.logout(
               "?LogoutReason=第一次活体检测超时,检测失败,系统退出,请重新登录"
@@ -233,7 +233,7 @@ export default {
             this.$Message.error({
               content: "第一次人脸检测失败,系统退出,请重新登录",
               duration: 30,
-              closable: true
+              closable: true,
             });
             this.logout(
               "?LogoutReason=第一次活体检测失败,系统退出,请重新登录"
@@ -242,14 +242,14 @@ export default {
             this.$Message.error({
               content: "人脸检测不合格,结束考试",
               duration: 30,
-              closable: true
+              closable: true,
             });
             this.faceTestEndHandle("FAILED");
           } else if (receivedMsg.verifyResult == "VERIFY_SUCCESS") {
             this.$Message.info({
               content: "人脸检测成功,请继续完成考试",
               duration: 15,
-              closable: true
+              closable: true,
             });
             this.faceTestEndHandle("SUCCESS");
           }
@@ -258,14 +258,14 @@ export default {
             this.$Message.info({
               content: "人脸检测成功,请继续完成考试",
               duration: 15,
-              closable: true
+              closable: true,
             });
             this.faceTestEndHandle("SUCCESS");
           } else {
             this.$Message.error({
               content: "人脸检测不合格,结束考试",
               duration: 30,
-              closable: true
+              closable: true,
             });
             this.faceTestEndHandle("FAILED");
           }
@@ -308,7 +308,7 @@ export default {
         this.$Message.error({
           content: "获取底照token失败,请重新登录!",
           duration: 15,
-          closable: true
+          closable: true,
         });
         this.logout("?LogoutReason=获取底照token失败,请重新登录!");
         return;
@@ -319,7 +319,7 @@ export default {
         this.$Message.error({
           content: "您上传的底照不适合做活体检测,请联系老师!",
           duration: 15,
-          closable: true
+          closable: true,
         });
         this.logout("?LogoutReason=您上传的底照不适合做活体检测,请联系老师!");
         return;
@@ -354,7 +354,7 @@ export default {
           }, 300); // 延迟确保能删除footer
         }
       }, 500);
-    }
-  }
+    },
+  },
 };
 </script>

+ 4 - 4
src/features/OnlineExam/Examing/FaceTracking.vue

@@ -29,7 +29,7 @@ export default {
       tracker.setEdgesDensity(0.1);
 
       that.trackerTask = window.tracking.track("#video", tracker, {
-        camera: false
+        camera: false,
       });
 
       tracker.on("track", function(event) {
@@ -57,13 +57,13 @@ export default {
             that.$Message.warning({
               content: "请独立完成考试",
               duration: 5,
-              closable: true
+              closable: true,
             });
           } else {
             that.$Message.warning({
               content: "请调整坐姿,诚信考试",
               duration: 5,
-              closable: true
+              closable: true,
             });
           }
           trackWarnings = 0;
@@ -98,7 +98,7 @@ export default {
   beforeDestroy() {
     clearInterval(this.trackHeadInterval);
     this.trackerTask.stop();
-  }
+  },
 };
 </script>
 

+ 9 - 9
src/features/OnlineExam/Examing/FillBlankQuestionView.vue

@@ -64,12 +64,12 @@ export default {
     return {
       studentAnswer: "",
       questionBody: "",
-      isShowAnswer: false
+      isShowAnswer: false,
     };
   },
   props: {
     question: Object,
-    examQuestion: Object
+    examQuestion: Object,
   },
   created() {
     this.prepareData();
@@ -118,14 +118,14 @@ export default {
     resetAnswer() {
       this.updateExamQuestion({
         order: this.examQuestion.order,
-        studentAnswer: null
+        studentAnswer: null,
       });
       this.examQuestion.studentAnswer = null;
       this.prepareData();
     },
     showAnswer() {
       this.isShowAnswer = !this.isShowAnswer;
-    }
+    },
   },
   watch: {
     // examQuestion: function() {
@@ -147,10 +147,10 @@ export default {
       if (realAnswer !== this.examQuestion.studentAnswer) {
         this.updateExamQuestion({
           order: this.examQuestion.order,
-          studentAnswer: realAnswer
+          studentAnswer: realAnswer,
         });
       }
-    }
+    },
   },
   computed: {
     isSyncState() {
@@ -171,11 +171,11 @@ export default {
           .map((v, i) => `${i + 1}、${v}<br>`)
           .join("")
       );
-    }
+    },
   },
   components: {
-    QuestionBody
-  }
+    QuestionBody,
+  },
 };
 </script>
 

+ 9 - 9
src/features/OnlineExam/Examing/MultipleQuestionView.vue

@@ -73,12 +73,12 @@ export default {
       questionBody: this.question.body,
       optionName,
       studentAnswer: this.examQuestion.studentAnswer || "",
-      isShowAnswer: false
+      isShowAnswer: false,
     };
   },
   props: {
     question: Object,
-    examQuestion: Object
+    examQuestion: Object,
   },
   created: function() {
     window.addEventListener("keyup", this.keyup);
@@ -148,18 +148,18 @@ export default {
       if (realAnswer !== this.examQuestion.studentAnswer) {
         this.updateExamQuestion({
           order: this.examQuestion.order,
-          studentAnswer: realAnswer
+          studentAnswer: realAnswer,
         });
       }
     },
     showAnswer() {
       this.isShowAnswer = !this.isShowAnswer;
-    }
+    },
   },
   watch: {
     examQuestion: function() {
       this.studentAnswer = this.examQuestion.studentAnswer || "";
-    }
+    },
   },
   computed: {
     isSyncState() {
@@ -172,7 +172,7 @@ export default {
             this.examQuestion.optionPermutation[i]
           ],
           oldIndex: "" + this.examQuestion.optionPermutation[i],
-          name: optionName[i]
+          name: optionName[i],
         };
       });
     },
@@ -193,11 +193,11 @@ export default {
           .map(v => v.name)
           .join("")
       );
-    }
+    },
   },
   components: {
-    QuestionBody
-  }
+    QuestionBody,
+  },
 };
 </script>
 

+ 3 - 3
src/features/OnlineExam/Examing/OverallProgress.vue

@@ -19,7 +19,7 @@ export default {
     return {};
   },
   props: {
-    examQuestionList: Array
+    examQuestionList: Array,
   },
   async mounted() {},
   computed: {
@@ -34,8 +34,8 @@ export default {
       return `${
         this.examQuestionList.filter(q => q.studentAnswer !== null).length
       } / ${this.examQuestionList.length}`;
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 6 - 6
src/features/OnlineExam/Examing/QuestionBody.vue

@@ -47,12 +47,12 @@ export default {
     return {
       questionDetail: null,
       audioPlayTimes: null,
-      audioInPlay: new Set()
+      audioInPlay: new Set(),
     };
   },
   props: {
     questionBody: String,
-    examQuestion: Object
+    examQuestion: Object,
   },
   mounted() {
     // console.log(
@@ -220,10 +220,10 @@ export default {
             .times,
         0
       );
-    }
+    },
   },
   computed: {
-    ...mapState(["allAudioPlayTimes"])
+    ...mapState(["allAudioPlayTimes"]),
   },
   watch: {
     questionBody() {
@@ -231,8 +231,8 @@ export default {
     },
     examQuestion() {
       this.parseQuestion();
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 4 - 4
src/features/OnlineExam/Examing/QuestionFilters.vue

@@ -37,11 +37,11 @@ export default {
     return {};
   },
   props: {
-    examQuestionList: Array
+    examQuestionList: Array,
   },
   async mounted() {},
   methods: {
-    ...mapMutations(["updateQuestionFilter"])
+    ...mapMutations(["updateQuestionFilter"]),
   },
   computed: {
     ...mapState(["questionFilterType"]),
@@ -56,8 +56,8 @@ export default {
     },
     unanswered: function() {
       return this.examQuestionList.filter(q => q.studentAnswer === null).length;
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 3 - 3
src/features/OnlineExam/Examing/QuestionIndex.vue

@@ -11,13 +11,13 @@
 export default {
   name: "QuestionIndex",
   props: {
-    examQuestion: Object
+    examQuestion: Object,
   },
   computed: {
     sectionChinese() {
       return this.examQuestion.mainNumber.toLocaleString("zh-u-nu-hanidec");
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 6 - 6
src/features/OnlineExam/Examing/QuestionNavView.vue

@@ -20,7 +20,7 @@
                     $route.params.examId
                   }/examRecordData/${$route.params.examRecordDataId}/order/${
                     getQuestionNum(section, index2).order
-                  }`
+                  }`,
                 }"
                 >{{ index2 + 1 }}</router-link
               >
@@ -42,7 +42,7 @@ export default {
     return {};
   },
   props: {
-    paperStruct: Object
+    paperStruct: Object,
   },
   mounted() {},
   methods: {
@@ -102,16 +102,16 @@ export default {
         "current-question": isCurrentQuestion,
         "star-question": this.getQuestionNum(section, index2).isSign,
         "is-answered":
-          this.getQuestionNum(section, index2).studentAnswer !== null
+          this.getQuestionNum(section, index2).studentAnswer !== null,
       };
     },
     sectionQuestions(section) {
       return this.examQuestionList.filter(q => q.mainNumber === section + 1);
-    }
+    },
   },
   computed: {
-    ...mapState(["questionFilterType", "examQuestionList"])
-  }
+    ...mapState(["questionFilterType", "examQuestionList"]),
+  },
 };
 </script>
 

+ 9 - 9
src/features/OnlineExam/Examing/QuestionView.vue

@@ -116,11 +116,11 @@ export default {
   data() {
     return {
       parentQuestionBody: null,
-      question: null
+      question: null,
     };
   },
   props: {
-    examQuestion: Object
+    examQuestion: Object,
   },
   created() {
     this.updateQuestion();
@@ -165,7 +165,7 @@ export default {
 
       this.updateExamQuestion({
         order: currentExamQuestion.order,
-        getQuestionContent: true
+        getQuestionContent: true,
       });
 
       const transferWellNumberAndTrustInBody = function(repQuestion) {
@@ -252,17 +252,17 @@ export default {
     async toggleSign() {
       this.updateExamQuestion({
         order: this.$route.params.order,
-        isSign: !this.examQuestion.isSign
+        isSign: !this.examQuestion.isSign,
       });
-    }
+    },
   },
   computed: {
-    ...mapState(["examQuestionList"])
+    ...mapState(["examQuestionList"]),
   },
   watch: {
     $route: function() {
       this.updateQuestion();
-    }
+    },
   },
   components: {
     QuestionIndex,
@@ -271,8 +271,8 @@ export default {
     MultipleQuestionView,
     BooleanQuestionView,
     FillBlankQuestionView,
-    TextQuestionView
-  }
+    TextQuestionView,
+  },
 };
 </script>
 

+ 9 - 9
src/features/OnlineExam/Examing/RemainTime.vue

@@ -11,7 +11,7 @@ export default {
   name: "RemainTime",
   data() {
     return {
-      remainTime: null
+      remainTime: null,
     };
   },
   async mounted() {
@@ -53,7 +53,7 @@ export default {
           this.$Message.error({
             content: "服务器返回的心跳结果不是数字",
             duration: 15,
-            closable: true
+            closable: true,
           });
         }
       } catch (error) {
@@ -67,7 +67,7 @@ export default {
             "_trackEvent",
             "正在考试页面",
             "心跳",
-            "失败-会话过期"
+            "失败-会话过期",
           ]);
           this.serverLog(
             "debug/S-008002",
@@ -89,7 +89,7 @@ export default {
             "_trackEvent",
             "正在考试页面",
             "心跳",
-            "失败10次-退出"
+            "失败10次-退出",
           ]);
           this.$Modal.error({
             title: "网络连接异常",
@@ -100,7 +100,7 @@ export default {
                   localStorage.getItem("domain") +
                   "?LogoutReason=心跳失败10次-退出"
               );
-            }
+            },
           });
           return;
         }
@@ -114,12 +114,12 @@ export default {
       clearInterval(this.heartbeatInterval);
       clearInterval(this.remainTimeInterval);
       clearTimeout(this.retryHeartbeatTimeout);
-    }
+    },
   },
   computed: {
     remainTimeFormatted: function() {
       return moment.utc(this.remainTime).format("HH:mm:ss");
-    }
+    },
   },
   watch: {
     remainTime(val) {
@@ -127,7 +127,7 @@ export default {
         this.setShouldSubmitPaper();
       }
       this.updateRemainTime(val);
-    }
-  }
+    },
+  },
 };
 </script>

+ 9 - 9
src/features/OnlineExam/Examing/SingleQuestionView.vue

@@ -79,12 +79,12 @@ export default {
       questionBody: this.question.body,
       optionName,
       studentAnswer: this.examQuestion.studentAnswer,
-      isShowAnswer: false
+      isShowAnswer: false,
     };
   },
   props: {
     question: Object,
-    examQuestion: Object
+    examQuestion: Object,
   },
   created: function() {
     window.addEventListener("keyup", this.keyup);
@@ -127,13 +127,13 @@ export default {
       if (studentAnswer !== this.examQuestion.studentAnswer) {
         this.updateExamQuestion({
           order: this.examQuestion.order,
-          studentAnswer
+          studentAnswer,
         });
       }
     },
     showAnswer() {
       this.isShowAnswer = !this.isShowAnswer;
-    }
+    },
   },
   watch: {
     examQuestion: function(examQuestion) {
@@ -141,7 +141,7 @@ export default {
     },
     question(question) {
       this.questionBody = question.body;
-    }
+    },
   },
   computed: {
     isSyncState() {
@@ -154,7 +154,7 @@ export default {
             this.examQuestion.optionPermutation[i]
           ],
           oldIndex: "" + this.examQuestion.optionPermutation[i],
-          name: optionName[i]
+          name: optionName[i],
         };
       });
     },
@@ -175,11 +175,11 @@ export default {
           .map(v => v.name)
           .join("")
       );
-    }
+    },
   },
   components: {
-    QuestionBody
-  }
+    QuestionBody,
+  },
 };
 </script>
 

+ 9 - 9
src/features/OnlineExam/Examing/TextQuestionView.vue

@@ -152,12 +152,12 @@ export default {
       isShowAnswer: false,
       answerDivKey: Math.random(),
       qrValue: "",
-      qrScanned: false
+      qrScanned: false,
     };
   },
   props: {
     question: Object,
-    examQuestion: Object
+    examQuestion: Object,
   },
   created() {
     this.fetchQRCode();
@@ -249,7 +249,7 @@ export default {
       // );
       this.photoAnswers = this.photoAnswers.filter(v => v !== url);
       // console.log(this.photoAnswers);
-    }
+    },
   },
   watch: {
     examQuestion() {
@@ -286,10 +286,10 @@ export default {
       if (realAnswer !== this.examQuestion.studentAnswer) {
         this.updateExamQuestion({
           order: this.examQuestion.order,
-          studentAnswer: realAnswer
+          studentAnswer: realAnswer,
         });
       }
-    }
+    },
   },
   computed: {
     ...mapState(["questionQrCode", "questionQrCodeScanned"]),
@@ -328,14 +328,14 @@ export default {
             ele.innerHTML +
             `<div class='photo-answers-block'>${imageStr.join("")}</div>`;
         }
-      }
-    }
+      },
+    },
   },
   components: {
     QuestionBody,
     UploadPhotos,
-    qrcode: VueQrcode
-  }
+    qrcode: VueQrcode,
+  },
 };
 </script>
 

+ 10 - 10
src/features/OnlineExam/Examing/UploadPhotos.vue

@@ -78,7 +78,7 @@ export default {
       uploadList: [],
       uploadUrl: "",
       headers: {},
-      format: ["jpg", "jpeg", "png"]
+      format: ["jpg", "jpeg", "png"],
     };
   },
   methods: {
@@ -99,14 +99,14 @@ export default {
     handleFormatError(file) {
       this.$Notice.warning({
         title: "只接受jpg/jpeg/png图片文件",
-        desc: file.name
+        desc: file.name,
       });
     },
     handleMaxSize(file) {
       const MAX_UPLOAD_SIZE = 5;
       this.$Notice.warning({
         title: "文件过大",
-        desc: file.name + `超过${MAX_UPLOAD_SIZE}M.`
+        desc: file.name + `超过${MAX_UPLOAD_SIZE}M.`,
       });
     },
     fileFormatCheck(file, resolve, reject) {
@@ -145,7 +145,7 @@ export default {
             filename: file.name,
             filetype: file.type ? file.type : "Unknown/Extension missing",
             binaryFileType: getMimetype(hex),
-            hex: hex
+            hex: hex,
           });
 
           if (
@@ -156,7 +156,7 @@ export default {
             console.log("binary file type check: not zip or pdf");
             this.$Notice.warning({
               title: "文件损坏",
-              desc: file.name + " 文件无法以 " + "png/jpg/jpeg" + " 格式读取。"
+              desc: file.name + " 文件无法以 " + "png/jpg/jpeg" + " 格式读取。",
             });
             this.loadingStatus = false;
             reject("作答文件损坏");
@@ -180,7 +180,7 @@ export default {
       const check = this.uploadList.length < MAX_UPLOADS_NUM;
       if (!check) {
         this.$Notice.warning({
-          title: `最多上传${MAX_UPLOADS_NUM}张照片。`
+          title: `最多上传${MAX_UPLOADS_NUM}张照片。`,
         });
         // return false;
         return Promise.resolve(false);
@@ -219,7 +219,7 @@ export default {
           examRecordDataId,
           order,
           fileSuffix,
-          fileMd5
+          fileMd5,
         },
         { headers: { "content-type": "application/x-www-form-urlencoded" } }
       );
@@ -227,16 +227,16 @@ export default {
       // console.log(res);
       this.headers = {
         policy: res.data.policy,
-        authorization: res.data.signature
+        authorization: res.data.signature,
       };
       this.uploadUrl = res.data.uploadUrl;
       this.resultUrl = res.data.upyunFileDomain + res.data.filePath;
       return check;
-    }
+    },
   },
   mounted() {
     this.uploadList = this.$refs.upload.fileList;
-  }
+  },
 };
 </script>
 <style scoped>

+ 9 - 9
src/features/OnlineExam/Examing/ws.js

@@ -36,13 +36,13 @@ export function openWS({ examRecordDataId }) {
             Message.error({
               content: "Websocket重连失败",
               duration: 5,
-              closable: true
+              closable: true,
             });
           }
           window._hmt.push([
             "_trackEvent",
             "websocket",
-            "连接被关闭后-准备连接"
+            "连接被关闭后-准备连接",
           ]);
           openWS({ examRecordDataId });
         }, RECONNECT_INTERVAL);
@@ -62,7 +62,7 @@ export function openWS({ examRecordDataId }) {
         Message.error({
           content: "Websocket重连失败",
           duration: 5,
-          closable: true
+          closable: true,
         });
       }
       window._hmt.push(["_trackEvent", "websocket", "连接错误后-重新连接"]);
@@ -80,7 +80,7 @@ function heartbeat() {
   heartbeatId = setInterval(() => {
     ws.send(
       JSON.stringify({
-        eventType: "HEARTBEAT"
+        eventType: "HEARTBEAT",
       })
     );
   }, HEARTBEAT_INTERVAL);
@@ -96,7 +96,7 @@ export function getQRCode(order) {
     ws.send(
       JSON.stringify({
         eventType: "GET_QR_CODE",
-        order
+        order,
       })
     );
     return true;
@@ -112,7 +112,7 @@ function processWSMessage(event) {
     Message.error({
       content: res.errorMessage,
       duration: 10,
-      closable: true
+      closable: true,
     });
     return;
   }
@@ -125,14 +125,14 @@ function processWSMessage(event) {
       window._hmt.push(["_trackEvent", "websocket", "获得二维码"]);
       store.commit("examingHomeModule/setQuestionQrCode", {
         qrCode: res.data.qrCode,
-        order: res.data.order
+        order: res.data.order,
       });
       break;
     case "SCAN_QR_CODE":
       console.log("wx scanned qrcode", res);
       window._hmt.push(["_trackEvent", "websocket", "二维码被扫描"]);
       store.commit("examingHomeModule/setQuestionQrCodeScanned", {
-        order: res.data.order
+        order: res.data.order,
       });
       break;
     case "GET_AUDIO_ANSWER":
@@ -140,7 +140,7 @@ function processWSMessage(event) {
       window._hmt.push(["_trackEvent", "websocket", "获得音频地址"]);
       store.commit("examingHomeModule/setQuestionAudioFileUrl", {
         order: res.data.order,
-        audioFileUrl: res.data.audioFileUrl
+        audioFileUrl: res.data.audioFileUrl,
       });
       break;
     case "SYSTEM_ERROR":

+ 12 - 12
src/features/OnlineExam/OnlineExamFaceCheckModal.vue

@@ -78,15 +78,15 @@ export default {
   data() {
     return {
       userPhoto: this.$store.state.user.photoPath,
-      closeCamera: false
+      closeCamera: false,
     };
   },
   props: {
     open: Boolean,
-    course: Object
+    course: Object,
   },
   computed: {
-    ...mapState(["faceCheckModalOpen"])
+    ...mapState(["faceCheckModalOpen"]),
   },
   methods: {
     ...mapMutations(["toggleFaceCheckModal"]),
@@ -108,13 +108,13 @@ export default {
         this.$Message.error({
           content: "人脸比对失败",
           duration: 15,
-          closable: true
+          closable: true,
         });
         window._hmt.push([
           "_trackEvent",
           "在线考试列表页面",
           "人脸比对框",
-          "比对失败"
+          "比对失败",
         ]);
         if (!this.course.faceCheck) {
           this.toggleFaceCheckModal(false);
@@ -127,7 +127,7 @@ export default {
                 `/online-exam/exam/${
                   this.course.examId
                 }/overview?examStudentId=${this.course.examStudentId}`
-              )
+              ),
           });
         }
         return;
@@ -135,19 +135,19 @@ export default {
       this.$Message.success({
         content: "人脸比对成功",
         duration: 5,
-        closable: true
+        closable: true,
       });
       window._hmt.push([
         "_trackEvent",
         "在线考试列表页面",
         "人脸比对框",
-        "比对成功"
+        "比对成功",
       ]);
       window._hmt.push([
         "_trackEvent",
         "在线考试列表页面",
         "进入考试",
-        "人脸检测成功"
+        "人脸检测成功",
       ]);
       this.toggleFaceCheckModal(false);
       this.$router.push(
@@ -155,11 +155,11 @@ export default {
           this.course.examStudentId
         }`
       );
-    }
+    },
   },
   components: {
-    FaceRecognition
-  }
+    FaceRecognition,
+  },
 };
 </script>
 

+ 4 - 4
src/features/OnlineExam/OnlineExamHome.vue

@@ -26,7 +26,7 @@ export default {
     return {
       previousUrl: "",
       autoCloseModal: 10,
-      courses: []
+      courses: [],
     };
   },
   beforeRouteEnter(to, from, next) {
@@ -57,7 +57,7 @@ export default {
           ),
           onOk: () => {
             clearInterval(this.interval);
-          }
+          },
         });
         this.interval = setInterval(() => {
           this.autoCloseModal--;
@@ -82,8 +82,8 @@ export default {
   },
   components: {
     "ecs-online-list": EcsOnlineList,
-    PhoneVerifyForDD
-  }
+    PhoneVerifyForDD,
+  },
 };
 </script>
 

+ 19 - 19
src/features/OnlineExam/OnlineExamList.vue

@@ -81,11 +81,11 @@ export default {
       now: new Date(),
       selectedCourse: null,
       spinShow: false,
-      processingMessage: ""
+      processingMessage: "",
     };
   },
   props: {
-    courses: Array
+    courses: Array,
   },
   created() {
     this.getNow();
@@ -120,7 +120,7 @@ export default {
               examingRes.maxInterruptNum
             }),正在自动交卷...`,
             duration: 30,
-            closable: true
+            closable: true,
           });
           this.$Spin.show({
             render: () => {
@@ -130,7 +130,7 @@ export default {
                   ),正在自动交卷...
                 </div>
               );
-            }
+            },
           });
           const res = await this.$http.get(
             "/api/ecs_oe_student/examControl/endExam"
@@ -140,14 +140,14 @@ export default {
             this.$router.replace({
               path: `/online-exam/exam/${examingRes.examId}/examRecordData/${
                 examingRes.examRecordDataId
-              }/end`
+              }/end`,
             });
             this.$Spin.hide();
           } else {
             this.$Message.error({
               content: "交卷失败",
               duration: 15,
-              closable: true
+              closable: true,
             });
           }
           return;
@@ -158,12 +158,12 @@ export default {
             "_trackEvent",
             "在线考试列表页面",
             "断点续考",
-            "概览页返回"
+            "概览页返回",
           ]);
           this.$Spin.show({
             render: () => {
               return <div style="font-size: 24px">正在进入断点续考...</div>;
-            }
+            },
           });
           this.$router.push(
             `/online-exam/exam/${examingRes.examId}/examRecordData/${
@@ -180,7 +180,7 @@ export default {
         this.$Message.error({
           content: "获取断点续考信息异常",
           duration: 15,
-          closable: true
+          closable: true,
         });
         return true;
       }
@@ -202,7 +202,7 @@ export default {
           this.$Message.error({
             content: "IP受限,请到中心指定地点进行考试!",
             duration: 15,
-            closable: true
+            closable: true,
           });
           return;
         }
@@ -210,7 +210,7 @@ export default {
         this.$Message.error({
           content: "查询IP限制出错!",
           duration: 15,
-          closable: true
+          closable: true,
         });
         this.spinShow = false;
         return;
@@ -241,7 +241,7 @@ export default {
           this.$Message.error({
             content: "查询考试的人脸检测设置属性出错!",
             duration: 15,
-            closable: true
+            closable: true,
           });
           return;
         }
@@ -265,7 +265,7 @@ export default {
             this.$Message.error({
               content: "查询检测底照是否满足活体检测标准的接口出错!",
               duration: 15,
-              closable: true
+              closable: true,
             });
             return;
           }
@@ -280,7 +280,7 @@ export default {
           "_trackEvent",
           "在线考试列表页面",
           "人脸识别框",
-          "弹出框"
+          "弹出框",
         ]);
         this.toggleFaceCheckModal(true);
       } else {
@@ -289,7 +289,7 @@ export default {
           "_trackEvent",
           "在线考试列表页面",
           "进入考试",
-          "无人脸检测"
+          "无人脸检测",
         ]);
         this.$router.push(
           `/online-exam/exam/${course.examId}/overview?examStudentId=${
@@ -301,16 +301,16 @@ export default {
     // eslint-disable-next-line
     async faceCheckResultCallback(course, faceMatched) {
       // if faceMatched
-    }
+    },
   },
   computed: {
     ...globalMapState(["user", "timeDifference"]),
-    ...mapState(["faceCheckModalOpen"])
+    ...mapState(["faceCheckModalOpen"]),
   },
   components: {
     "ecs-online-exam-result-list": OnlineExamResultList,
-    OnlineExamFaceCheckModal
-  }
+    OnlineExamFaceCheckModal,
+  },
 };
 </script>
 

+ 4 - 4
src/features/OnlineExam/OnlineExamOverview.vue

@@ -61,7 +61,7 @@ export default {
       startInfo: null,
       paperStruct: null,
       remainTime: TOTAL_READ_TIME,
-      isForceRead: true
+      isForceRead: true,
     };
   },
   async mounted() {
@@ -114,7 +114,7 @@ export default {
   computed: {
     remainTimeFormatted: function() {
       return moment.utc(this.remainTime * 1000).format("HH:mm:ss");
-    }
+    },
   },
   methods: {
     goToPaper: function() {
@@ -126,8 +126,8 @@ export default {
             ? `?faceVerifyMinute=${this.startInfo.faceVerifyMinute}`
             : "")
       );
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 4 - 4
src/features/OnlineExam/OnlineExamResultList.vue

@@ -30,12 +30,12 @@
 export default {
   name: "EcsOnlineExamResultList",
   props: {
-    examStudentId: Number
+    examStudentId: Number,
   },
   data() {
     return {
       loading: true,
-      results: []
+      results: [],
     };
   },
   async mounted() {
@@ -52,10 +52,10 @@ export default {
       this.$Message.error({
         content: "查询客观分列表出错!",
         duration: 15,
-        closable: true
+        closable: true,
       });
     }
-  }
+  },
 };
 </script>
 

+ 6 - 6
src/features/OnlineExam/PhoneVerifyForDD.vue

@@ -63,7 +63,7 @@ export default {
       step: "1",
       code: "",
       remainTime: 0,
-      btnText: "发送验证码"
+      btnText: "发送验证码",
     };
   },
   async mounted() {
@@ -84,7 +84,7 @@ export default {
         this.$Message.error({
           content: "发送验证码失败,请重试!",
           duration: 15,
-          closable: true
+          closable: true,
         });
         return;
       }
@@ -114,14 +114,14 @@ export default {
         this.$Message.error({
           content: "验证手机号接口失败,请重试!",
           duration: 15,
-          closable: true
+          closable: true,
         });
       }
-    }
+    },
   },
   computed: {
-    ...globalMapState(["user"])
-  }
+    ...globalMapState(["user"]),
+  },
 };
 </script>
 

+ 7 - 7
src/features/OnlinePractice/OnlinePracticeHome.vue

@@ -45,7 +45,7 @@ export default {
     return {
       examId: null,
       examList: [],
-      courses: []
+      courses: [],
     };
   },
   async mounted() {
@@ -79,7 +79,7 @@ export default {
       this.$Message.error({
         content: "查询练习列表失败!",
         duration: 15,
-        closable: true
+        closable: true,
       });
     }
   },
@@ -98,17 +98,17 @@ export default {
         this.$Message.error({
           content: "获取课程列表失败",
           duration: 15,
-          closable: true
+          closable: true,
         });
       }
-    }
+    },
   },
   computed: {
-    ...globalMapState(["user"])
+    ...globalMapState(["user"]),
   },
   components: {
-    OnlinePracticeList
-  }
+    OnlinePracticeList,
+  },
 };
 </script>
 

+ 10 - 10
src/features/OnlinePractice/OnlinePracticeList.vue

@@ -62,7 +62,7 @@ export default {
   },
   props: {
     examList: Array,
-    courses: Array
+    courses: Array,
   },
   created() {
     this.getNow();
@@ -96,7 +96,7 @@ export default {
               examingRes.maxInterruptNum
             }),正在自动交卷...`,
             duration: 30,
-            closable: true
+            closable: true,
           });
           this.$Spin.show({
             render: () => {
@@ -106,7 +106,7 @@ export default {
                   ),正在自动交卷...
                 </div>
               );
-            }
+            },
           });
           const res = await this.$http.get(
             "/api/ecs_oe_student/examControl/endExam"
@@ -116,14 +116,14 @@ export default {
             this.$router.replace({
               path: `/online-exam/exam/${examingRes.examId}/examRecordData/${
                 examingRes.examRecordDataId
-              }/end`
+              }/end`,
             });
             this.$Spin.hide();
           } else {
             this.$Message.error({
               content: "交卷失败",
               duration: 15,
-              closable: true
+              closable: true,
             });
           }
           return;
@@ -133,7 +133,7 @@ export default {
           this.$Spin.show({
             render: () => {
               return <div style="font-size: 24px">正在进入断点续考...</div>;
-            }
+            },
           });
           this.$router.push(
             `/online-exam/exam/${examingRes.examId}/examRecordData/${
@@ -150,7 +150,7 @@ export default {
         this.$Message.error({
           content: "获取断点续考信息异常",
           duration: 15,
-          closable: true
+          closable: true,
         });
         return true;
       }
@@ -174,11 +174,11 @@ export default {
           course.examName
         )}&courseName=${encodeURIComponent(course.courseName)}`
       );
-    }
+    },
   },
   computed: {
-    ...globalMapState(["user", "timeDifference"])
-  }
+    ...globalMapState(["user", "timeDifference"]),
+  },
 };
 </script>
 

+ 6 - 6
src/features/OnlinePractice/OnlinePracticeRecordDetail.vue

@@ -100,7 +100,7 @@ export default {
     return {
       examRecordResult: [],
       shouldShowPaper: false,
-      disableGoBack: this.$route.query.disableGoBack
+      disableGoBack: this.$route.query.disableGoBack,
     };
   },
   async created() {
@@ -114,7 +114,7 @@ export default {
       this.$Message.error({
         content: "查询练习试卷详情出错!",
         duration: 15,
-        closable: true
+        closable: true,
       });
     }
   },
@@ -131,7 +131,7 @@ export default {
     },
     goBack() {
       this.$router.back();
-    }
+    },
   },
   computed: {
     examRecordDataId() {
@@ -139,11 +139,11 @@ export default {
     },
     examId() {
       return this.$route.params.examId - 0;
-    }
+    },
   },
   components: {
-    ExamPaper
-  }
+    ExamPaper,
+  },
 };
 </script>
 

+ 4 - 4
src/features/OnlinePractice/OnlinePracticeRecordList.vue

@@ -93,7 +93,7 @@ export default {
       this.$Message.error({
         content: "查询练习记录列表出错!",
         duration: 15,
-        closable: true
+        closable: true,
       });
     }
   },
@@ -107,7 +107,7 @@ export default {
     },
     formatTime(ms) {
       return (ms && moment.utc(ms).format("HH:mm:ss")) || "";
-    }
+    },
   },
   computed: {
     examName() {
@@ -132,8 +132,8 @@ export default {
         this.recordList.map(v => v.objectiveAccuracy).reduce((a, b) => a + b) /
         this.recordList.length
       ).toFixed(2);
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 17 - 17
src/features/Password/Password.vue

@@ -73,57 +73,57 @@ export default {
       form: {
         oldPassword: "",
         newPassword: "",
-        newPasswordAgain: ""
+        newPasswordAgain: "",
       },
       rules: {
         oldPassword: [
           {
             required: true,
             message: "请输入旧密码",
-            trigger: "blur"
-          }
+            trigger: "blur",
+          },
         ],
         newPassword: [
           {
             required: true,
             message: "请输入新密码",
-            trigger: "blur"
+            trigger: "blur",
           },
           {
             type: "string",
             min: 6,
             message: "密码不能少于6位",
-            trigger: "blur"
+            trigger: "blur",
           },
           {
             type: "string",
             max: 18,
             message: "密码不能多于18位",
-            trigger: "blur"
+            trigger: "blur",
           },
-          { validator: validatePass, trigger: "blur" }
+          { validator: validatePass, trigger: "blur" },
         ],
         newPasswordAgain: [
           {
             required: true,
             message: "请输入新密码",
-            trigger: "blur"
+            trigger: "blur",
           },
           {
             type: "string",
             min: 6,
             message: "密码不能少于6位",
-            trigger: "blur"
+            trigger: "blur",
           },
           {
             type: "string",
             max: 18,
             message: "密码不能多于18位",
-            trigger: "blur"
+            trigger: "blur",
           },
-          { validator: validatePassCheck, trigger: "blur" }
-        ]
-      }
+          { validator: validatePassCheck, trigger: "blur" },
+        ],
+      },
     };
   },
   methods: {
@@ -143,7 +143,7 @@ export default {
           this.$Message.success({
             content: "保存成功",
             duration: 5,
-            closable: true
+            closable: true,
           });
           window._hmt.push(["_trackEvent", "修改密码页面", "修改成功"]);
         }
@@ -151,11 +151,11 @@ export default {
         this.$Message.error({
           content: "保存失败",
           duration: 15,
-          closable: true
+          closable: true,
         });
       }
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 10 - 10
src/main.js

@@ -41,14 +41,14 @@ if (process.env.NODE_ENV === "development") {
     const response = await fetch("/api/ecs_core/auth/login", {
       method: "POST",
       headers: {
-        "Content-Type": "application/json;charset=UTF-8"
+        "Content-Type": "application/json;charset=UTF-8",
       },
       body: JSON.stringify({
         domain: process.env.VUE_APP_LOGIN_DOMAIN,
         accountValue: process.env.VUE_APP_LOGIN_ACCOUNT_VALUE,
         password: process.env.VUE_APP_LOGIN_PASSWORD,
-        accountType: process.env.VUE_APP_LOGIN_ACCOUNTTYPE
-      })
+        accountType: process.env.VUE_APP_LOGIN_ACCOUNTTYPE,
+      }),
     });
     let data = await response.json();
     if (data.token) {
@@ -63,8 +63,8 @@ if (process.env.NODE_ENV === "development") {
           headers: {
             "Content-Type": "application/json;charset=UTF-8",
             key: data.key,
-            token: data.token
-          }
+            token: data.token,
+          },
         }
       )).json();
       const user = { ...data, ...student };
@@ -97,8 +97,8 @@ Vue.mixin({
           logText,
           {
             headers: {
-              "Content-Type": "text/plain"
-            }
+              "Content-Type": "text/plain",
+            },
           }
         );
       } catch (error) {
@@ -109,8 +109,8 @@ Vue.mixin({
       localStorage.removeItem("phoneVerified");
       window._hmt.push(["_trackEvent", "退出", cause]);
       this.$router.push("/login/" + localStorage.getItem("domain") + cause);
-    }
-  }
+    },
+  },
 });
 
 if (
@@ -123,5 +123,5 @@ if (
 new Vue({
   router,
   store,
-  render: h => h(App)
+  render: h => h(App),
 }).$mount("#app");

+ 1 - 1
src/plugins/iview.js

@@ -18,7 +18,7 @@ import {
   Notice,
   Option,
   Progress,
-  Alert
+  Alert,
 } from "iview";
 Vue.component("Button", Button);
 Vue.component("Form", Form);

+ 2 - 2
src/plugins/vueLifecylceLogs.js

@@ -79,7 +79,7 @@ const ignoreComponents = [
   "Tooltip",
   "Transfer",
   "Tree",
-  "Upload"
+  "Upload",
 ];
 
 setInterval(
@@ -162,5 +162,5 @@ Vue.mixin({
         "--".repeat(parentNumber) + `${this.$options.name} %c beforeDestroy`,
         "color: red; font-weight: bold"
       );
-  }
+  },
 });

+ 1 - 1
src/registerServiceWorker.js

@@ -23,6 +23,6 @@ if (process.env.NODE_ENV === "production") {
     },
     error(error) {
       console.error("Error during service worker registration:", error);
-    }
+    },
   });
 }

+ 14 - 14
src/router.js

@@ -21,64 +21,64 @@ let router = new Router({
     {
       path: "/",
       name: "Home",
-      component: OnlineExamHome
+      component: OnlineExamHome,
     },
     {
       path: "/login/:domain",
       name: "Login",
-      component: Login
+      component: Login,
     },
     {
       path: "/online-exam",
       name: "OnlineExamHome",
-      component: OnlineExamHome
+      component: OnlineExamHome,
     },
     {
       path: "/online-exam/exam/:examId/overview",
       name: "OnlineExamOverview",
-      component: OnlineExamOverview
+      component: OnlineExamOverview,
     },
     {
       path:
         "/online-exam/exam/:examId/examRecordData/:examRecordDataId/order/:order",
       name: "OnlineExamingHome",
-      component: ExamingHome
+      component: ExamingHome,
     },
     {
       path: "/online-exam/exam/:examId/examRecordData/:examRecordDataId/end",
       name: "ExamingEnd",
-      component: ExamingEnd
+      component: ExamingEnd,
     },
     {
       path: "/online-practice",
       name: "OnlinePracticeHome",
-      component: OnlinePracticeHome
+      component: OnlinePracticeHome,
     },
     {
       path: "/online-practice/exam/:examId/list",
       name: "OnlinePracticeRecordList",
-      component: OnlinePracticeRecordList
+      component: OnlinePracticeRecordList,
     },
     {
       path: "/online-practice/exam/:examId/detail",
       name: "OnlinePracticeRecordDetail",
-      component: OnlinePracticeRecordDetail
+      component: OnlinePracticeRecordDetail,
     },
     {
       path: "/offline-exam",
       name: "OfflineExamHome",
-      component: OfflineExamHome
+      component: OfflineExamHome,
     },
     {
       path: "/password",
       name: "Password",
-      component: Password
+      component: Password,
     },
     {
       path: "*",
-      component: NotFoundComponent
-    }
-  ]
+      component: NotFoundComponent,
+    },
+  ],
 });
 
 router.beforeEach((to, from, next) => {

+ 10 - 10
src/store.js

@@ -13,10 +13,10 @@ const examHomeModule = {
       } else {
         state.faceCheckModalOpen = open;
       }
-    }
+    },
   },
   actions: {},
-  getters: {}
+  getters: {},
 };
 
 const examingHomeModule = {
@@ -33,7 +33,7 @@ const examingHomeModule = {
     allAudioPlayTimes: [],
     questionQrCode: null,
     questionQrCodeScanned: null,
-    questionAudioFileUrl: []
+    questionAudioFileUrl: [],
   },
   mutations: {
     updateRemainTime(state, remainTime) {
@@ -172,7 +172,7 @@ const examingHomeModule = {
       } else {
         state.questionAudioFileUrl.push(payload);
       }
-    }
+    },
   },
   actions: {},
   getters: {
@@ -181,8 +181,8 @@ const examingHomeModule = {
         return true;
       }
       return false;
-    }
-  }
+    },
+  },
 };
 
 const userStr = window.localStorage.getItem("user-for-reload");
@@ -191,7 +191,7 @@ const initUser = userStr ? JSON.parse(userStr) : {};
 export default new Vuex.Store({
   state: {
     user: initUser,
-    timeDifference: 0
+    timeDifference: 0,
   },
   mutations: {
     updateUser(state, payload) {
@@ -199,11 +199,11 @@ export default new Vuex.Store({
     },
     updateTimeDifference(state, payload) {
       state = Object.assign(state, { timeDifference: payload });
-    }
+    },
   },
   actions: {},
   modules: {
     examHomeModule,
-    examingHomeModule
-  }
+    examingHomeModule,
+  },
 });

+ 11 - 11
src/utils/axios.js

@@ -41,7 +41,7 @@ qmInstance.interceptors.request.use(
     Message.error({
       content: error,
       duration: 15,
-      closable: true
+      closable: true,
     });
     return Promise.resolve(error);
   }
@@ -58,7 +58,7 @@ qmInstance.interceptors.response.use(
       Message.error({
         content: "网络连接异常,请检查网络设置。",
         duration: 15,
-        closable: true
+        closable: true,
       });
 
       return Promise.reject(error);
@@ -75,7 +75,7 @@ qmInstance.interceptors.response.use(
         Message.error({
           content: "登录失效,请重新登录!",
           duration: 15,
-          closable: true
+          closable: true,
         });
         window.___lastInvalidDate = Date.now();
       }
@@ -86,7 +86,7 @@ qmInstance.interceptors.response.use(
       Message.error({
         content: "服务器异常(502)!",
         duration: 15,
-        closable: true
+        closable: true,
       });
       return;
     } else if (status != 200) {
@@ -101,8 +101,8 @@ qmInstance.interceptors.response.use(
             error.config.url + " 请求失败",
             {
               headers: {
-                "Content-Type": "text/plain"
-              }
+                "Content-Type": "text/plain",
+              },
             }
           );
         }, 3 * 1000);
@@ -113,13 +113,13 @@ qmInstance.interceptors.response.use(
         Message.error({
           content: data.desc,
           duration: 15,
-          closable: true
+          closable: true,
         });
       } else {
         Message.error({
           content: "未定义异常: " + JSON.stringify(data, 2),
           duration: 15,
-          closable: true
+          closable: true,
         });
       }
     }
@@ -138,7 +138,7 @@ qmInstance.get = cachingGet(qmInstance.get, [
   /\/api\/ecs_oe_student\/examQuestion\/getQuestionContent\?questionId=.*&exam_record_id=/,
   /\/api\/ecs_exam_work\/exam\/\d+$/,
   /\/api\/ecs_oe_student_face\/upyun$/,
-  /\/api\/ecs_oe_student\/examFaceLivenessVerify\/checkFaceLiveness$/
+  /\/api\/ecs_oe_student\/examFaceLivenessVerify\/checkFaceLiveness$/,
 ]);
 loadProgressBar(qmInstance);
 
@@ -190,10 +190,10 @@ Vue.prototype.$http = qmInstance;
 export default {
   install: function(Vue) {
     Object.defineProperty(Vue.prototype, "$http", {
-      value: qmInstance
+      value: qmInstance,
     });
     // Object.defineProperty(Vue.prototype, "$upyunhttp", {
     //   value: upyunInstance
     // });
-  }
+  },
 };

+ 1 - 1
src/utils/monitors.js

@@ -42,7 +42,7 @@ window.addEventListener("error", function(event) {
     "_trackEvent",
     "全局JS错误",
     event.message,
-    event.error.stack.replace(/\n/g, "||||")
+    event.error.stack.replace(/\n/g, "||||"),
   ]);
 });
 

+ 2 - 2
src/views/NotFoundComponent.vue

@@ -23,8 +23,8 @@ export default {
   methods: {
     goLogin() {
       this.$router.push("/login/" + localStorage.getItem("domain"));
-    }
-  }
+    },
+  },
 };
 </script>
 

+ 3 - 3
tests/unit/.eslintrc.js

@@ -1,8 +1,8 @@
 module.exports = {
   env: {
-    jest: true
+    jest: true,
   },
   rules: {
-    "import/no-extraneous-dependencies": "off"
-  }
+    "import/no-extraneous-dependencies": "off",
+  },
 };

+ 1 - 1
tests/unit/HelloWorld.spec.js

@@ -5,7 +5,7 @@ describe("HelloWorld.vue", () => {
   it("renders props.msg when passed", () => {
     const msg = "new message";
     const wrapper = shallowMount(HelloWorld, {
-      propsData: { msg }
+      propsData: { msg },
     });
     expect(wrapper.text()).toMatch(msg);
   });

+ 4 - 4
tests/vue/child.vue

@@ -11,18 +11,18 @@
 export default {
   name: "Child",
   props: {
-    passToChild: String
+    passToChild: String,
   },
   data() {
     return {
       counte: 0,
-      dataFromProps: "data: " + this.passToChild // non reactive
+      dataFromProps: "data: " + this.passToChild, // non reactive
     };
   },
   computed: {
     computedFromProps: function() {
       return "computed: " + this.passToChild;
-    }
-  }
+    },
+  },
 };
 </script>

+ 4 - 4
tests/vue/event.vue

@@ -32,17 +32,17 @@ export default {
       name: "michael",
       globalCount: 0,
       dreams: [],
-      height: ""
+      height: "",
     };
   },
   methods: {
     childListener(v) {
       console.log(v);
       this.globalCount++;
-    }
+    },
   },
   components: {
-    Child
-  }
+    Child,
+  },
 };
 </script>

+ 2 - 2
tests/vue/props.vue

@@ -16,7 +16,7 @@ export default {
     setInterval(() => (this.passToChild = "Give to child " + Date.now()), 1000);
   },
   components: {
-    Child
-  }
+    Child,
+  },
 };
 </script>

+ 6 - 6
vue.config.js

@@ -1,8 +1,8 @@
 let proxy = {
   "/api": {
     target: "https://192.168.10.39:8878",
-    changeOrigin: true
-  }
+    changeOrigin: true,
+  },
 };
 
 // const stu = [
@@ -54,7 +54,7 @@ var webpack = require("webpack");
 module.exports = {
   lintOnSave: process.env.NODE_ENV !== "production" ? true : "error",
   devServer: {
-    proxy
+    proxy,
   },
   chainWebpack: config => {
     // iview Loader
@@ -64,12 +64,12 @@ module.exports = {
       .use("iview-loader")
       .loader("iview-loader")
       .options({
-        prefix: true
+        prefix: true,
       })
       .end();
   },
   configureWebpack: {
     devtool: "source-map",
-    plugins: [new webpack.IgnorePlugin(/^\.\/locale$/, /moment|iview$/)]
-  }
+    plugins: [new webpack.IgnorePlugin(/^\.\/locale$/, /moment|iview$/)],
+  },
 };