# Conflicts:
#	src/views/jsxt/competition/theory/quiz/index.vue
This commit is contained in:
joylink_cuiweidong 2020-05-28 15:31:11 +08:00
commit 8822e8b3c7
6 changed files with 49 additions and 14 deletions

View File

@ -318,8 +318,7 @@ export default class Station extends Group {
setState(model) { setState(model) {
if (!this.isShowShape) return; if (!this.isShowShape) return;
this.recover(); this.recover();
// model.controlMode && this['handle' + model.controlMode](); model.controlMode && this['handle' + model.controlMode]();
this.handleLocal();
} }
getShapeTipPoint(opts) { getShapeTipPoint(opts) {

View File

@ -147,7 +147,7 @@ export function parser(data, skinCode, showConfig) {
zrUtil.each(data.arrowList || [], elem => { zrUtil.each(data.arrowList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Arrow, elem, propConvert, showConfig); mapDevice[elem.code] = createDevice(deviceType.Arrow, elem, propConvert, showConfig);
}, this); }, this);
zrUtil.each(data.powerList || [], elem => { zrUtil.each(data.powerLineList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Power, elem, propConvert, showConfig); mapDevice[elem.code] = createDevice(deviceType.Power, elem, propConvert, showConfig);
}, this); }, this);
zrUtil.each(data.indicatorLightList || [], elem => { zrUtil.each(data.indicatorLightList || [], elem => {
@ -329,7 +329,7 @@ export function updateMapData(state, model) {
case deviceType.SplitStation: updateForList(model, state, 'splitStationList'); break; case deviceType.SplitStation: updateForList(model, state, 'splitStationList'); break;
case deviceType.SwitchFault: updateForList(model, state, 'indicatorLightList'); break; case deviceType.SwitchFault: updateForList(model, state, 'indicatorLightList'); break;
case deviceType.Arrow: updateForList(model, state, 'arrowList'); break; case deviceType.Arrow: updateForList(model, state, 'arrowList'); break;
case deviceType.Power: updateForList(model, state, 'powerList'); break; case deviceType.Power: updateForList(model, state, 'powerLineList'); break;
} }
} }
} }

View File

@ -342,9 +342,9 @@ const map = {
return []; return [];
} }
}, },
powerList: (state) => { powerLineList: (state) => {
if (state.map) { if (state.map) {
return state.map.powerList || []; return state.map.powerLineList || [];
} else { } else {
return []; return [];
} }

View File

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

View File

@ -14,6 +14,8 @@
</div> </div>
</el-main> </el-main>
<el-footer class="quiz__container-footer layer-center" @click="returnTop"> <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;margin-right: 10px;font-weight:bold;">{{ '剩余时间:'+countdownTime }}</div>
<el-button-group class="buttons"> <el-button-group class="buttons">
<el-button v-loading="loading" type="primary" @click="commit"> </el-button> <el-button v-loading="loading" type="primary" @click="commit"> </el-button>
</el-button-group> </el-button-group>
@ -49,7 +51,10 @@ export default {
passScore: 10 passScore: 10
}, },
examQuestions: [], examQuestions: [],
theoryAnswers: [] theoryAnswers: [],
countdownTime: '00:00:00',
theoryExamTime: 0,
countdown: null
}; };
}, },
computed: { computed: {
@ -89,6 +94,9 @@ export default {
beforeDestroy() { beforeDestroy() {
quitCurrentRace(this.$route.query.raceId, {}).then(res=>{ quitCurrentRace(this.$route.query.raceId, {}).then(res=>{
}); });
if (this.countdown) {
clearInterval(this.countdown);
}
}, },
methods: { methods: {
loadInitData() { loadInitData() {
@ -99,6 +107,18 @@ export default {
el.index = i; el.index = i;
return el; return el;
}); });
this.theoryExamTime = resp.data.theoryExamTime * 60;
this.countdownTime = this.computationTime(this.theoryExamTime);
this.countdown = setInterval(() => {
if (this.theoryExamTime <= 0) {
if (this.countdown) {
clearInterval(this.countdown);
}
this.commit();
}
this.theoryExamTime--;
this.countdownTime = this.computationTime(this.theoryExamTime);
}, 1000);
} }
}).catch(error => { this.$message.error(`加载考试详情失败:${error.message}`); }); }).catch(error => { this.$message.error(`加载考试详情失败:${error.message}`); });
}, },
@ -124,7 +144,7 @@ export default {
if (!el.answer) { isFinish = false; } if (!el.answer) { isFinish = false; }
}); });
if (isFinish) { if (isFinish || this.theoryExamTime <= 0) {
this.doEnd(); this.doEnd();
} else { } else {
this.$confirm('存在试题未完成,是否继续?', '提 示', { this.$confirm('存在试题未完成,是否继续?', '提 示', {
@ -151,6 +171,22 @@ export default {
answerOptionId: data.answer, answerOptionId: data.answer,
questionId: data.userExamQuestionId questionId: data.userExamQuestionId
}); });
},
computationTime(time) {
let hours = Math.floor(time / 3600);
const newTime = time % 3600;
let minutes = Math.floor(newTime / 60) + '';
let seconds = newTime % 60;
if (hours < 10) {
hours = '0' + hours;
}
if (minutes < 10) {
minutes = '0' + minutes;
}
if (seconds < 10) {
seconds = '0' + seconds;
}
return hours + ':' + minutes + ':' + seconds;
} }
} }
}; };

