diff --git a/src/jmapNew/shape/Station/index.js b/src/jmapNew/shape/Station/index.js index d508a395a..d9b248dfc 100644 --- a/src/jmapNew/shape/Station/index.js +++ b/src/jmapNew/shape/Station/index.js @@ -318,8 +318,7 @@ export default class Station extends Group { setState(model) { if (!this.isShowShape) return; this.recover(); - // model.controlMode && this['handle' + model.controlMode](); - this.handleLocal(); + model.controlMode && this['handle' + model.controlMode](); } getShapeTipPoint(opts) { diff --git a/src/jmapNew/utils/parser.js b/src/jmapNew/utils/parser.js index c7c3f6186..b0f127fd2 100644 --- a/src/jmapNew/utils/parser.js +++ b/src/jmapNew/utils/parser.js @@ -147,7 +147,7 @@ export function parser(data, skinCode, showConfig) { zrUtil.each(data.arrowList || [], elem => { mapDevice[elem.code] = createDevice(deviceType.Arrow, elem, propConvert, showConfig); }, this); - zrUtil.each(data.powerList || [], elem => { + zrUtil.each(data.powerLineList || [], elem => { mapDevice[elem.code] = createDevice(deviceType.Power, elem, propConvert, showConfig); }, this); zrUtil.each(data.indicatorLightList || [], elem => { @@ -329,7 +329,7 @@ export function updateMapData(state, model) { case deviceType.SplitStation: updateForList(model, state, 'splitStationList'); break; case deviceType.SwitchFault: updateForList(model, state, 'indicatorLightList'); 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; } } } diff --git a/src/store/modules/map.js b/src/store/modules/map.js index 96f3d7bd4..c4c21fa75 100644 --- a/src/store/modules/map.js +++ b/src/store/modules/map.js @@ -342,9 +342,9 @@ const map = { return []; } }, - powerList: (state) => { + powerLineList: (state) => { if (state.map) { - return state.map.powerList || []; + return state.map.powerLineList || []; } else { return []; } diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 778caeb7b..836771751 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -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'; // 张赛 diff --git a/src/views/jsxt/competition/theory/quiz/index.vue b/src/views/jsxt/competition/theory/quiz/index.vue index 195e96321..2d3b90835 100644 --- a/src/views/jsxt/competition/theory/quiz/index.vue +++ b/src/views/jsxt/competition/theory/quiz/index.vue @@ -14,6 +14,8 @@ +
温馨提示:考试过程中请不要刷新或关闭本页面!
+
{{ '剩余时间:'+countdownTime }}
提 交 @@ -49,7 +51,10 @@ export default { passScore: 10 }, examQuestions: [], - theoryAnswers: [] + theoryAnswers: [], + countdownTime: '00:00:00', + theoryExamTime: 0, + countdown: null }; }, computed: { @@ -89,6 +94,9 @@ export default { beforeDestroy() { quitCurrentRace(this.$route.query.raceId, {}).then(res=>{ }); + if (this.countdown) { + clearInterval(this.countdown); + } }, methods: { loadInitData() { @@ -99,6 +107,18 @@ export default { el.index = i; 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}`); }); }, @@ -124,7 +144,7 @@ export default { if (!el.answer) { isFinish = false; } }); - if (isFinish) { + if (isFinish || this.theoryExamTime <= 0) { this.doEnd(); } else { this.$confirm('存在试题未完成,是否继续?', '提 示', { @@ -151,6 +171,22 @@ export default { answerOptionId: data.answer, 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; } } }; diff --git a/src/views/newMap/newMapdraft/mapoperate/power.vue b/src/views/newMap/newMapdraft/mapoperate/power.vue index 95309be89..be8bc209e 100644 --- a/src/views/newMap/newMapdraft/mapoperate/power.vue +++ b/src/views/newMap/newMapdraft/mapoperate/power.vue @@ -110,7 +110,7 @@ export default { editModel: { code: '', width: 1, - leftTerminal: true, + leftTerminal: true, // 左端点显示 rightTerminal: true, showConditions: '01', // 显示条件 points: [] @@ -143,7 +143,7 @@ export default { }, computed: { ...mapGetters('map', [ - 'powerList' + 'powerLineList' ]), form() { const form = { @@ -156,7 +156,7 @@ export default { draw: { name: this.$t('map.drawData'), 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: '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}, @@ -213,7 +213,7 @@ export default { const pointArr = JSON.stringify(this.addModel.points); const model = { _type: 'Power', - code: getUID('Power', this.powerList), + code: getUID('Power', this.powerLineList), width: this.addModel.width, leftTerminal: true, rightTerminal: true,