From 7f72ed4048309bfa3ead7f68265bcccfb50a8045 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 5 Jun 2020 13:05:33 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=A3=81=E5=88=A4=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/jsxt/apply/index.vue | 4 ++-- src/views/jsxt/refereeList/display.vue | 18 ++++++++++++++++++ src/views/jsxt/refereeList/index.vue | 19 +++++++++++++++---- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/views/jsxt/apply/index.vue b/src/views/jsxt/apply/index.vue index 8333e0aed..0a0bffba8 100644 --- a/src/views/jsxt/apply/index.vue +++ b/src/views/jsxt/apply/index.vue @@ -58,7 +58,7 @@
-
报名成功!:
您的赛事信息如下: +
报名成功!
您的赛事信息如下:
竞赛名称:{{ compition.name }}
竞赛时间:{{ compition.startDate }}
姓名:{{ formModel.name }} @@ -85,7 +85,7 @@
- + diff --git a/src/views/jsxt/refereeList/display.vue b/src/views/jsxt/refereeList/display.vue index f60c7f7f3..a524565de 100644 --- a/src/views/jsxt/refereeList/display.vue +++ b/src/views/jsxt/refereeList/display.vue @@ -16,7 +16,9 @@ import { mapGetters } from 'vuex'; import { checkLoginLine } from '@/api/login'; import { EventBus } from '@/scripts/event-bus'; import MenuReplay from './menuReplay'; +import { getToken } from '@/utils/auth'; import { DeviceMenu, getDeviceMenuByDeviceType } from '@/scripts/ConstDic'; +import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp'; export default { name:'RefereeDisplay', components: { @@ -52,10 +54,14 @@ export default { }, height() { return this.$store.state.app.height; + }, + group() { + return this.$route.query.group; } }, watch: { '$store.state.map.mapViewLoadedCount': function (val) { // 地图视图加载完成标识 开始加载默认状态 + this.subscribe(); this.mapBoxP = document.getElementById(this.canvasId).children[0]; this.mapBoxP.style.cursor = ''; }, @@ -67,10 +73,12 @@ export default { } }, async mounted() { + window.onbeforeunload = this.clearSubscribe; await this.setWindowSize(); await this.initLoadData(); }, async beforeDestroy() { + this.clearSubscribe(); await this.clearAllTimer(); await this.quit(); await this.$store.dispatch('training/reset'); @@ -81,6 +89,16 @@ export default { async back() { // await this.$refs.menuScript.back(); }, + clearSubscribe() { + clearSubscribe(`${displayTopic}\/${this.group}`); + }, + async subscribe() { + this.clearSubscribe(); + const header = { group: this.group || '', 'X-Token': getToken() }; + creatSubscribe(`${displayTopic}\/${this.group}`, header); + + await this.$store.dispatch('training/setHasSubscribed'); + }, // 加载数据 async initLoadData() { this.$store.dispatch('training/reset'); diff --git a/src/views/jsxt/refereeList/index.vue b/src/views/jsxt/refereeList/index.vue index 8f7c52e78..94c1b04fe 100644 --- a/src/views/jsxt/refereeList/index.vue +++ b/src/views/jsxt/refereeList/index.vue @@ -82,7 +82,7 @@ export default { prop: 'theoryScore', width:100, type: 'tag', - columnValue: (row) => { return row.artificialTheoryScore ? `${row.theoryScore}(${row.artificialTheoryScore})` : row.theoryScore || '0'; }, + columnValue: (row) => { return row.artificialTheoryScore ? `${row.theoryScore}(${row.artificialTheoryScore})` : this.covert(row.theoryScore); }, tagType: (row) => { return 'success'; } }, { @@ -90,7 +90,7 @@ export default { prop: 'practiceScore', width:100, type: 'tag', - columnValue: (row) => { return row.artificialPracticeScore ? `${row.practiceScore}(${row.artificialPracticeScore})` : row.practiceScore || '0'; }, + columnValue: (row) => { return row.artificialPracticeScore ? `${row.practiceScore}(${row.artificialPracticeScore})` : this.covert(row.practiceScore); }, tagType: (row) => { return 'success'; } }, { @@ -119,13 +119,13 @@ export default { name: '理论结果', handleClick: this.handleTheoryResult, type: '', - showControl: (row) => { return row.status == '5' || row.status == '4'; } + showControl: (row) => { return row.status == '5' || row.status == '4' || row.theoryScore != undefined; } }, { name: '实操回放', handleClick: this.playBack, type: '', - showControl: (row) => { return row.status == '4'; } + showControl: (row) => { return row.status == '4' || row.status == '6' || row.practiceScore != undefined; } }, { name: '修改', @@ -183,6 +183,17 @@ export default { this.$refs.theoryResult.doShow({row:row, raceId:this.$route.query.raceId}); // this.$router.replace({ path: `/jsxt/theory/result?raceId=${this.$route.query.raceId}&result=true` }); }, + covert(data) { + if (data != undefined) { + if (data > 0) { + return data; + } else { + return '0'; + } + } else { + return ''; + } + }, handleAdd() { const loading = this.$loading({ lock: true, From 767e5cc48a2fbe44b070b3af61e75b7aefb6ea45 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 5 Jun 2020 13:41:47 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=A3=81=E5=88=A4=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/jsxt/refereeList/display.vue | 53 ++++++++++++++++++++- src/views/jsxt/refereeList/theoryResult.vue | 26 +++++++--- 2 files changed, 70 insertions(+), 9 deletions(-) diff --git a/src/views/jsxt/refereeList/display.vue b/src/views/jsxt/refereeList/display.vue index a524565de..8195c8eb1 100644 --- a/src/views/jsxt/refereeList/display.vue +++ b/src/views/jsxt/refereeList/display.vue @@ -65,13 +65,31 @@ export default { this.mapBoxP = document.getElementById(this.canvasId).children[0]; this.mapBoxP.style.cursor = ''; }, - // 'size.width': function(val) { - // this.setWindowSize(); + '$store.state.socket.equipmentStatus': function (val) { + if (val.length) { + this.statusMessage(val); + } + }, + '$store.state.socket.trainStationList': function (val) { + if (val.length) { + this.runFactMessage(val); + } + }, + // '$store.state.socket.simulationError': function (val) { + // if (val) { + // this.simulationError(val); + // } // }, + '$store.state.socket.simulationReset': function (val) { + if (val) { + this.simulationReset(val); + } + }, '$store.state.app.windowSizeCount': function() { this.setWindowSize(); } }, + async mounted() { window.onbeforeunload = this.clearSubscribe; await this.setWindowSize(); @@ -99,6 +117,37 @@ export default { await this.$store.dispatch('training/setHasSubscribed'); }, + async statusMessage(list) { + await this.$store.dispatch('training/updateMapState', list); + await this.$store.dispatch('socket/setEquipmentStatus'); + }, + async runFactMessage(list) { + await this.$store.dispatch('runPlan/updateRunPlanData', list); + await this.$store.dispatch('socket/setTrainStationList'); + }, + async simulationReset() { + await this.$store.dispatch('map/clearJlmapTrainView'); + await this.$store.dispatch('map/setTrainWindowShow', false); + await this.$store.dispatch('training/over'); + await this.$store.dispatch('socket/setSimulationReset'); + await this.$store.dispatch('socket/setSimulationStart'); + await this.$store.dispatch('training/setMapDefaultState'); + }, + // async simulationError() { + // await this.$store.dispatch('map/clearJlmapTrainView'); + // await this.$store.dispatch('map/setTrainWindowShow', false); + // await this.$store.dispatch('socket/setSimulationError'); + // await this.$store.dispatch('training/setMapDefaultState'); + // this.clearSubscribe(); + // this.$confirm(this.$t('tip.getMapStateDataException'), this.$t('tip.hint'), { + // confirmButtonText: this.$t('global.confirm'), + // showCancelButton: false, + // type: 'warning' + // }).then(() => { + // this.$emit('back'); + // }).catch(() => { + // }); + // }, // 加载数据 async initLoadData() { this.$store.dispatch('training/reset'); diff --git a/src/views/jsxt/refereeList/theoryResult.vue b/src/views/jsxt/refereeList/theoryResult.vue index 9f545408d..e9f9e6630 100644 --- a/src/views/jsxt/refereeList/theoryResult.vue +++ b/src/views/jsxt/refereeList/theoryResult.vue @@ -1,10 +1,12 @@ + From 6f0cc20a42d7f0dca2bdf59f037a57e1c4aef5b0 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 5 Jun 2020 14:12:22 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=96=B0=E7=89=88=E5=89=A7=E6=9C=AC?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=B9=E8=AF=9D=E4=BB=A3=E7=A0=81=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/simulation.js | 10 ++++ .../scriptManage/scriptRecord/addAction.vue | 49 +++++++++++++------ .../scriptManage/scriptRecord/getAction.vue | 10 ++-- 3 files changed, 48 insertions(+), 21 deletions(-) diff --git a/src/api/simulation.js b/src/api/simulation.js index 43ecc026c..be1d41e60 100644 --- a/src/api/simulation.js +++ b/src/api/simulation.js @@ -385,6 +385,15 @@ export function modifyScriptAction(group, actionId, data) { }); } +/** 修改剧本动作(新版) */ +export function modifyScriptActionNew(group, data) { + return request({ + url: `/api/scriptSimulation/${group}/action/update`, + method: 'put', + data + }); +} + /** 分页查询存在的仿真 */ export function getExistingSimulation(params) { return request({ @@ -709,3 +718,4 @@ export function getMemberInfo(group, memberId) { method: 'get' }); } + diff --git a/src/views/scriptManage/scriptRecord/addAction.vue b/src/views/scriptManage/scriptRecord/addAction.vue index 66bb76afc..46d315955 100644 --- a/src/views/scriptManage/scriptRecord/addAction.vue +++ b/src/views/scriptManage/scriptRecord/addAction.vue @@ -75,7 +75,7 @@ import Vue from 'vue'; import Cookies from 'js-cookie'; import ConstConfig from '@/scripts/ConstConfig'; import CommandOperation from './command'; -import {addScriptAction, addScriptActionNew, modifyScriptAction, getAvailableDeviceCommand, getScriptPlayMember, getScriptPlayMemberNew} from '@/api/simulation'; +import {addScriptAction, addScriptActionNew, modifyScriptAction, modifyScriptActionNew, getAvailableDeviceCommand, getScriptPlayMember, getScriptPlayMemberNew} from '@/api/simulation'; export default { name: 'AddAction', components:{ @@ -451,20 +451,39 @@ export default { } else { const actionId = this.modalData.actionVO.id; - modifyScriptAction(group, actionId, data).then(response=>{ - this.modifying = false; - this.isNotModify = true; - this.$emit('setDisabled', this.isNotModify); - this.buttonName = this.$t('scriptRecord.addConversitionButton'); - this.operateType = 'add'; - this.$message.success(this.$t('scriptRecord.modifyConversitionSuccess')); - this.$emit('create'); - // this.$parent.$parent.$refs['addRole'].resetData([this.modalData.action.memberId,this.modalData.action.targetId]); - this.initActionData(); - }).catch(error => { - this.modifying = false; - this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`); - }); + if (this.drawWay) { + data.id = actionId; + modifyScriptActionNew(group, data).then(response=>{ + this.modifying = false; + this.isNotModify = true; + this.$emit('setDisabled', this.isNotModify); + this.buttonName = this.$t('scriptRecord.addConversitionButton'); + this.operateType = 'add'; + this.$message.success(this.$t('scriptRecord.modifyConversitionSuccess')); + this.$emit('create'); + // this.$parent.$parent.$refs['addRole'].resetData([this.modalData.action.memberId,this.modalData.action.targetId]); + this.initActionData(); + }).catch(error => { + this.modifying = false; + this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`); + }); + } else { + modifyScriptAction(group, actionId, data).then(response=>{ + this.modifying = false; + this.isNotModify = true; + this.$emit('setDisabled', this.isNotModify); + this.buttonName = this.$t('scriptRecord.addConversitionButton'); + this.operateType = 'add'; + this.$message.success(this.$t('scriptRecord.modifyConversitionSuccess')); + this.$emit('create'); + // this.$parent.$parent.$refs['addRole'].resetData([this.modalData.action.memberId,this.modalData.action.targetId]); + this.initActionData(); + }).catch(error => { + this.modifying = false; + this.$messageBox(`${this.$t('scriptRecord.modifyConversitionFail')}: ${error.message}`); + }); + } + } } else { console.log('error submit!!'); diff --git a/src/views/scriptManage/scriptRecord/getAction.vue b/src/views/scriptManage/scriptRecord/getAction.vue index 3de960ade..0d78946cd 100644 --- a/src/views/scriptManage/scriptRecord/getAction.vue +++ b/src/views/scriptManage/scriptRecord/getAction.vue @@ -20,7 +20,7 @@
- {{ $t('scriptRecord.modifyConversitionButton') }} + {{ $t('scriptRecord.modifyConversitionButton') }}
@@ -158,8 +158,8 @@ export default { // memberVOList = memberVOList.replace(new RegExp(rolename, 'g'), element.label); // }); // memberVOList = JSON.parse(memberVOList); - const lastData = JSON.stringify(response.data); - const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew); + const lastData = JSON.stringify(response.data.memberVOList); + const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleType); const actionList = response.data.actionVOList; @@ -218,9 +218,7 @@ export default { this.loadInitData(); }, modifyAction(row) { - if (!this.drawWay) { - this.$emit('setAction', row); - } + this.$emit('setAction', row); } } }; From 377473ea4c1a705274d7e2ec9750564663599fa5 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 5 Jun 2020 14:22:46 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=96=B0=E7=89=88=E5=89=A7=E6=9C=AC?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A7=92=E8=89=B2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scripts/ConstConfig.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/scripts/ConstConfig.js b/src/scripts/ConstConfig.js index a462dc7b9..73f6f7ee7 100644 --- a/src/scripts/ConstConfig.js +++ b/src/scripts/ConstConfig.js @@ -90,11 +90,13 @@ export default { roleTypeNew:[ {label: '管理员', value: 'ADMIN', enLabel: 'Admin '}, {label: '教员', value: 'Instructor', enLabel: 'Instructor '}, - {label: '行调', value: 'DISPATCHER', enLabel: 'Dispatcher '}, {label: '行值', value: 'STATION_SUPERVISOR', enLabel: 'Attendant '}, {label: '观众', value: 'AUDIENCE', enLabel: 'Audience '}, {label: '司机', value: 'DRIVER', enLabel: 'Driver '}, - {label: '通号', value: 'MAINTAINER', enLabel: 'Repairman '} + {label: '通号', value: 'MAINTAINER', enLabel: 'Repairman '}, + {label: '车辆段调度', value: 'DEPOT_DISPATCHER', enLabel: 'Depot dispatcher '}, + {label: '工电调度', value: 'ELECTRIC_DISPATCHER', enLabel: 'Electric dispatcher'}, + {label: '行调', value: 'DISPATCHER', enLabel: 'Dispatcher '} ], SimulationType: [ { label: '实训', value: 'Training'},