From 6a79626a3413d21e5b01bbe0921abbd497a987a1 Mon Sep 17 00:00:00 2001 From: fan Date: Tue, 9 Aug 2022 13:59:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=87=E4=BB=A4=E8=BD=AC=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/beijing_01/menus/menuTrain.vue | 90 ++------------- .../theme/chengdu_01/menus/menuTrain.vue | 88 ++------------- .../theme/chengdu_03/menus/menuTrain.vue | 90 ++------------- .../theme/components/utils/menuOperate.js | 67 ++++++++++++ .../theme/datie_01/menus/menuTrain.vue | 34 +----- .../theme/datie_02/menus/menuTrain.vue | 81 +++----------- .../theme/datie_jd1a/menus/menuTrain.vue | 86 +++------------ .../theme/datie_tky/menus/menuTrain.vue | 82 +++----------- .../theme/foshan_01/menus/menuTrain.vue | 90 ++------------- .../theme/fuzhou_01/menus/menuTrain.vue | 96 ++-------------- .../theme/haerbin_01/menus/menuTrain.vue | 88 ++------------- .../theme/nanjing_02/menus/menuTrain.vue | 92 +++------------- .../theme/ningbo_01/menus/menuTrain.vue | 90 ++------------- .../theme/ningbo_03/menus/menuTrain.vue | 90 ++------------- src/jmapNew/theme/race_01/menus/menuTrain.vue | 80 ++------------ src/jmapNew/theme/xian_01/menus/menuTrain.vue | 98 +++-------------- src/jmapNew/theme/xian_02/menus/menuTrain.vue | 103 ++---------------- src/scripts/cmdPlugin/CommandEnum.js | 17 ++- src/scripts/cmdPlugin/OperationHandler.js | 80 ++++++++++++++ .../component/covertOperation.js | 5 + 20 files changed, 355 insertions(+), 1192 deletions(-) diff --git a/src/jmapNew/theme/beijing_01/menus/menuTrain.vue b/src/jmapNew/theme/beijing_01/menus/menuTrain.vue index 61852ce0b..be166545f 100644 --- a/src/jmapNew/theme/beijing_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/beijing_01/menus/menuTrain.vue @@ -38,7 +38,7 @@ import TrainFlag from './dialog/trainFlag'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit'; -import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate'; +import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; // import CMD from '@/scripts/cmdPlugin/CommandEnum'; export default { @@ -381,39 +381,21 @@ export default { this.$store.dispatch('training/setTriggerFaultCount', this.selected); }, nextStation() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Ahead', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveAhead, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverFuideSignal() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Guide_Signal', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheGuideSignal, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverEedLight() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Red_Light', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheRedLight, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -421,13 +403,7 @@ export default { }, // 开关门 handleOpenOrCloseDoor() { - const group = this.$route.query.group; - const param = { - commandType: 'Open_Or_Close_Door', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.openOrCloseDoor, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -438,13 +414,7 @@ export default { }, // 回库 setInbound() { - const group = this.$route.query.group; - const param = { - commandType: 'Inbound', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.inbound, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -460,78 +430,42 @@ export default { }, // 换端 handleTurnDirection() { - const group = this.$route.query.group; - const param = { - commandType: 'Turn_Direction', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Train.turnDirection, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error)=> { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyRmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'RM' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'RM' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/chengdu_01/menus/menuTrain.vue b/src/jmapNew/theme/chengdu_01/menus/menuTrain.vue index c4c77eec2..39bb9e774 100644 --- a/src/jmapNew/theme/chengdu_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/chengdu_01/menus/menuTrain.vue @@ -291,39 +291,21 @@ export default { this.$store.dispatch('training/setTriggerFaultCount', this.selected); }, nextStation() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Ahead', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveAhead, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverFuideSignal() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Guide_Signal', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheGuideSignal, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverEedLight() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Red_Light', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheRedLight, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -331,13 +313,7 @@ export default { }, // 开关门 handleOpenOrCloseDoor() { - const group = this.$route.query.group; - const param = { - commandType: 'Open_Or_Close_Door', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.openOrCloseDoor, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -356,13 +332,7 @@ export default { }, // 回库 setInbound() { - const group = this.$route.query.group; - const param = { - commandType: 'Inbound', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.inbound, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -370,78 +340,42 @@ export default { }, // 换端 handleTurnDirection() { - const group = this.$route.query.group; - const param = { - commandType: 'Turn_Direction', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Train.turnDirection, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error)=> { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyRmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'RM' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitTrainSend(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'RM' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/chengdu_03/menus/menuTrain.vue b/src/jmapNew/theme/chengdu_03/menus/menuTrain.vue index 13e535c27..1bce032f7 100644 --- a/src/jmapNew/theme/chengdu_03/menus/menuTrain.vue +++ b/src/jmapNew/theme/chengdu_03/menus/menuTrain.vue @@ -29,7 +29,7 @@ import CancelMouseState from '@/mixin/CancelMouseState'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; -import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate'; +import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit'; export default { @@ -262,39 +262,21 @@ export default { this.$store.dispatch('training/setTriggerFaultCount', this.selected); }, nextStation() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Ahead', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveAhead, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverFuideSignal() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Guide_Signal', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheGuideSignal, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverEedLight() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Red_Light', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheRedLight, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -302,13 +284,7 @@ export default { }, // 开关门 handleOpenOrCloseDoor() { - const group = this.$route.query.group; - const param = { - commandType: 'Open_Or_Close_Door', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.openOrCloseDoor, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -327,13 +303,7 @@ export default { }, // 回库 setInbound() { - const group = this.$route.query.group; - const param = { - commandType: 'Inbound', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.inbound, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -341,78 +311,42 @@ export default { }, // 换端 handleTurnDirection() { - const group = this.$route.query.group; - const param = { - commandType: 'Turn_Direction', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Train.turnDirection, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error)=> { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyRmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'RM' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'RM' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/components/utils/menuOperate.js b/src/jmapNew/theme/components/utils/menuOperate.js index b8b53b994..79c308b83 100644 --- a/src/jmapNew/theme/components/utils/menuOperate.js +++ b/src/jmapNew/theme/components/utils/menuOperate.js @@ -537,6 +537,73 @@ export const menuOperate = { cmdType: CMD.Driver.CMD_DRIVER_CHANGE_HEAD } }, + Driver: { + // 驾驶至 + driveAhead: { + operation: OperationEvent.Driver.driveAhead.menu.operation, + cmdType: CMD.Driver.CMD_DRIVE_AHEAD + }, + // 进路闭塞法行车 + routeBlockDrive: { + operation: OperationEvent.Driver.routeBlockDrive.menu.operation, + cmdType: CMD.Driver.CMD_ROUTE_BLOCK_DRIVE + }, + // 越红灯行驶 + driveThroughTheRedLight: { + operation: OperationEvent.Driver.driveThroughTheRedLight.menu.operation, + cmdType: CMD.Driver.CMD_DRIVE_THROUGH_THE_RED_LIGHT + }, + // 越引导信号行驶 + driveThroughTheGuideSignal: { + operation: OperationEvent.Driver.driveThroughTheGuideSignal.menu.operation, + cmdType: CMD.Driver.CMD_DRIVE_THROUGH_THE_GUIDE_SIGNAL + }, + // 开关门 + openOrCloseDoor: { + operation: OperationEvent.Driver.openOrCloseDoor.menu.operation, + cmdType: CMD.Driver.CMD_OPEN_OR_CLOSE_DOOR + }, + // 设置限速 + setSpeedLimit: { + operation: OperationEvent.Driver.setSpeedLimit.menu.operation, + cmdType: CMD.Driver.CMD_SET_SPEED_LIMIT + }, + // 换端 + // turnDirection: { + // operation: OperationEvent.Driver.turnDirection.menu.operation, + // cmdType: CMD.Driver.CMD_TURN_DIRECTION + // }, + // 驾驶至 + driveTo: { + operation: OperationEvent.Driver.driveTo.menu.operation, + cmdType: CMD.Driver.CMD_DRIVE_TO + }, + // 回库 + inbound: { + operation: OperationEvent.Driver.inbound.menu.operation, + cmdType: CMD.Driver.CMD_INBOUND + }, + // 修改预选模式 + changePreselectionMode: { + operation: OperationEvent.Driver.changePreselectionMode.menu.operation, + cmdType: CMD.Driver.CMD_CHANGE_PRESELECTION_MODE + }, + // 转NRM模式 + applyNrm: { + operation: OperationEvent.Driver.applyNrm.menu.operation, + cmdType: CMD.Driver.CMD_APPLY_NRM + }, + // 发车 + departTrain: { + operation: OperationEvent.Driver.departTrain.menu.operation, + cmdType: CMD.Driver.CMD_DEPART_TRAIN + }, + // 停车 + parkingTrain: { + operation: OperationEvent.Driver.parkingTrain.menu.operation, + cmdType: CMD.Driver.CMD_PARKING_TRAIN + } + }, CTC: { // 完成接预 receivingNotice: { diff --git a/src/jmapNew/theme/datie_01/menus/menuTrain.vue b/src/jmapNew/theme/datie_01/menus/menuTrain.vue index 4f9b2ae38..f404958a0 100644 --- a/src/jmapNew/theme/datie_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/datie_01/menus/menuTrain.vue @@ -28,7 +28,7 @@ import CancelMouseState from '@/mixin/CancelMouseState'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; -import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate'; +import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; export default { name: 'MenuTrain', @@ -218,52 +218,28 @@ export default { this.$store.dispatch('training/setTriggerFaultCount', this.selected); }, nextStation() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Ahead', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveAhead, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, routeBlockRun() { - const group = this.$route.query.group; - const param = { - commandType: 'Route_Block_Drive', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.routeBlockDrive, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverFuideSignal() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Guide_Signal', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheGuideSignal, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverEedLight() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Red_Light', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheRedLight, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/datie_02/menus/menuTrain.vue b/src/jmapNew/theme/datie_02/menus/menuTrain.vue index 0b16452a6..bddbb9ead 100644 --- a/src/jmapNew/theme/datie_02/menus/menuTrain.vue +++ b/src/jmapNew/theme/datie_02/menus/menuTrain.vue @@ -34,7 +34,7 @@ import CancelMouseState from '@/mixin/CancelMouseState'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; -import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate'; +import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit'; import TrainStop from '@/jmapNew/theme/components/menus/dialog/trainStop'; @@ -211,7 +211,7 @@ export default { }, { label: '换端', - handler: this.handleTurnDirection + handler: this.turnDirection }, { label: '发车', @@ -303,25 +303,22 @@ export default { this.$store.dispatch('training/setTriggerFaultCount', this.selected); }, nextStation() { - this.trainSend('Drive_Ahead'); + this.trainSend(menuOperate.Driver.driveAhead); }, routeBlockRun() { - this.trainSend('Route_Block_Drive'); + this.trainSend(menuOperate.Driver.routeBlockDrive); }, handleOverFuideSignal() { - this.trainSend('Drive_Through_The_Guide_Signal'); + this.trainSend(menuOperate.Driver.driveThroughTheGuideSignal); }, handleOverEedLight() { - this.trainSend('Drive_Through_The_Red_Light'); + this.trainSend(menuOperate.Driver.driveThroughTheRedLight); }, trainSend(type) { - const group = this.$route.query.group; const param = { - commandType: type, - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} + params: { groupNumber: this.selected.code } }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(type, param, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -493,65 +490,35 @@ export default { }); }, handlerApplyAmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyRmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'RM' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'RM' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -576,28 +543,8 @@ export default { this.$refs.noticeInfo.doShow(); }); }, - // 换端 - handleTurnDirection() { - const group = this.$route.query.group; - const param = { - commandType: 'Turn_Direction', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { - }).catch((error)=> { - console.error(error); - this.$refs.noticeInfo.doShow(); - }); - }, handleDepartTrain() { - const group = this.$route.query.group; - const param = { - commandType: 'Depart_Train', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate( menuOperate.Driver.departTrain, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error)=> { console.error(error); this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/datie_jd1a/menus/menuTrain.vue b/src/jmapNew/theme/datie_jd1a/menus/menuTrain.vue index b891136f8..52665c145 100644 --- a/src/jmapNew/theme/datie_jd1a/menus/menuTrain.vue +++ b/src/jmapNew/theme/datie_jd1a/menus/menuTrain.vue @@ -33,7 +33,7 @@ import CancelMouseState from '@/mixin/CancelMouseState'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; -import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate'; +import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; import TrainStop from '@/jmapNew/theme/components/menus/dialog/trainStop'; export default { @@ -204,7 +204,7 @@ export default { // }, { label: '换端', - handler: this.handleTurnDirection + handler: this.turnDirection }, { label: '发车', @@ -246,7 +246,6 @@ export default { initMenu() { // 编辑模式菜单列表 this.menu = MenuContextHandler.covert(this.menuNormal); - console.log(this.menu, '================'); // 故障模式菜单列表 if (this.operatemode === OperateMode.FAULT) { // if (!this.$store.state.scriptRecord.bgSet) { @@ -294,25 +293,19 @@ export default { this.$store.dispatch('training/setTriggerFaultCount', this.selected); }, nextStation() { - this.trainSend('Drive_Ahead'); + this.trainSend(menuOperate.Driver.driveAhead); }, routeBlockRun() { - this.trainSend('Route_Block_Drive'); + this.trainSend(menuOperate.Driver.routeBlockDrive); }, handleOverFuideSignal() { - this.trainSend('Drive_Through_The_Guide_Signal'); + this.trainSend(menuOperate.Driver.driveThroughTheGuideSignal); }, handleOverEedLight() { - this.trainSend('Drive_Through_The_Red_Light'); + this.trainSend(menuOperate.Driver.driveThroughTheRedLight); }, trainSend(type) { - const group = this.$route.query.group; - const param = { - commandType: type, - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(type, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -481,65 +474,35 @@ export default { }); }, handlerApplyAmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyRmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'RM' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'RM' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -564,28 +527,8 @@ export default { this.$refs.noticeInfo.doShow(); }); }, - // 换端 - handleTurnDirection() { - const group = this.$route.query.group; - const param = { - commandType: 'Turn_Direction', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { - }).catch((error)=> { - console.error(error); - this.$refs.noticeInfo.doShow(); - }); - }, handleDepartTrain() { - const group = this.$route.query.group; - const param = { - commandType: 'Depart_Train', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.departTrain, { groupNumber: this.selected.groupNumber }, 0).then(({valid, operate}) => { }).catch((error)=> { console.error(error); this.$refs.noticeInfo.doShow(); @@ -607,8 +550,7 @@ export default { }, removeTripNumber() { commitOperate(menuOperate.Train.removeTrip, {groupNumber:this.selected.groupNumber}, 3).then(({valid, operate})=>{ - if (valid) { - } + // if (valid) {} }).catch((error)=> { console.error(error); this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/datie_tky/menus/menuTrain.vue b/src/jmapNew/theme/datie_tky/menus/menuTrain.vue index 0b16452a6..298049067 100644 --- a/src/jmapNew/theme/datie_tky/menus/menuTrain.vue +++ b/src/jmapNew/theme/datie_tky/menus/menuTrain.vue @@ -34,7 +34,7 @@ import CancelMouseState from '@/mixin/CancelMouseState'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; -import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate'; +import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit'; import TrainStop from '@/jmapNew/theme/components/menus/dialog/trainStop'; @@ -211,7 +211,7 @@ export default { }, { label: '换端', - handler: this.handleTurnDirection + handler: this.turnDirection }, { label: '发车', @@ -303,25 +303,19 @@ export default { this.$store.dispatch('training/setTriggerFaultCount', this.selected); }, nextStation() { - this.trainSend('Drive_Ahead'); + this.trainSend(menuOperate.Driver.driveAhead); }, routeBlockRun() { - this.trainSend('Route_Block_Drive'); + this.trainSend(menuOperate.Driver.routeBlockDrive); }, handleOverFuideSignal() { - this.trainSend('Drive_Through_The_Guide_Signal'); + this.trainSend(menuOperate.Driver.driveThroughTheGuideSignal); }, handleOverEedLight() { - this.trainSend('Drive_Through_The_Red_Light'); + this.trainSend(menuOperate.Driver.driveThroughTheRedLight); }, trainSend(type) { - const group = this.$route.query.group; - const param = { - commandType: type, - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(type, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -493,65 +487,35 @@ export default { }); }, handlerApplyAmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyRmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'RM' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'RM' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -576,28 +540,8 @@ export default { this.$refs.noticeInfo.doShow(); }); }, - // 换端 - handleTurnDirection() { - const group = this.$route.query.group; - const param = { - commandType: 'Turn_Direction', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { - }).catch((error)=> { - console.error(error); - this.$refs.noticeInfo.doShow(); - }); - }, handleDepartTrain() { - const group = this.$route.query.group; - const param = { - commandType: 'Depart_Train', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.departTrain, { groupNumber: this.selected.groupNumber }, 0).then(({valid, operate}) => { }).catch((error)=> { console.error(error); this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/foshan_01/menus/menuTrain.vue b/src/jmapNew/theme/foshan_01/menus/menuTrain.vue index fc232cea6..c1cefba1f 100644 --- a/src/jmapNew/theme/foshan_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/foshan_01/menus/menuTrain.vue @@ -37,7 +37,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; -import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate'; +import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; export default { name: 'MenuTrain', @@ -278,50 +278,26 @@ export default { this.$store.dispatch('training/setTriggerFaultCount', this.selected); }, nextStation() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Ahead', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveAhead, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch(() => { this.$refs.noticeInfo.doShow(); }); }, handleOverFuideSignal() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Guide_Signal', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheGuideSignal, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch(() => { this.$refs.noticeInfo.doShow(); }); }, handleOverEedLight() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Red_Light', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheRedLight, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch(() => { this.$refs.noticeInfo.doShow(); }); }, // 开关门 handleOpenOrCloseDoor() { - const group = this.$route.query.group; - const param = { - commandType: 'Open_Or_Close_Door', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.openOrCloseDoor, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -340,13 +316,7 @@ export default { }, // 回库 setInbound() { - const group = this.$route.query.group; - const param = { - commandType: 'Inbound', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.inbound, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -354,78 +324,42 @@ export default { }, // 换端 handleTurnDirection() { - const group = this.$route.query.group; - const param = { - commandType: 'Turn_Direction', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Train.turnDirection, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error)=> { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyRmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'RM' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'RM' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuTrain.vue b/src/jmapNew/theme/fuzhou_01/menus/menuTrain.vue index ef46aeb00..23fc753b4 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuTrain.vue @@ -270,39 +270,21 @@ export default { this.$store.dispatch('training/setTriggerFaultCount', this.selected); }, nextStation() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Ahead', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveAhead, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverFuideSignal() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Guide_Signal', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheGuideSignal, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverEedLight() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Red_Light', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheRedLight, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -310,13 +292,7 @@ export default { }, // 开关门 handleOpenOrCloseDoor() { - const group = this.$route.query.group; - const param = { - commandType: 'Open_Or_Close_Door', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitTrainSend(menuOperate.Driver.openOrCloseDoor, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -335,13 +311,7 @@ export default { }, // 回库 setInbound() { - const group = this.$route.query.group; - const param = { - commandType: 'Inbound', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.inbound, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -349,91 +319,49 @@ export default { }, // 换端 handleTurnDirection() { - const group = this.$route.query.group; - const param = { - commandType: 'Turn_Direction', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Train.turnDirection, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error)=> { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyRmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'RM' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'RM' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyNrmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Apply_NRM', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.applyNrm, { groupNumber: this.selected.code }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/haerbin_01/menus/menuTrain.vue b/src/jmapNew/theme/haerbin_01/menus/menuTrain.vue index c09e266bc..a3aa31096 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuTrain.vue @@ -240,39 +240,21 @@ export default { }); }, nextStation() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Ahead', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveAhead, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverFuideSignal() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Guide_Signal', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheGuideSignal, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverEedLight() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Red_Light', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheRedLight, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -280,13 +262,7 @@ export default { }, // 开关门 handleOpenOrCloseDoor() { - const group = this.$route.query.group; - const param = { - commandType: 'Open_Or_Close_Door', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.openOrCloseDoor, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -305,13 +281,7 @@ export default { }, // 回库 setInbound() { - const group = this.$route.query.group; - const param = { - commandType: 'Inbound', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.inbound, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -319,78 +289,42 @@ export default { }, // 换端 handleTurnDirection() { - const group = this.$route.query.group; - const param = { - commandType: 'Turn_Direction', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Train.turnDirection, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error)=> { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyRmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'RM' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitTrainSend(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'RM' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/nanjing_02/menus/menuTrain.vue b/src/jmapNew/theme/nanjing_02/menus/menuTrain.vue index 79b9e8e0b..63258dcf9 100644 --- a/src/jmapNew/theme/nanjing_02/menus/menuTrain.vue +++ b/src/jmapNew/theme/nanjing_02/menus/menuTrain.vue @@ -27,7 +27,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum'; // import TrainEditNumber from './dialog/trainEditNumber'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit'; -import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate'; +import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; export default { name: 'MenuTrain', @@ -240,38 +240,20 @@ export default { }); }, nextStation() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Ahead', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ - }).catch((error) => { + commitOperate(menuOperate.Driver.driveAhead, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ + }).catch(() => { this.$refs.noticeInfo.doShow(); }); }, handleOverFuideSignal() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Guide_Signal', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheGuideSignal, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverEedLight() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Red_Light', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheRedLight, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -279,13 +261,7 @@ export default { }, // 开关门 handleOpenOrCloseDoor() { - const group = this.$route.query.group; - const param = { - commandType: 'Open_Or_Close_Door', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.openOrCloseDoor, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -304,13 +280,7 @@ export default { }, // 回库 setInbound() { - const group = this.$route.query.group; - const param = { - commandType: 'Inbound', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.inbound, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -318,78 +288,42 @@ export default { }, // 换端 handleTurnDirection() { - const group = this.$route.query.group; - const param = { - commandType: 'Turn_Direction', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Train.turnDirection, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error)=> { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyRmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'RM' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/ningbo_01/menus/menuTrain.vue b/src/jmapNew/theme/ningbo_01/menus/menuTrain.vue index 237f4f6de..78d9a275f 100644 --- a/src/jmapNew/theme/ningbo_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/ningbo_01/menus/menuTrain.vue @@ -32,7 +32,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; -import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate'; +import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; export default { name: 'MenuTrain', @@ -351,39 +351,21 @@ export default { this.$store.dispatch('training/setTriggerFaultCount', this.selected); }, nextStation() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Ahead', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveAhead, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverFuideSignal() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Guide_Signal', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheGuideSignal, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverEedLight() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Red_Light', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheRedLight, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -394,13 +376,7 @@ export default { }, // 开关门 handleOpenOrCloseDoor() { - const group = this.$route.query.group; - const param = { - commandType: 'Open_Or_Close_Door', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.openOrCloseDoor, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -416,13 +392,7 @@ export default { }, // 回库 setInbound() { - const group = this.$route.query.group; - const param = { - commandType: 'Inbound', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.inbound, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -430,78 +400,42 @@ export default { }, // 换端 handleTurnDirection() { - const group = this.$route.query.group; - const param = { - commandType: 'Turn_Direction', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Train.turnDirection, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error)=> { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyRmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'RM' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'RM' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/ningbo_03/menus/menuTrain.vue b/src/jmapNew/theme/ningbo_03/menus/menuTrain.vue index 32f5cc2a6..aaa01a726 100644 --- a/src/jmapNew/theme/ningbo_03/menus/menuTrain.vue +++ b/src/jmapNew/theme/ningbo_03/menus/menuTrain.vue @@ -33,7 +33,7 @@ import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; // import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus'; -import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate'; +import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; export default { name: 'MenuTrain', @@ -351,39 +351,21 @@ export default { this.$store.dispatch('training/setTriggerFaultCount', this.selected); }, nextStation() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Ahead', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveAhead, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverFuideSignal() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Guide_Signal', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheGuideSignal, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverEedLight() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Red_Light', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheRedLight, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -391,13 +373,7 @@ export default { }, // 开关门 handleOpenOrCloseDoor() { - const group = this.$route.query.group; - const param = { - commandType: 'Open_Or_Close_Door', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.openOrCloseDoor, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -416,13 +392,7 @@ export default { }, // 回库 setInbound() { - const group = this.$route.query.group; - const param = { - commandType: 'Inbound', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.inbound, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -430,78 +400,42 @@ export default { }, // 换端 handleTurnDirection() { - const group = this.$route.query.group; - const param = { - commandType: 'Turn_Direction', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Train.turnDirection, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error)=> { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyRmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'RM' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'RM' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/race_01/menus/menuTrain.vue b/src/jmapNew/theme/race_01/menus/menuTrain.vue index bdd0956ac..0375deb78 100644 --- a/src/jmapNew/theme/race_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/race_01/menus/menuTrain.vue @@ -399,39 +399,21 @@ export default { }); }, nextStation() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Ahead', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveAhead, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverFuideSignal() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Guide_Signal', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheGuideSignal, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverEedLight() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Red_Light', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheRedLight, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -441,65 +423,35 @@ export default { this.$refs.speedLimit.doShow(this.selected); }, handlerApplyAmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyRmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'RM' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'RM' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -507,13 +459,7 @@ export default { }, // 操作列车 开/关门 handleOpenCloseDoor() { - const group = this.$route.query.group; - const param = { - commandType: 'Open_Or_Close_Door', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.openOrCloseDoor, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -529,13 +475,7 @@ export default { }, // 换端 handleTurnDirection() { - const group = this.$route.query.group; - const param = { - commandType: 'Turn_Direction', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Train.turnDirection, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error)=> { console.error(error); this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/xian_01/menus/menuTrain.vue b/src/jmapNew/theme/xian_01/menus/menuTrain.vue index 71a6e33ef..b22eaacf8 100644 --- a/src/jmapNew/theme/xian_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/xian_01/menus/menuTrain.vue @@ -33,7 +33,7 @@ import TrainDetail from './dialog/trainDetail'; import SetTrainOperation from '@/jmapNew/theme/components/menus/dialog/setTrainOperation'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit'; -import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate'; +import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; export default { name: 'MenuTrain', @@ -302,13 +302,7 @@ export default { }); }, handlerApplyNrmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Apply_NRM', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.applyNrm, { groupNumber: this.selected.code }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -395,13 +389,7 @@ export default { // }); // }, nextStation() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Ahead', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveAhead, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -422,26 +410,14 @@ export default { // }); // }, handleOverFuideSignal() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Guide_Signal', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheGuideSignal, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverEedLight() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Red_Light', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheRedLight, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -449,13 +425,7 @@ export default { }, // 开关门 handleOpenOrCloseDoor() { - const group = this.$route.query.group; - const param = { - commandType: 'Open_Or_Close_Door', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.openOrCloseDoor, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -482,13 +452,7 @@ export default { }, // 回库 setInbound() { - const group = this.$route.query.group; - const param = { - commandType: 'Inbound', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.inbound, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -496,78 +460,42 @@ export default { }, // 换端 handleTurnDirection() { - const group = this.$route.query.group; - const param = { - commandType: 'Turn_Direction', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Train.turnDirection, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error)=> { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyRmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'RM' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'RM' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); diff --git a/src/jmapNew/theme/xian_02/menus/menuTrain.vue b/src/jmapNew/theme/xian_02/menus/menuTrain.vue index c83de0af9..d3cb3d50f 100644 --- a/src/jmapNew/theme/xian_02/menus/menuTrain.vue +++ b/src/jmapNew/theme/xian_02/menus/menuTrain.vue @@ -35,7 +35,7 @@ import { mapGetters } from 'vuex'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import CMD from '@/scripts/cmdPlugin/CommandEnum'; -import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate'; +import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate'; export default { name: 'MenuTrain', @@ -381,39 +381,21 @@ export default { }); }, nextStation() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Ahead', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveAhead, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverFuideSignal() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Guide_Signal', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheGuideSignal, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handleOverEedLight() { - const group = this.$route.query.group; - const param = { - commandType: 'Drive_Through_The_Red_Light', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate})=>{ + commitOperate(menuOperate.Driver.driveThroughTheRedLight, { groupNumber: this.selected.code }, 0).then(({valid, operate})=>{ }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -421,13 +403,7 @@ export default { }, // 开关门 handleOpenOrCloseDoor() { - const group = this.$route.query.group; - const param = { - commandType: 'Open_Or_Close_Door', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.openOrCloseDoor, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -446,78 +422,42 @@ export default { }, // 换端 handleTurnDirection() { - const group = this.$route.query.group; - const param = { - commandType: 'Turn_Direction', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Train.turnDirection, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error)=> { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmcMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_C' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_C' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyAmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'AM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'AM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplySmiMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'SM_I' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'SM_I' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); }); }, handlerApplyRmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Change_Preselection_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: { preselectionMode: 'RM' } - }; - commitTrainSend(group, param).then(({ valid, operate }) => { + commitOperate(menuOperate.Driver.changePreselectionMode, { groupNumber: this.selected.code, preselectionMode: 'RM' }, 0).then(({ valid, operate }) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); @@ -525,26 +465,7 @@ export default { }, // 回库 setInbound() { - const group = this.$route.query.group; - const param = { - commandType: 'Inbound', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { - }).catch((error) => { - console.error(error); - this.$refs.noticeInfo.doShow(); - }); - }, - handleApplyAmMode() { - const group = this.$route.query.group; - const param = { - commandType: 'Apply_AM_Mode', - targetMemberId: this.memberList.find(ele => ele.deviceCode == this.selected.code).id, - params: {} - }; - commitTrainSend(group, param).then(({valid, operate}) => { + commitOperate(menuOperate.Driver.inbound, { groupNumber: this.selected.code }, 0).then(({valid, operate}) => { }).catch((error) => { console.error(error); this.$refs.noticeInfo.doShow(); diff --git a/src/scripts/cmdPlugin/CommandEnum.js b/src/scripts/cmdPlugin/CommandEnum.js index 703f71bc9..10fdaa745 100644 --- a/src/scripts/cmdPlugin/CommandEnum.js +++ b/src/scripts/cmdPlugin/CommandEnum.js @@ -92,7 +92,20 @@ export default { CMD_DRIVER_DOOR_MODE:{value:'Driver_Door_Mode', label:'列车门模式'}, CMD_DRIVER_DOOR_SELECTION:{value:'Driver_Door_Selection', label:'列车门选择'}, CMD_DRIVER_CONFIRM:{value:'Driver_Confirm', label:'确认'}, - CMD_DRIVER_STOP:{value: 'Driver_Stop', label: '停车'} + CMD_DRIVER_STOP:{value: 'Driver_Stop', label: '停车'}, + CMD_DRIVE_AHEAD:{value: 'Drive_Ahead', label: '确认运行至前方站'}, + CMD_ROUTE_BLOCK_DRIVE: {value: 'Route_Block_Drive', label: '进路闭塞法行车'}, + CMD_DRIVE_THROUGH_THE_RED_LIGHT : {value: 'Drive_Through_The_Red_Light', label: '越红灯行驶'}, + CMD_DRIVE_THROUGH_THE_GUIDE_SIGNAL : {value: 'Drive_Through_The_Guide_Signal', label: '越引导信号行驶'}, + CMD_OPEN_OR_CLOSE_DOOR : {value: 'Open_Or_Close_Door', label: '开关门'}, + CMD_SET_SPEED_LIMIT : {value: 'Set_Speed_Limit', label: '设置限速'}, + // CMD_TURN_DIRECTION: {value: 'Turn_Direction', label: '换端'}, + CMD_DRIVE_TO : {value: 'Drive_To', label: '驾驶至'}, + CMD_INBOUND: {value: 'Inbound', label: '回库'}, + CMD_CHANGE_PRESELECTION_MODE: {value: 'Change_Preselection_Mode', label: '修改预选模式'}, + CMD_APPLY_NRM: {value: 'Apply_NRM', label: '转NRM模式'}, + CMD_DEPART_TRAIN: {value: 'Depart_Train', label: '发车'}, + CMD_PARKING_TRAIN : {value: 'Parking_Train', label: '停车'} }, // 信号机操作 @@ -339,7 +352,7 @@ export default { /** 列车取消指定站台的跳停 */ CMD_TRAIN_CANCEL_SKIP_STOP : { value: 'Train_Cancel_Skip_Stop', label: '取消指定站台跳停' }, /** 换端 */ - CMD_TRAIN_TURN_DIRECTION: { value: 'Turn_Direction', label: '换端' }, + // CMD_TRAIN_TURN_DIRECTION: { value: 'Turn_Direction', label: '换端' }, /** 选择调度模式 */ CMD_TRAIN_REGULATION : { value:'Train_Regulation', label:'选择调度模式' }, /** 计算列车间隔 */ diff --git a/src/scripts/cmdPlugin/OperationHandler.js b/src/scripts/cmdPlugin/OperationHandler.js index ac0303f1e..c33196803 100644 --- a/src/scripts/cmdPlugin/OperationHandler.js +++ b/src/scripts/cmdPlugin/OperationHandler.js @@ -3994,6 +3994,86 @@ export const OperationEvent = { domId: '_Tips-Rail-railGiveTicketTo' } } + }, + Driver: { + driveAhead: { + menu: { + operation: '1301', + domId: '_Tips-Driver-driveAhead' + } + }, + routeBlockDrive: { + menu: { + operation: '1302', + domId: '_Tips-Driver-routeBlockDrive' + } + }, + driveThroughTheRedLight: { + menu: { + operation: '1303', + domId: '_Tips-Driver-driveThroughTheRedLight' + } + }, + driveThroughTheGuideSignal: { + menu: { + operation: '1304', + domId: '_Tips-Driver-driveThroughTheGuideSignal' + } + }, + openOrCloseDoor: { + menu: { + operation: '1305', + domId: '_Tips-Driver-openOrCloseDoor' + } + }, + setSpeedLimit: { + menu: { + operation: '1306', + domId: '_Tips-Driver-setSpeedLimit' + } + }, + // turnDirection: { + // menu: { + // operation: '1307', + // domId: '_Tips-Driver-turnDirection' + // } + // }, + driveTo: { + menu: { + operation: '1308', + domId: '_Tips-Driver-driveTo' + } + }, + inbound: { + menu: { + operation: '1309', + domId: '_Tips-Driver-inbound' + } + }, + changePreselectionMode: { + menu: { + operation: '130a', + domId: '_Tips-Driver-changePreselectionMode' + } + }, + applyNrm: { + menu: { + operation: '130b', + domId: '_Tips-Driver-applyNrm' + } + }, + departTrain: { + menu: { + operation: '130c', + domId: '_Tips-Driver-departTrain' + } + }, + parkingTrain: { + menu: { + operation: '130d', + domId: '_Tips-Driver-parkingTrain' + } + } } }; diff --git a/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js b/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js index 3b86ad6b6..55b190e29 100644 --- a/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js +++ b/src/views/newMap/displayNew/scriptDisplay/component/covertOperation.js @@ -224,7 +224,12 @@ export const operateEnum = { Driver_Door_Selection:{ code:'doorSelection', name:'方向为' + }, + Change_Preselection_Mode: { + code: 'preselectionMode', + name: '预选模式为:' } + }, TrainWindow:{ code:'groupNumber',