View File

@ -110,7 +110,7 @@ export default {
editModel: { editModel: {
code: '', code: '',
width: 1, width: 1,
leftTerminal: true, leftTerminal: true, //
rightTerminal: true, rightTerminal: true,
showConditions: '01', // showConditions: '01', //
points: [] points: []
@ -143,7 +143,7 @@ export default {
}, },
computed: { computed: {
...mapGetters('map', [ ...mapGetters('map', [
'powerList' 'powerLineList'
]), ]),
form() { form() {
const form = { const form = {
@ -156,7 +156,7 @@ export default {
draw: { draw: {
name: this.$t('map.drawData'), name: this.$t('map.drawData'),
item: [ item: [
{ prop: 'code', label: '供电线路', type: 'select', optionLabel: 'code', optionValue: 'code', options: this.powerList, change: true, deviceChange: this.deviceChange }, { prop: 'code', label: '供电线路', type: 'select', optionLabel: 'code', optionValue: 'code', options: this.powerLineList, change: true, deviceChange: this.deviceChange },
{ prop: 'width', label: '供电线路宽度', type: 'number', min: 1, placeholder: 'px' }, { prop: 'width', label: '供电线路宽度', type: 'number', min: 1, placeholder: 'px' },
{ prop: 'showConditions', label: this.$t('map.showConditions'), type: 'radio', optionLabel: 'label', optionValue:'value', radioList: this.showConditionsList}, { prop: 'showConditions', label: this.$t('map.showConditions'), type: 'radio', optionLabel: 'label', optionValue:'value', radioList: this.showConditionsList},
{ prop: 'leftTerminal', label: '左侧端点:', type: 'select', optionLabel: 'label', optionValue:'value', options: this.terminalList}, { prop: 'leftTerminal', label: '左侧端点:', type: 'select', optionLabel: 'label', optionValue:'value', options: this.terminalList},
@ -213,7 +213,7 @@ export default {
const pointArr = JSON.stringify(this.addModel.points); const pointArr = JSON.stringify(this.addModel.points);
const model = { const model = {
_type: 'Power', _type: 'Power',
code: getUID('Power', this.powerList), code: getUID('Power', this.powerLineList),
width: this.addModel.width, width: this.addModel.width,
leftTerminal: true, leftTerminal: true,
rightTerminal: true, rightTerminal: true,