|
@@ -1,32 +1,66 @@
|
|
<template>
|
|
<template>
|
|
- <div v-if="exam && examQuestion()" class="container" :key="exam.id">
|
|
|
|
|
|
+ <div
|
|
|
|
+ v-if="exam && examQuestion()"
|
|
|
|
+ class="container"
|
|
|
|
+ :key="exam.id"
|
|
|
|
+ >
|
|
<div class="header">
|
|
<div class="header">
|
|
<RemainTime></RemainTime>
|
|
<RemainTime></RemainTime>
|
|
<OverallProgress :exam-question-list="examQuestionList"></OverallProgress>
|
|
<OverallProgress :exam-question-list="examQuestionList"></OverallProgress>
|
|
<QuestionFilters :exam-question-list="examQuestionList"></QuestionFilters>
|
|
<QuestionFilters :exam-question-list="examQuestionList"></QuestionFilters>
|
|
- <Button class="qm-primary-button" @click="submitPaper">交卷</Button>
|
|
|
|
|
|
+ <Button
|
|
|
|
+ class="qm-primary-button"
|
|
|
|
+ @click="submitPaper"
|
|
|
|
+ >交卷</Button>
|
|
</div>
|
|
</div>
|
|
- <div class="main" id="examing-home-question">
|
|
|
|
|
|
+ <div
|
|
|
|
+ class="main"
|
|
|
|
+ id="examing-home-question"
|
|
|
|
+ >
|
|
<QuestionView :exam-question="examQuestion()"></QuestionView>
|
|
<QuestionView :exam-question="examQuestion()"></QuestionView>
|
|
- <ArrowNavView :previousQuestionOrder="previousQuestionOrder" :nextQuestionOrder="nextQuestionOrder"></ArrowNavView>
|
|
|
|
|
|
+ <ArrowNavView
|
|
|
|
+ :previousQuestionOrder="previousQuestionOrder"
|
|
|
|
+ :nextQuestionOrder="nextQuestionOrder"
|
|
|
|
+ ></ArrowNavView>
|
|
</div>
|
|
</div>
|
|
<div :class="['side', 'side-row-size']">
|
|
<div :class="['side', 'side-row-size']">
|
|
<div :class="['question-nav', !faceEnable && 'question-nav-long']">
|
|
<div :class="['question-nav', !faceEnable && 'question-nav-long']">
|
|
<QuestionNavView :paperStruct="paperStruct" />
|
|
<QuestionNavView :paperStruct="paperStruct" />
|
|
</div>
|
|
</div>
|
|
- <div v-if="faceEnable" class="camera">
|
|
|
|
- <FaceRecognition v-if="faceEnable" width="100%" height="100%" :showRecognizeButton="false" />
|
|
|
|
|
|
+ <div
|
|
|
|
+ v-if="faceEnable"
|
|
|
|
+ class="camera"
|
|
|
|
+ >
|
|
|
|
+ <FaceRecognition
|
|
|
|
+ v-if="faceEnable"
|
|
|
|
+ width="100%"
|
|
|
|
+ height="100%"
|
|
|
|
+ :showRecognizeButton="false"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <Modal v-model="showFaceId" :mask-closable="false" :closable="false" width=800 :styles="{top: '20px'}">
|
|
|
|
- <FaceId v-if="showFaceId" @closeFaceId="closeFaceId" />
|
|
|
|
|
|
+ <Modal
|
|
|
|
+ v-model="showFaceId"
|
|
|
|
+ :mask-closable="false"
|
|
|
|
+ :closable="false"
|
|
|
|
+ width=800
|
|
|
|
+ :styles="{top: '20px'}"
|
|
|
|
+ >
|
|
|
|
+ <FaceId
|
|
|
|
+ v-if="showFaceId"
|
|
|
|
+ @closeFaceId="closeFaceId"
|
|
|
|
+ />
|
|
<p slot="footer">
|
|
<p slot="footer">
|
|
</p>
|
|
</p>
|
|
</Modal>
|
|
</Modal>
|
|
<FaceTracking v-if="faceEnable && PRODUCTION" />
|
|
<FaceTracking v-if="faceEnable && PRODUCTION" />
|
|
</div>
|
|
</div>
|
|
<div v-else>
|
|
<div v-else>
|
|
- 正在等待数据返回... <i-button class="qm-primary-button" v-if="timeouted" @click="reloadPage">重试</i-button>
|
|
|
|
|
|
+ 正在等待数据返回... <i-button
|
|
|
|
+ class="qm-primary-button"
|
|
|
|
+ v-if="timeouted"
|
|
|
|
+ @click="reloadPage"
|
|
|
|
+ >重试</i-button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -84,7 +118,7 @@ export default {
|
|
}
|
|
}
|
|
// for test
|
|
// for test
|
|
// setTimeout(() => {
|
|
// setTimeout(() => {
|
|
- // this.showFaceId = false;
|
|
|
|
|
|
+ // this.showFaceId = true;
|
|
// // this.$Modal.remove();
|
|
// // this.$Modal.remove();
|
|
// // }, this.$route.query.faceVerifyMinute * 60 * 1000); // 定时做活体检测
|
|
// // }, this.$route.query.faceVerifyMinute * 60 * 1000); // 定时做活体检测
|
|
// }, 5 * 1000); // 定时做活体检测
|
|
// }, 5 * 1000); // 定时做活体检测
|
|
@@ -137,6 +171,13 @@ export default {
|
|
// iview bug: https://github.com/iview/iview/issues/4061
|
|
// iview bug: https://github.com/iview/iview/issues/4061
|
|
// document.body.style = "";
|
|
// document.body.style = "";
|
|
},
|
|
},
|
|
|
|
+ // FIXME: 在上线前删除
|
|
|
|
+ beforeRouteUpdate(from, to, next) {
|
|
|
|
+ // this.answerAllQuestions();
|
|
|
|
+ // next();
|
|
|
|
+ console.log(this.$route.fullPath);
|
|
|
|
+ next();
|
|
|
|
+ },
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
clearTimeout(this.timeoutTimeout);
|
|
clearTimeout(this.timeoutTimeout);
|
|
clearInterval(this.submitInterval);
|
|
clearInterval(this.submitInterval);
|
|
@@ -283,9 +324,10 @@ export default {
|
|
closeFaceId() {
|
|
closeFaceId() {
|
|
this.showFaceId = false;
|
|
this.showFaceId = false;
|
|
},
|
|
},
|
|
- async answerAllQuestions() {
|
|
|
|
|
|
+ async answerAllQuestions(ignoreDirty) {
|
|
const answers = this.examQuestionList
|
|
const answers = this.examQuestionList
|
|
- .filter(eq => eq.dirty && eq.getQuestionContent)
|
|
|
|
|
|
+ .filter(eq => !ignoreDirty && eq.dirty)
|
|
|
|
+ .filter(eq => eq.getQuestionContent)
|
|
.map(eq => {
|
|
.map(eq => {
|
|
return Object.assign(
|
|
return Object.assign(
|
|
{
|
|
{
|
|
@@ -311,7 +353,8 @@ export default {
|
|
},
|
|
},
|
|
async submitPaper() {
|
|
async submitPaper() {
|
|
try {
|
|
try {
|
|
- await this.answerAllQuestions();
|
|
|
|
|
|
+ // 交卷前强制提交所有答案
|
|
|
|
+ await this.answerAllQuestions(true);
|
|
} catch (error) {
|
|
} catch (error) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|