|
@@ -49,11 +49,6 @@ export default {
|
|
return { showFaceId: false, faceEnable: false, timeouted: false };
|
|
return { showFaceId: false, faceEnable: false, timeouted: false };
|
|
},
|
|
},
|
|
async created() {
|
|
async created() {
|
|
- // if (!this.$route.params.order) {
|
|
|
|
- // // created can access this.$route?
|
|
|
|
- // this.$router.push(this.$route.fullPath + "/order/1");
|
|
|
|
- // return;
|
|
|
|
- // }
|
|
|
|
this.timeoutTimeout = setTimeout(() => (this.timeouted = true), 30 * 1000);
|
|
this.timeoutTimeout = setTimeout(() => (this.timeouted = true), 30 * 1000);
|
|
await this.initData();
|
|
await this.initData();
|
|
|
|
|
|
@@ -83,6 +78,11 @@ export default {
|
|
this.$route.params.examId +
|
|
this.$route.params.examId +
|
|
`/IS_FACE_ENABLE`
|
|
`/IS_FACE_ENABLE`
|
|
);
|
|
);
|
|
|
|
+ if (faceEnable.data === undefined) {
|
|
|
|
+ this.$Message.error("获取人脸检测设置失败");
|
|
|
|
+ this.logout();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
if (faceEnable.data) {
|
|
if (faceEnable.data) {
|
|
this.faceEnable = true;
|
|
this.faceEnable = true;
|
|
|
|
|
|
@@ -95,6 +95,11 @@ export default {
|
|
this.$route.params.examId +
|
|
this.$route.params.examId +
|
|
`/SNAPSHOT_INTERVAL`
|
|
`/SNAPSHOT_INTERVAL`
|
|
);
|
|
);
|
|
|
|
+ if (snapshotInterval.data === undefined) {
|
|
|
|
+ this.$Message.error("获取人脸抓拍间隔设置失败");
|
|
|
|
+ this.logout();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
if (snapshotInterval.data) {
|
|
if (snapshotInterval.data) {
|
|
// 考务设置抓拍间隔
|
|
// 考务设置抓拍间隔
|
|
this.snapInterval = setInterval(() => {
|
|
this.snapInterval = setInterval(() => {
|
|
@@ -107,15 +112,6 @@ export default {
|
|
() => this.answerAllQuestions(),
|
|
() => this.answerAllQuestions(),
|
|
10 * 1000 // 10秒检查是否有更改需要提交答案
|
|
10 * 1000 // 10秒检查是否有更改需要提交答案
|
|
);
|
|
);
|
|
-
|
|
|
|
- // this.$Modal.info({
|
|
|
|
- // // title: "活体检测",
|
|
|
|
- // header: "",
|
|
|
|
- // footerHide: true,
|
|
|
|
- // render: h => {
|
|
|
|
- // return <FaceId />;
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
},
|
|
},
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
clearTimeout(this.timeoutTimeout);
|
|
clearTimeout(this.timeoutTimeout);
|
|
@@ -135,9 +131,25 @@ export default {
|
|
"resetExamQuestionDirty"
|
|
"resetExamQuestionDirty"
|
|
]),
|
|
]),
|
|
async initData() {
|
|
async initData() {
|
|
- const exam = await this.$http.get(
|
|
|
|
- "/api/ecs_exam_work/exam/" + this.$route.params.examId
|
|
|
|
- );
|
|
|
|
|
|
+ const [exam, paperStruct, 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")
|
|
|
|
+ ]);
|
|
|
|
+
|
|
|
|
+ if (
|
|
|
|
+ exam.data === undefined ||
|
|
|
|
+ paperStruct.data === undefined ||
|
|
|
|
+ examQuestionListData.data === undefined
|
|
|
|
+ ) {
|
|
|
|
+ this.$Message.error("获取试卷信息失败");
|
|
|
|
+ this.logout();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (exam.data.examType === "PRACTICE") {
|
|
if (exam.data.examType === "PRACTICE") {
|
|
const practiceType = (await this.$http.get(
|
|
const practiceType = (await this.$http.get(
|
|
"/api/ecs_exam_work/exam/examOrgProperty/" +
|
|
"/api/ecs_exam_work/exam/examOrgProperty/" +
|
|
@@ -146,18 +158,11 @@ export default {
|
|
)).data;
|
|
)).data;
|
|
this.practiceType = practiceType; // IN_PRACTICE NO_ANSWER
|
|
this.practiceType = practiceType; // IN_PRACTICE NO_ANSWER
|
|
}
|
|
}
|
|
- const paperStruct = (await this.$http.get(
|
|
|
|
- "/api/ecs_oe_student/examRecordPaperStruct/getExamRecordPaperStruct?examRecordDataId=" +
|
|
|
|
- this.$route.params.examRecordDataId
|
|
|
|
- )).data;
|
|
|
|
-
|
|
|
|
- let examQuestionList = (await this.$http.get(
|
|
|
|
- "/api/ecs_oe_student/examQuestion/findExamQuestionList"
|
|
|
|
- )).data;
|
|
|
|
|
|
|
|
// init subNumber
|
|
// init subNumber
|
|
let questionId = null;
|
|
let questionId = null;
|
|
let i = 1;
|
|
let i = 1;
|
|
|
|
+ let examQuestionList = examQuestionListData.data;
|
|
examQuestionList = examQuestionList.map(eq => {
|
|
examQuestionList = examQuestionList.map(eq => {
|
|
if (questionId == eq.questionId) {
|
|
if (questionId == eq.questionId) {
|
|
eq.subNumber = i++;
|
|
eq.subNumber = i++;
|
|
@@ -332,6 +337,9 @@ export default {
|
|
},
|
|
},
|
|
reloadPage() {
|
|
reloadPage() {
|
|
window.location.reload();
|
|
window.location.reload();
|
|
|
|
+ },
|
|
|
|
+ logout() {
|
|
|
|
+ this.$router.push("/login/" + localStorage.getItem("domain"));
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|