From 55f57e21353489e978114e3f67ccb506aed02746 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Thu, 28 May 2020 15:02:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/Station/index.js | 3 +-- src/jmapNew/utils/parser.js | 4 ++-- src/store/modules/map.js | 4 ++-- src/views/newMap/newMapdraft/mapoperate/power.vue | 8 ++++---- 4 files changed, 9 insertions(+), 10 deletions(-) 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/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, From c300fe2f5fd48c813ea3773a06afa5c697abec0d Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Thu, 28 May 2020 15:03:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=90=86=E8=AE=BA=E8=80=83=E8=AF=95?= =?UTF-8?q?=E5=80=92=E8=AE=A1=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/baseUrl.js | 4 +- .../jsxt/competition/theory/quiz/index.vue | 42 ++++++++++++++++++- 2 files changed, 42 insertions(+), 4 deletions(-) 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 6c78db0ac..147e65b18 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: { @@ -86,6 +91,11 @@ export default { created() { this.loadInitData(); }, + beforeDestroy() { + if (this.countdown) { + clearInterval(this.countdown); + } + }, methods: { loadInitData() { this.theoryAnswers = []; @@ -95,6 +105,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}`); }); }, @@ -120,7 +142,7 @@ export default { if (!el.answer) { isFinish = false; } }); - if (isFinish) { + if (isFinish || this.theoryExamTime <= 0) { this.doEnd(); } else { this.$confirm('存在试题未完成,是否继续?', '提 示', { @@ -147,6 +169,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; } } };