diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index e0819251a..e413b49b8 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -54,7 +54,7 @@ class Jlmap { this.previewOrMapDraw = opts.showConfig.previewOrMapDraw; this.$zr = zrender.init(opts.dom, deepAssign({ renderer, devicePixelRatio, width, height }, opts.config)); - this.$zr.dom.setAttribute('tabIndex', -1); + this.$zr.dom.setAttribute('tabIndex', -1); this.$options = new Options(deepAssign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {}), (dataZoom) => { this.$mouseController.trigger(this.events.DataZoom, dataZoom); }); // 缩放 this.$painter = new Painter(this); @@ -501,6 +501,14 @@ class Jlmap { psdDevice.fault = elem.fault; this.$painter.update(psdDevice); } + } else if (elem.deviceType === 'DIRECTION_ROD') { + store.state.map.directionRodList.forEach(item => { + if (elem.uniqueCode && elem.uniqueCode === `${item.startStationCode}-${item.endStationCode}-${item.right}`) { + this.$painter.update(elem); + } else if (!elem.uniqueCode) { + this.$painter.update(elem); + } + }); } const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig); if (elem.dispose) { diff --git a/src/jmapNew/shape/DirectionRod/index.js b/src/jmapNew/shape/DirectionRod/index.js index 55fd2f143..11ea752fa 100644 --- a/src/jmapNew/shape/DirectionRod/index.js +++ b/src/jmapNew/shape/DirectionRod/index.js @@ -29,7 +29,7 @@ export default class DirectionRod extends Group { zlevel: this.zlevel, z: this.z, origin: [model.position.x + (style.DirectionRod.rodLength / 2), model.position.y], - rotation: model.right ? 0 : Math.PI, + rotation: model.right ? Math.PI : 0, shape: { points: [ [model.position.x, model.position.y], @@ -75,6 +75,15 @@ export default class DirectionRod extends Group { setState(model) { // if (!this.isShowShape) return; // this.recover(); + if (model.reverse && this.model.right) { + this.rod.attr('rotation', 0); + } else if (!model.reverse && this.model.right) { + this.rod.attr('rotation', Math.PI); + } else if (model.reverse && !this.model.right) { + this.rod.attr('rotation', Math.PI); + } else if (!model.reverse && !this.model.right) { + this.rod.attr('rotation', 0); + } } createMouseEvent() { @@ -88,6 +97,9 @@ export default class DirectionRod extends Group { } else { this.hideMode(); } + } + drawSelected() { + } setShowStation(stationCode) { if (!stationCode || this.model.stationCode === stationCode) { diff --git a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue index eef67ab7c..cd2770dee 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue @@ -103,7 +103,8 @@ export default { signalParamList: [], stationParamList: [], standParamList: [], - routeParamList: [] + routeParamList: [], + directionRodParamList: [] }; }, computed: { @@ -153,6 +154,9 @@ export default { case 'StationStand': this.handleStandMenu(); break; + case 'DirectionRod': + this.handleDirectionRodMenu(); + break; } } }).catch((error) => { @@ -368,6 +372,21 @@ export default { speedLimitValue: '5' }; }, + handleDirectionRodMenu() { + this.clearAllMenuShow(); + this.deviceHighLight(this.oldDevice, false); + this.deviceHighLight(this.selectedObj, true); + this.oldDevice = this.selectedObj; + this.centralizedStationList = new Array(15).fill({}); + this.directionRodParamList.forEach((directionRod, index) => { + this.centralizedStationList[index] = directionRod; + }); + this.tempData = []; + this.tempData.push(this.selectedObj); + this.param = { + directionRodCode: `${this.selectedObj.startStationCode}-${this.selectedObj.endStationCode}-${this.selectedObj.right}` + }; + }, handleBasicMenu() { this.deviceHighLight(this.oldDevice, false); if (this.oldClickObj) { @@ -557,6 +576,10 @@ export default { { name: '越站', cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP, operate: OperationEvent.StationStand.setJumpStop.menuButton, show: false, securityCommand: true }, { name: '取消越站', cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP, operate: OperationEvent.StationStand.cancelJumpStop.menuButton, show: false, securityCommand: true } ]; + this.directionRodParamList = [ + { name: '切换左向', cmdType: CMD.DirectionRod.CMD_DIRECTION_CHANGE, operate: OperationEvent.StationStand.setDetainTrain.menuButton, show: false }, + { name: '切换右向', cmdType: CMD.DirectionRod.CMD_DIRECTION_CHANGE, operate: OperationEvent.StationStand.setDetainTrain.menuButton, show: false } + ]; }, initRouteMenus() { this.routeParamList = []; diff --git a/src/scripts/ConstConfig.js b/src/scripts/ConstConfig.js index 18f05735f..844fea319 100644 --- a/src/scripts/ConstConfig.js +++ b/src/scripts/ConstConfig.js @@ -150,7 +150,8 @@ export default { { label: '车次窗', value: 'TrainWindow' }, { label: '全线限速', value: 'LimitControl' }, { label: '司机', value: 'Driver' }, - { label: '列车', value: 'Train' } + { label: '列车', value: 'Train' }, + { label: '方向杆', value: 'DirectionRod'} ], simulationDeviceList:[ diff --git a/src/scripts/cmdPlugin/CommandEnum.js b/src/scripts/cmdPlugin/CommandEnum.js index 7eb2467fb..588e35baa 100644 --- a/src/scripts/cmdPlugin/CommandEnum.js +++ b/src/scripts/cmdPlugin/CommandEnum.js @@ -260,5 +260,8 @@ export default { }, LimitControl: { CMD_CANCEL_ALL_LIMIT_SPEED: {value: 'Cancel_All_Limit_Speed', label: '取消全线临时限速'} + }, + DirectionRod: { + CMD_DIRECTION_CHANGE: {value: 'Direction_Change', label: '切换方向'} } }; diff --git a/src/store/modules/scriptRecord.js b/src/store/modules/scriptRecord.js index eed8e295b..e9fa3e90d 100644 --- a/src/store/modules/scriptRecord.js +++ b/src/store/modules/scriptRecord.js @@ -13,7 +13,8 @@ const scriptRecord = { updateRoleStatus:0, // 剧本更新角色标志 updateRoleId:'', // 剧本更新角色id updateCoversitionStatus:0, // 剧本仿真更新会话信息 - userRole:null // 剧本更新的角色 + userRole:null, // 剧本更新的角色 + operationalItemVOs:{} // 剧本场景的运营统计数据缓存 }, getters: { mapLocation: (state)=>{ @@ -72,6 +73,9 @@ const scriptRecord = { }, updateCoversitionInfo:(state) => { state.updateCoversitionStatus += 1; + }, + updateOperationalItemVOs:(state, operationalItemVOs) => { + state.operationalItemVOs = operationalItemVOs; } }, actions: { @@ -101,6 +105,9 @@ const scriptRecord = { }, updateCoversitionInfo:({ commit }) => { commit('updateCoversitionInfo'); + }, + updateOperationalItemVOs:({ commit }, operationalItemVOs) => { + commit('updateOperationalItemVOs', operationalItemVOs); } } }; diff --git a/src/views/newMap/chatView/chatBox.vue b/src/views/newMap/chatView/chatBox.vue index 79cfb7e02..916fbbac6 100644 --- a/src/views/newMap/chatView/chatBox.vue +++ b/src/views/newMap/chatView/chatBox.vue @@ -401,7 +401,7 @@ export default { } }); // { label: '全部集中站', value: 'allConcentrateStation', active: false, sign: 'DEVICE_STATION' }, - stationSupervisorList['ALL_STATION'] = { label: '全部车站', value: 'allStation', active: false, sign: 'ALL_STATION' }; + stationSupervisorList['ALL_STATION'] = { label: '所有车站', value: 'allStation', active: false, sign: 'ALL_STATION' }; driverList['ALL_TRAIN'] = { label: '所有司机', value: 'allTrain', show: false, active: false, sign: 'ALL_TRAIN' }; this.treeData = [{ label: '行调', diff --git a/src/views/newMap/displayNew/demon/faultChoose.vue b/src/views/newMap/displayNew/demon/faultChoose.vue index 9cabec412..561d08c32 100644 --- a/src/views/newMap/displayNew/demon/faultChoose.vue +++ b/src/views/newMap/displayNew/demon/faultChoose.vue @@ -23,7 +23,7 @@ @@ -103,8 +103,10 @@ @@ -153,7 +155,7 @@ export default { triggerDeviceStatus:'', triggerDeviceType :'', type:'DEVICE', - triggeringTime: '', + triggerTime: '', triggerAssociatedDeviceCode: '' } }, @@ -230,6 +232,9 @@ export default { return name; }, formatTriggerStatus(condition) { + if (!condition.triggerDeviceType) { + return ''; + } const faultStatus = FaultStatusEnum[condition.triggerDeviceType]; return faultStatus[condition.triggerDeviceStatus]; }, @@ -330,7 +335,7 @@ export default { triggerDeviceStatus:'', triggerDeviceType :'', type:'DEVICE', - triggeringTime: '', + triggerTime: '', triggerAssociatedDeviceCode: '' } }; @@ -385,11 +390,11 @@ export default { this.$messageBox('请选择触发状态'); return; } - if (this.triggerMode === 'DEVICE' && this.faultRule.faultType == '') { + if (this.faultRule.faultType == '') { this.$messageBox('请选择故障类型'); return; } - if (this.triggerMode === 'TIME' && this.faultRule.condition.triggeringTime) { + if (this.triggerMode === 'TIME' && this.faultRule.condition.triggerTime == '') { this.$messageBox('请选择触发时间'); return; } @@ -397,7 +402,20 @@ export default { this.$messageBox('请选择关联设备'); return; } - setFailureModeNew(this.faultRule, this.$route.query.group).then(res=>{ + const param = { + targetDeviceCode:this.targetDevice.code, + targetDeviceType:this.covertType(this.targetDevice._type), + faultType: this.faultRule.faultType, + condition:{ + triggerDeviceCode: this.faultRule.condition.triggerDeviceCode || null, + triggerDeviceStatus:this.faultRule.condition.triggerDeviceStatus || null, + triggerDeviceType :this.faultRule.condition.triggerDeviceType || null, + type:this.faultRule.condition.type, + triggerTime: this.faultRule.condition.triggerTime || null, + triggerAssociatedDeviceCode: this.faultRule.condition.triggerAssociatedDeviceCode || null + } + }; + setFailureModeNew(param, this.$route.query.group).then(res=>{ this.$message.success('创建故障成功!'); this.resetForm(); }).catch((error)=>{ diff --git a/src/views/newMap/displayNew/dispatherContest/index.vue b/src/views/newMap/displayNew/dispatherContest/index.vue index 64e94d8eb..959c1a1d3 100644 --- a/src/views/newMap/displayNew/dispatherContest/index.vue +++ b/src/views/newMap/displayNew/dispatherContest/index.vue @@ -256,6 +256,7 @@ export default { clearTimeout(this.time); } this.$store.dispatch('scriptRecord/updateSimulationPause', false); + this.$store.dispatch('scriptRecord/updateOperationalItemVOs', {}); this.$store.dispatch('map/resetActiveTrainList', true); }, mounted() { @@ -391,6 +392,7 @@ export default { competitionPracticalSceneExit(this.group).then(resp => { getSimulationInfoNew(this.group).then((res)=>{ EventBus.$emit('quitScene'); + this.$store.dispatch('scriptRecord/updateOperationalItemVOs', {}); this.quitQuest(); // this.initLoadPage(); this.clearAllData(); diff --git a/src/views/newMap/displayNew/dispatherContest/operationalStatistic.vue b/src/views/newMap/displayNew/dispatherContest/operationalStatistic.vue index a79759c66..644b966fb 100644 --- a/src/views/newMap/displayNew/dispatherContest/operationalStatistic.vue +++ b/src/views/newMap/displayNew/dispatherContest/operationalStatistic.vue @@ -10,6 +10,7 @@
{{ item.description+':' }} +
@@ -45,6 +47,20 @@ export default { this.dialogShow = true; this.resultData.score = resultData.score; this.resultData.itemVOS = resultData.itemVOS; + const operationalItemVOs = this.$store.state.scriptRecord.operationalItemVOs; + if (JSON.stringify(operationalItemVOs) !== '{}') { + this.resultData.itemVOS = operationalItemVOs; + const itemVOs = Object.values(operationalItemVOs); + itemVOs.forEach((item, index)=>{ + if (item.type == 'Time') { + this.dataList.push(item.timeFilledInByUser.slice(0, item.timeFilledInByUser.length - 3)); + } else if (item.type == 'Non_Time') { + this.dataList.push(item.userAnswer); + } + }); + } else { + this.dataList = []; + } }, roleDoClose() { this.dialogShow = false; @@ -53,7 +69,7 @@ export default { let result = true; if (this.resultData.itemVOS.length > 0) { this.resultData.itemVOS.forEach(item=>{ - if (!item.timeFilledInByUser) { + if (!item.timeFilledInByUser && !item.userAnswer) { result = result && false; } }); @@ -63,6 +79,7 @@ export default { } else { submitOperationalStatistics(this.$route.query.group, this.resultData).then(res=>{ this.$message.success('运营统计数据提交成功'); + this.$store.dispatch('scriptRecord/updateOperationalItemVOs', this.resultData.itemVOS); this.dialogShow = false; }).catch(error=>{ this.$message.error('运营统计数据提交失败:' + error.message); @@ -71,6 +88,9 @@ export default { }, changeData(val, index) { this.resultData.itemVOS[index].timeFilledInByUser = val + ':00'; + }, + changeNoTimeData(val, index) { + this.resultData.itemVOS[index].userAnswer = val; } } }; diff --git a/src/views/newMap/displayNew/dispatherContest/sceneList.vue b/src/views/newMap/displayNew/dispatherContest/sceneList.vue index ef846ea62..cff86a51c 100644 --- a/src/views/newMap/displayNew/dispatherContest/sceneList.vue +++ b/src/views/newMap/displayNew/dispatherContest/sceneList.vue @@ -31,8 +31,8 @@