|
@@ -955,7 +955,7 @@
|
|
|
import Footer from "@/components/footer/index";
|
|
|
import Header from "@/components/header/index";
|
|
|
import ToolBar from "@/components/toolbar/index";
|
|
|
-import { mapMutations } from "vuex";
|
|
|
+import { mapMutations, mapGetters, mapActions } from "vuex";
|
|
|
export default {
|
|
|
name: "BankExplain",
|
|
|
components: {
|
|
@@ -963,6 +963,9 @@ export default {
|
|
|
Header,
|
|
|
ToolBar,
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(["sysTime"]),
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
recordId: 0,
|
|
@@ -1020,13 +1023,19 @@ export default {
|
|
|
postTimer: null,
|
|
|
subscribeId: 0,
|
|
|
isAutoSubmit: false,
|
|
|
+ examEndTime: 0,
|
|
|
+ examStartTime: 0,
|
|
|
};
|
|
|
},
|
|
|
async mounted() {
|
|
|
+ this.examStartTime = this.$route.query.examStartTime;
|
|
|
+ this.examEndTime = this.$route.query.examEndTime;
|
|
|
this.examId = this.$route.query.examId;
|
|
|
this.eachExamId = this.$route.query.eachExamId;
|
|
|
this.subscribeId = this.$route.query.subscribeId || "";
|
|
|
+ this.allTimes = this.examEndTime - this.examStartTime || "";
|
|
|
|
|
|
+ await this.setSystemTime();
|
|
|
await this.bankExam();
|
|
|
this.goodsQuestionList();
|
|
|
},
|
|
@@ -1134,6 +1143,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations(["setExamResult"]),
|
|
|
+ ...mapActions(["setSystemTime"]),
|
|
|
mockSubscribeEdit() {
|
|
|
this.$request
|
|
|
.mockSubscribeEdit({
|
|
@@ -1214,35 +1224,36 @@ export default {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- this.allTimes = res.data[0].answerTime * 60;
|
|
|
- this.lastTime = res.data[0].answerTime && res.data[0].answerTime * 60;
|
|
|
-
|
|
|
- //考试时间到了自动交卷
|
|
|
- if (this.lastTime) {
|
|
|
- this.timer = setInterval(() => {
|
|
|
- if (this.lastTime <= 0) {
|
|
|
- clearInterval(this.timer);
|
|
|
- this.$confirm(`考试时间已到,系统将自动交卷`, "提示", {
|
|
|
- confirmButtonText: "立即交卷",
|
|
|
- closeOnClickModal: false,
|
|
|
- showCancelButton: false,
|
|
|
- closeOnPressEscape: false,
|
|
|
- distinguishCancelAndClose: false,
|
|
|
- showClose: false,
|
|
|
- });
|
|
|
- this.isAutoSubmit = true;
|
|
|
-
|
|
|
- setTimeout(() => {
|
|
|
- try {
|
|
|
- this.$msgbox.close();
|
|
|
- } catch (err) {}
|
|
|
- this.examSubmit();
|
|
|
- }, 3000);
|
|
|
- return;
|
|
|
- }
|
|
|
- this.lastTime--;
|
|
|
- }, 1000);
|
|
|
- } else {
|
|
|
+
|
|
|
+ if (this.subscribeId) {
|
|
|
+ this.lastTime = this.examEndTime - this.sysTime;
|
|
|
+ //考试时间到了自动交卷
|
|
|
+ if (this.lastTime) {
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ if (this.lastTime <= 0) {
|
|
|
+ clearInterval(this.timer);
|
|
|
+ this.$confirm(`考试时间已到,系统将自动交卷`, "提示", {
|
|
|
+ confirmButtonText: "立即交卷",
|
|
|
+ closeOnClickModal: false,
|
|
|
+ showCancelButton: false,
|
|
|
+ closeOnPressEscape: false,
|
|
|
+ distinguishCancelAndClose: false,
|
|
|
+ showClose: false,
|
|
|
+ });
|
|
|
+ this.isAutoSubmit = true;
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ try {
|
|
|
+ this.$msgbox.close();
|
|
|
+ } catch (err) {}
|
|
|
+ this.examSubmit();
|
|
|
+ }, 3000);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.lastTime--;
|
|
|
+ }, 1000);
|
|
|
+ } else {
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
res.data.forEach((item, index) => {
|