佛山有轨电车 现地操作调整

This commit is contained in:
joylink_cuiweidong 2020-03-25 13:20:31 +08:00
parent cffbc1b985
commit d3b4c090a9
4 changed files with 379 additions and 119 deletions

View File

@ -95,9 +95,9 @@
</span>
</button>
<button
id="mbm_12"
:id="Switch.turnoutForce.button.domId"
:style="{display: 'block', float: 'left', width: width+'px', backgroundColor:buttonUpColor}"
@click="buttonDown('mbm_12')"
@click="buttonDown(Switch.turnoutForce.button.operation)"
>
<span style="color: red">
<center>
@ -106,7 +106,7 @@
</center>
<center>
<b></b>
<b></b>
<b></b>
</center>
</span>
</button>

View File

@ -15,7 +15,7 @@ import SwitchUnLock from './dialog/switchUnLock';
import SpeedLimitControl from './dialog/speedLimitControl';
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
import { mapGetters } from 'vuex';
import {menuOperate, commitOperate} from './utils/menuOperate';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
@ -43,37 +43,6 @@ export default {
menu: [],
menuNormal: {
Local: [
// {
// label: '',
// handler: this.locate,
// cmdType: CMD.Switch.CMD_SWITCH_TURN_NP_CHAIN
// },
// {
// label: '',
// handler: this.reverse,
// cmdType: CMD.Switch.CMD_SWITCH_TURN_RP_CHAIN
// },
// {
// label: '',
// handler: this.lock,
// cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
// },
// {
// label: '',
// handler: this.unlock,
// cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
// },
// {
// label: '',
// handler: this.block,
// cmdType: CMD.Switch.CMD_SWITCH_BLOCK
// },
// {
// label: '',
// handler: this.unblock,
// cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK
// }
//
],
Center: [
// {
@ -113,6 +82,11 @@ export default {
} else {
this.doClose();
}
},
'$store.state.menuOperation.selectedCount': function(val) {
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Switch') {
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
}
}
},
methods: {
@ -186,106 +160,110 @@ export default {
this.$refs.noticeInfo.doShow(operate);
});
},
operationHandler(buttonOperation, selectType) {
switch (buttonOperation) {
case OperationEvent.Switch.locate.button.operation: {
//
if (!selectType.normalPosition && selectType.reversePosition) {
this.locate(selectType);
}
break;
}
case OperationEvent.Switch.reverse.button.operation: {
//
if (selectType.normalPosition && !selectType.reversePosition) {
this.reverse(selectType);
}
break;
}
case OperationEvent.Switch.lock.button.operation: {
//
if (!selectType.singleLock) {
this.lock(selectType);
}
break;
}
case OperationEvent.Switch.unlock.button.operation: {
//
if (selectType.singleLock) {
this.unlock(selectType);
}
break;
}
case OperationEvent.Switch.block.button.operation: {
//
if (!selectType.blockade) {
this.block(selectType);
}
break;
}
case OperationEvent.Switch.unblock.button.operation: {
//
if (selectType.blockade) {
this.unblock(selectType);
}
break;
}
case OperationEvent.Switch.turnoutForce.button.operation: {
//
this.switchTurnoutForce(selectType);
break;
}
}
},
//
locate() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Switch.locate.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
}
locate(selectType) {
commitOperate(menuOperate.Switch.locate, {switchCode:selectType.code}, 3).then((data)=>{
// this.$refs.switchControl.doShow(data.operate, this.selected);
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//
reverse() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Switch.reverse.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
}
reverse(selectType) {
commitOperate(menuOperate.Switch.reverse, {switchCode:selectType.code}, 3).then((data)=>{
// this.$refs.switchControl.doShow(data.operate, this.selected);
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//
lock() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Switch.lock.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
}
lock(selectType) {
commitOperate(menuOperate.Switch.lock, {switchCode:selectType.code}, 3).then((data)=>{
// this.$refs.switchControl.doShow(data.operate, this.selected);
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//
unlock() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Switch.unlock.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchUnLock.doShow(operate, this.selected);
}
unlock(selectType) {
commitOperate(menuOperate.Switch.unlock, {switchCode:selectType.code}, 3).then((data)=>{
// this.$refs.switchUnLock.doShow(data.operate, this.selected);
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//
block() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Switch.block.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchControl.doShow(operate, this.selected);
}
block(selectType) {
commitOperate(menuOperate.Switch.block, {switchCode:selectType.code}, 3).then((data)=>{
// this.$refs.switchControl.doShow(data.operate, this.selected);
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//
unblock() {
const operate = {
start: true,
code: this.selected.code,
operation: OperationEvent.Switch.unblock.menu.operation,
param: {
switchCode: this.selected.code
}
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.switchUnLock.doShow(operate, this.selected);
}
unblock(selectType) {
commitOperate(menuOperate.Switch.unblock, {switchCode:selectType.code}, 3).then((data)=>{
// this.$refs.switchUnLock.doShow(data.operate, this.selected);
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//
switchTurnoutForce(selectType) {
commitOperate(menuOperate.Switch.turnoutForce, {switchCode:selectType.code}, 3).then((data)=>{
}).catch(error=>{
this.$refs.noticeInfo.doShow({}, error.message);
});
},
//

View File

@ -0,0 +1,278 @@
import store from '@/store';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
// 操作
export const menuOperate = {
Section:{
// alxeFailure:{
// // 设置计轴失效
// operation: OperationEvent.Section.alxeFailure.menu.operation,
// // cmdType 值有问题
// cmdType: CMD.Section.CMD_SECTION_ADD_FAULT
// },
// active:{
// // 区段激活
// operation: OperationEvent.Section.active.menu.operation,
// cmdType: CMD.Section.CMD_SECTION_ACTIVE
// },
// alxeEffective:{
// // 确认计轴有效
// operation: OperationEvent.Section.alxeEffective.menu.operation,
// cmdType: CMD.Section.CMD_SECTION_COMFIRMATION_AXLE
// },
// split:{
// // 区段切除
// operation: OperationEvent.Section.split.menu.operation,
// cmdType: CMD.Section.CMD_SECTION_CUT_OFF
// },
// lock:{
// // 区段封锁
// operation: OperationEvent.Section.lock.menu.operation,
// cmdType: CMD.Section.CMD_SECTION_BLOCK
// },
// unlock:{
// // 区段解锁
// operation: OperationEvent.Section.unlock.menu.operation,
// cmdType: CMD.Section.CMD_SECTION_UNBLOCK
// },
// setSpeed:{
// // 设置速度
// operation: OperationEvent.Section.setSpeed.menu.operation,
// cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
// },
// fault:{
// // 区段故障解锁
// operation: OperationEvent.Section.fault.menu.operation,
// cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
// }
},
Signal:{
// arrangementRoute:{
// // 排列进路
// operation: OperationEvent.Signal.arrangementRoute.menu.operation,
// cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
// },
// cancelTrainRoute:{
// // 取消进路
// operation: OperationEvent.Signal.cancelTrainRoute.menu.operation,
// cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
// },
// lock:{
// // 信号封锁
// operation:OperationEvent.Signal.lock.menu.operation,
// cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
// },
// unlock:{
// // 信号解封
// operation: OperationEvent.Signal.unlock.menu.operation,
// cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
// },
// guide:{
// // 进路引导
// operation: OperationEvent.Signal.guide.menu.operation,
// cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
// },
// reopenSignal:{
// // 信号重开
// operation: OperationEvent.Signal.reopenSignal.menu.operation,
// cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
// },
// signalClose:{
// // 信号关灯
// operation: OperationEvent.Signal.signalClose.menu.operation,
// cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
// },
// humanControl:{
// // 进路交人工控
// operation: OperationEvent.Signal.humanControl.menu.operation,
// cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
// },
// atsAutoControl:{
// // 进路交自动控
// operation: OperationEvent.Signal.atsAutoControl.menu.operation,
// cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
// },
// setAutoInterlock:{
// // 设置通过模式
// operation: OperationEvent.Signal.setAutoInterlock.menu.operation,
// cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
// },
// cancelAutoInterlock:{
// // 取消通过模式
// operation: OperationEvent.Signal.cancelAutoInterlock.menu.operation,
// cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
// },
// detail:{
// // 查询进路状态
// operation: OperationEvent.Signal.detail.menu.operation
// },
// cancelGuide:{
// // 人工解锁进路(信号机取消引导)
// operation: OperationEvent.Signal.cancelGuide.menu.operation,
// cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE
// },
// setAutoTurnBack:{
// // 设置自动折返
// operation: OperationEvent.AutoTurnBack.SetAutoTurnBackButton.menu.operation,
// cmdType: CMD.Signal.CMD_SIGNAL_SET_AUTO_TURN_BACK
// },
// cancelAutoTurnBack:{
// // 取消自动折返
// operation: OperationEvent.AutoTurnBack.CancelAutoTurnBackButton.menu.operation,
// cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_AUTO_TURN_BACK
// }
},
Switch:{
lock:{
// 道岔单锁
operation: OperationEvent.Switch.lock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_LOCK
},
unlock:{
// 道岔解锁
operation: OperationEvent.Switch.unlock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_SINGLE_UNLOCK
},
block:{
// 道岔封锁
operation: OperationEvent.Switch.block.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_BLOCK
},
unblock:{
// 道岔解封
operation: OperationEvent.Switch.unblock.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_UNBLOCK
},
locate:{
// 单操到定位
operation: OperationEvent.Switch.locate.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_NORMAL_POSITION
},
reverse:{
// 单操到反位
operation: OperationEvent.Switch.reverse.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_REVERSE_POSITION
},
setSpeed:{
// 设置临时限速
operation: OperationEvent.Switch.setSpeed.menu.operation,
cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
},
turnoutForce: {
// 道岔强制扳动
operation: OperationEvent.Switch.turnoutForce.menu.operation,
cmdType:CMD.Switch.CMD_SWITCH_FORCE_TURN
}
},
StationStand:{
// setDetainTrain:{
// // 设置扣车
// operation: OperationEvent.StationStand.setDetainTrain.menu.operation,
// cmdType: CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
// },
// cancelDetainTrain:{
// // 取消扣车
// operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation,
// cmdType: CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
// },
// setDetainTrainAuto:{
// // 区间列车数量限制
// operation: OperationEvent.StationStand.setDetainTrainAuto.menu.operation,
// cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_AUTO
// },
// cancelDetainTrainAuto:{
// // 取消区间列车数量限制
// operation: OperationEvent.StationStand.cancelDetainTrainAuto.menu.operation,
// cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_AUTO
// },
// setBulkBuckleTrain:{
// // 批量扣车
// operation: OperationEvent.StationStand.setBulkBuckleTrain.menu.operation,
// cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN_ALL
// },
// cancelBulkBuckleTrain:{
// // 批量取消扣车
// operation: OperationEvent.StationStand.cancelBulkBuckleTrain.menu.operation,
// cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN_ALL
// },
// setJumpStop:{
// // 设置跳停
// operation: OperationEvent.StationStand.setJumpStop.menu.operation,
// cmdType: CMD.Stand.CMD_STAND_SET_JUMP_STOP
// },
// cancelJumpStop:{
// // 取消跳停
// operation: OperationEvent.StationStand.cancelJumpStop.menu.operation,
// cmdType: CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
// },
// setStopTime:{
// // 停站时间控制
// operation: OperationEvent.StationStand.setStopTime.menu.operation,
// cmdType: CMD.Stand.CMD_STAND_SET_PARK_TIME
// },
// setRunLevel:{
// // 运行时间控制
// operation: OperationEvent.StationStand.setRunLevel.menu.operation,
// cmdType: CMD.Stand.CMD_STAND_SET_RUN_TIME
// },
// earlyDeparture:{
// // 设置提前发车
// operation: OperationEvent.StationStand.earlyDeparture.menu.operation,
// cmdType: CMD.Stand.CMD_STAND_EARLY_DEPART
// },
// setBackStrategy:{
// // 设置折返策略
// operation: OperationEvent.StationStand.setBackStrategy.menu.operation,
// cmdType: CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY
// },
// detail:{
// // 查询站台状态
// operation: OperationEvent.StationStand.detail.menu.operation
// }
},
StationControl:{
// requestCentralControl:{
// // 请求中控(遥控)
// operation: OperationEvent.StationControl.requestCentralControl.menu.operation,
// cmdType: CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_CENTER_CONTROL
// },
// requestStationControl:{
// // 请求站控
// operation: OperationEvent.StationControl.requestStationControl.menu.operation,
// cmdType:CMD.ControlConvertMenu.CMD_CM_APPLY_FOR_STATION_CONTROL
// },
// emergencyStationControl:{
// // 紧急站控
// operation: OperationEvent.StationControl.emergencyStationControl.menu.operation,
// cmdType:CMD.ControlConvertMenu.CMD_CM_EMERGENCY_STATION_CONTROL
// }
}
};
export function commitOperate(operate, paramList, over) {
const step = {
start: true,
operation: operate.operation,
param:{}
};
step.param = paramList;
// over 0为首次操作1为中间操作2为最后操作3为直接一次性操作
if (over != 0 && over != 3) {
delete step.start;
}
if (over == 2 || over == 3) {
step.over = true;
step.cmdType = operate.cmdType;
}
return new Promise(function(resolve, reject) {
store.dispatch('training/nextNew', step).then(({ valid }) => {
if (valid) {
store.dispatch('menuOperation/handleBreakFlag', { break: true });
resolve({operate:step});
}
}).catch(error=>{
reject(error);
});
});
}

View File

@ -351,6 +351,10 @@ export const OperationEvent = {
},
// 强制扳动
turnoutForce: {
button: {
operation: '1080',
domId: '_Tips-Switch-TurnoutForce-Mbm{TOP}'
},
menu: {
operation: '108',
domId: '_Tips-Switch-TurnoutForce-Menu'