哈尔滨title调整&理论考试缓存调整
This commit is contained in:
parent
e5467af549
commit
f21751fcd3
@ -32,7 +32,7 @@ export const loginInfo = { // 页面title & 退出登录跳转路径
|
||||
loginPath: '/designgzb/login'
|
||||
},
|
||||
hyd: {
|
||||
title: '城市轨道交通实训平台',
|
||||
title: '城市轨道交通综合行车模拟仿真系统',
|
||||
loginPath: '/login'
|
||||
},
|
||||
designhyd: {
|
||||
|
@ -15,14 +15,16 @@
|
||||
</div>
|
||||
|
||||
<div class="lcd_content_box">
|
||||
<div style="display: inline-block;">
|
||||
<div class="lcd_content_box_left_title">车站</div>
|
||||
<div class="lcd_content_box_left_title">选择</div>
|
||||
</div>
|
||||
<div v-for="(station, index) in stationList" :key="index" style="display: inline-block;text-align: center;">
|
||||
<div class="each_station_info">{{ station }}</div>
|
||||
<div class="button_default_content">
|
||||
<div class="button_default" :style="{background:selectedAreaList.includes(station.stationName + '-' + index)?'#2EFF74':'#CDCDCD'}" />
|
||||
<div>
|
||||
<div style="display: inline-block;">
|
||||
<div class="lcd_content_box_left_title">车站</div>
|
||||
<div class="lcd_content_box_left_title">选择</div>
|
||||
</div>
|
||||
<div v-for="(station, index) in stationList" :key="index" style="display: inline-block;text-align: center;">
|
||||
<div class="each_station_info">{{ station }}</div>
|
||||
<div class="button_default_content">
|
||||
<div class="button_default" :style="{background:selectedAreaList.includes(station.stationName + '-' + index)?'#2EFF74':'#CDCDCD'}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user