-
{{ station }}
-
diff --git a/src/views/jsxt/competition/theory/quiz/index.vue b/src/views/jsxt/competition/theory/quiz/index.vue
index 2d3b90835..a3b7d0718 100644
--- a/src/views/jsxt/competition/theory/quiz/index.vue
+++ b/src/views/jsxt/competition/theory/quiz/index.vue
@@ -28,6 +28,7 @@
// import { commitExam, getExamInfo, getUserExam, saveExamAnswer } from '@/api/exam.js';
// import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import Question from './question';
+import localStore from 'storejs';
import { postCompetitionTheory, getTheoryQuestion, quitCurrentRace } from '@/api/competition';
export default {
@@ -52,6 +53,7 @@ export default {
},
examQuestions: [],
theoryAnswers: [],
+ theoryAnswersMap: {},
countdownTime: '00:00:00',
theoryExamTime: 0,
countdown: null
@@ -100,8 +102,14 @@ export default {
},
methods: {
loadInitData() {
- this.theoryAnswers = [];
+ // this.theoryAnswers = [];
+ this.theoryAnswersMap = {};
getTheoryQuestion(this.$route.query.raceId).then((resp)=>{
+ const storeAnswersKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'theoryAnswers';
+ const storeAnswers = localStore.get(storeAnswersKey);
+ if (storeAnswers) {
+ this.theoryAnswersMap = storeAnswers;
+ }
if (resp.data) {
this.examQuestions = resp.data.questions.map((el, i) => {
el.index = i;
@@ -109,6 +117,16 @@ export default {
});
this.theoryExamTime = resp.data.theoryExamTime * 60;
this.countdownTime = this.computationTime(this.theoryExamTime);
+ const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'theory';
+ const startTime = localStore.get(storeKey);
+
+ if (startTime) {
+ const dt = new Date().getTime() - startTime;
+ this.theoryExamTime = resp.data.theoryExamTime * 60 - Math.floor(dt / 1000);
+ } else {
+ const storeValue = new Date().getTime();
+ localStore.set(storeKey, storeValue);
+ }
this.countdown = setInterval(() => {
if (this.theoryExamTime <= 0) {
if (this.countdown) {
@@ -166,11 +184,15 @@ export default {
});
},
onSave(data) {
- // console.log(data, '问答题');
- this.theoryAnswers.push({
- answerOptionId: data.answer,
- questionId: data.userExamQuestionId
- });
+ // this.theoryAnswers.push({
+ // answerOptionId: data.answer,
+ // questionId: data.userExamQuestionId
+ // });
+ this.theoryAnswersMap[data.userExamQuestionId] = data.answer;
+ // console.log(data, '问答题', this.theoryAnswers, this.theoryAnswersMap);
+ const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'theoryAnswers';
+ localStore.set(storeKey, this.theoryAnswersMap);
+
},
computationTime(time) {
let hours = Math.floor(time / 3600);
diff --git a/src/views/login/hydLogin.vue b/src/views/login/hydLogin.vue
index 2eb18d7e5..88193741f 100644
--- a/src/views/login/hydLogin.vue
+++ b/src/views/login/hydLogin.vue
@@ -69,7 +69,7 @@ import { setSessionStorage, removeSessionStorage } from '@/utils/auth';
import Cookies from 'js-cookie';
import md5 from 'js-md5';
import { UrlConfig } from '@/scripts/ConstDic';
-import { ProjectIcon } from '@/scripts/ProjectConfig';
+import { loginInfo, ProjectIcon } from '@/scripts/ProjectConfig';
import { removeToken } from '@/utils/auth';
import LangStorage from '@/utils/lang';
import logoImgHyd from '@/assets/project_icon/logo_hyd.png';
@@ -121,7 +121,7 @@ export default {
lang: 'zh',
language: '中文',
logoImg: logoImgHyd,
- title: '城市轨道交通实训平台'
+ title: ''
};
},
computed: {
@@ -151,7 +151,9 @@ export default {
},
mounted() {
if (this.project.startsWith('design')) {
- this.title = '城市轨道交通设计平台';
+ this.title = loginInfo['designhyd'].title;
+ } else {
+ this.title = loginInfo['hyd'].title;
}
document.title = this.title;
},