This commit is contained in:
joylink_cuiweidong 2020-05-29 14:05:03 +08:00
commit 2fd42c22f9
6 changed files with 54 additions and 24 deletions

View File

@ -603,7 +603,7 @@ class SkinCode extends defaultStyle {
defaultDirectionCode: 'D', // 默认车次号1
defaultTripNumber: 'CCC', // 默认车次号2
trainTargetOffset: { x: 42, y: 1}, // 列车车次号偏移
smallColor: '#70ECEE', // 小交路颜色
smallColor: '#00FFFF', // 小交路颜色
bigColor: '#FFFFFF', // 大交路颜色
inboundColor: '#00FF00', // 回库颜色
planTypeColor: '#FFFFFF' // 计划车颜色

View File

@ -32,7 +32,7 @@ export const loginInfo = { // 页面title & 退出登录跳转路径
loginPath: '/designgzb/login'
},
hyd: {
title: '城市轨道交通实训平台',
title: '城市轨道交通综合行车模拟仿真系统',
loginPath: '/login'
},
designhyd: {

View File

@ -2,11 +2,11 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛

View File

@ -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>

View File

@ -14,7 +14,7 @@
</div>
</el-main>
<el-footer class="quiz__container-footer layer-center" @click="returnTop">
<div style="display: inline-block;position: relative;bottom: 20px;height: 40px;line-height: 40px;float: left;color:#F00;font-size: 12px;">温馨提示考试过程中请不要刷新或关闭本页面</div>
<div style="display: inline-block;position: relative;bottom: 20px;height: 40px;line-height: 40px;float: left;color:#F00;font-size: 12px;">温馨提示考试过程中请退出或关闭本页面不会终止计时</div>
<div style="display: inline-block;position: relative;bottom: 20px;height: 40px;line-height: 40px;margin-right: 10px;font-weight:bold;">{{ '剩余时间:'+countdownTime }}</div>
<el-button-group class="buttons">
<el-button v-loading="loading" type="primary" @click="commit"> </el-button>
@ -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 {
@ -51,7 +52,7 @@ export default {
passScore: 10
},
examQuestions: [],
theoryAnswers: [],
theoryAnswersMap: {},
countdownTime: '00:00:00',
theoryExamTime: 0,
countdown: null
@ -100,15 +101,32 @@ 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;
el.answer = this.theoryAnswersMap[el.id];
return el;
});
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) {
@ -157,20 +175,28 @@ export default {
}
},
doEnd() {
const theoryAnswers = [];
for (const key in this.theoryAnswersMap) {
theoryAnswers.push({questionId: key, answerOptionId: this.theoryAnswersMap[key]});
}
const params = {
competitionId: this.$route.query.raceId,
theoryAnswers: this.theoryAnswers
theoryAnswers: theoryAnswers
};
postCompetitionTheory(params).then(()=>{
this.$router.push({ path: `/jsxt/result`, query: { type: 'theory', raceId:this.$route.query.raceId } });
});
},
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);

View File

@ -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;
},