右键菜单代码整理

This commit is contained in:
joylink_cuiweidong 2020-06-19 14:20:57 +08:00
parent bcc5fdf92c
commit b4394a7092
16 changed files with 12 additions and 1820 deletions

View File

@ -83,7 +83,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'RouteHandControl',

View File

@ -51,7 +51,7 @@ import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { deepAssign } from '@/utils/index';
import { mapGetters } from 'vuex';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'RouteSelection',

View File

@ -30,7 +30,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
// import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { menuOperate, commitOperate } from '../utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'StandDetainTrain',

View File

@ -86,7 +86,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import ConfirmTrain from './childDialog/confirmTrain';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import Handler from '@/scripts/cmdPlugin/Handler';
import { menuOperate, commitOperate } from '../utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import {getTrainDetailBytripNumber} from '@/api/simulation';
export default {

View File

@ -24,7 +24,7 @@ import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from './utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'SectionMenu',

View File

@ -24,7 +24,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import {menuOperate, commitOperate} from './utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'SignalMenu',

View File

@ -26,7 +26,7 @@ import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from './utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'StationStandMenu',

View File

@ -19,7 +19,7 @@ import { mapGetters } from 'vuex';
// import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from './utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'SwitchMenu',

View File

@ -1,570 +0,0 @@
import store from '@/store/index_APP_TARGET';
import deviceState from '@/jmap/constant/deviceState';
import { OperateMode } from '@/scripts/ConstDic';
export function getCurrentStateObject() {
return store.getters['menuOperation/selected'];
}
/** 系统类型 */
export const State2SimulationMap = {
'01': 'local', // 现地工作站
'02': 'central' // 中心调度工作站
};
export const State2ControlMap = {
'01': 'center', // 中控
'02': 'station', // 站控
'03': 'station'
};
// 控制禁用
export const MenuDisabledState = {
Section: {
// 故障解锁
fault() {
},
// 切除
split() {
const device = getCurrentStateObject();
if (device && device.cutOff != deviceState.Section.cutOff.Default) {
return true;
}
},
// 激活
active() {
const device = getCurrentStateObject();
if (device && device.cutOff == deviceState.Section.cutOff.Default) {
return true;
}
},
// 区段封锁
lock() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.Section.status.State06) {
return true;
}
},
// 区段解禁
unlock() {
const device = getCurrentStateObject();
if (device && device.status != deviceState.Section.status.State06) {
return true;
}
},
// 区段设置限速
setSpeed() {
const device = getCurrentStateObject();
if (device && device.speedUpperLimit != deviceState.Section.speedUpperLimit.Default) {
return true;
}
},
// 区段取消限速
cancelSpeed() {
const device = getCurrentStateObject();
if (device && device.speedUpperLimit == deviceState.Section.speedUpperLimit.Default) {
return true;
}
},
// 新建列车
newTrain() {
},
// 计轴预复位
axlePreReset() {
},
// 设置故障
setStoppage() {
const device = getCurrentStateObject();
if (device && device.fault) {
return true;
}
},
// 取消故障
cancelStoppage() {
const device = getCurrentStateObject();
if (device && !device.fault) {
return true;
}
}
},
Signal: {
// 进路选排
arrangementRoute() {
},
// 进路取消
cancelTrainRoute() {
},
// 信号封闭
lock() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.Signal.status.State05) {
return true;
}
},
// 信号解封
unlock() {
const device = getCurrentStateObject();
if (device && device.status != deviceState.Signal.status.State05) {
return true;
}
},
// 信号重开
reopenSignal() {
},
// 进路引导
guide() {
},
// 设置联锁自动进路
setAutoInterlock() {
},
// 取消联锁自动进路
cancelAutoInterlock() {
},
// 设置联锁自动触发
setAutoTrigger() {
},
// 取消联锁自动触发
cancelAutoTrigger() {
},
// 关灯
signalClose() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.Signal.status.State01) {
return true;
}
},
// 人工控
humanControl() {
},
// ats自动控
atsAutoControl() {
},
// 查询进路状态
detail() {
},
// 设置故障
setStoppage() {
const device = getCurrentStateObject();
if (device && device.fault) {
return true;
}
},
// 取消故障
cancelStoppage() {
const device = getCurrentStateObject();
if (device && !device.fault) {
return true;
}
}
},
Station: {
// 全站设置联锁自动触发
setAutoTrigger() {
},
// 全站取消联锁自动触发
cancelAutoTrigger() {
},
// 上电解锁
powerUnLock() {
},
// 执行关键操作测试
execKeyOperationTest() {
},
// 所有进路自排开
atsAutoControlALL() {
},
// 所有进路自排关
humanControlALL() {
},
// 设置ZC故障
setStoppage() {
const device = getCurrentStateObject();
if (device && device.fault) {
return true;
}
},
// 取消ZC故障
cancelStoppage() {
const device = getCurrentStateObject();
if (device && !device.fault) {
return true;
}
}
},
StationControl: {
// 紧急站控
emergencyStationControl() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.StationControl.status.State03) {
return true;
}
},
// 请求站控
requestStationControl() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.StationControl.status.State02) {
return true;
}
},
// 强行站控
forcedStationControl() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.StationControl.status.State02) {
return true;
}
},
// 请求中控
requestCentralControl() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.StationControl.status.State01) {
return true;
}
},
// 设置故障
setStoppage() {
const device = getCurrentStateObject();
if (device && device.fault) {
return true;
}
},
// 取消故障
cancelStoppage() {
const device = getCurrentStateObject();
if (device && !device.fault) {
return true;
}
}
},
StationStand: {
// 设置扣车
setDetainTrain() {
const device = getCurrentStateObject();
if (store.state.training.prdType == '02') { // 中心行调模式
if (device && device.holdStatus == deviceState.StationStand.holdStatus.State04) {
return true;
} else if (device && device.holdStatus == deviceState.StationStand.holdStatus.State03) {
return true;
}
} else { // 现地模式
if (device && device.holdStatus == deviceState.StationStand.holdStatus.State04) {
return true;
} else if (device && device.holdStatus == deviceState.StationStand.holdStatus.State02) {
return true;
}
}
},
// 取消扣车
cancelDetainTrain() {
const device = getCurrentStateObject();
if (store.state.training.prdType == '02') {
if (device && device.holdStatus == deviceState.StationStand.holdStatus.State04) {
return false;
} else if (device && device.holdStatus != deviceState.StationStand.holdStatus.State03) {
return true;
}
} else {
if (device && device.holdStatus == deviceState.StationStand.holdStatus.State04) {
return false;
} else if (device && device.holdStatus != deviceState.StationStand.holdStatus.State02) {
return true;
}
}
},
// 强制取消扣车
cancelDetainTrainForce() {
const device = getCurrentStateObject();
if (device && device.holdStatus == deviceState.StationStand.holdStatus.State01) {
return true;
}
},
// 设置全站扣车
cancelDetainTrainAll() {
},
// 设置运行等级
setRunLevel() {
},
// 设置停站时间
setStopTime() {
},
// 设置跳停
setJumpStop() {
const device = getCurrentStateObject();
if (device && device.jumpStopStatus != deviceState.StationStand.jumpStopStatus.State01) {
return true;
}
},
// 取消跳停
cancelJumpStop() {
const device = getCurrentStateObject();
if (device && device.jumpStopStatus == deviceState.StationStand.jumpStopStatus.State01) {
return true;
}
},
// 提前发车
earlyDeparture() {
},
// 站台详细信息
detail() {
},
// 设置折返策略
setBackStrategy() {
},
// 设置故障
setStoppage() {
const device = getCurrentStateObject();
if (device && device.fault) {
return true;
}
},
// 取消故障
cancelStoppage() {
const device = getCurrentStateObject();
if (device && !device.fault) {
return true;
}
}
},
Switch: {
// 单锁
lock() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.Switch.status.State10) {
return true;
}
},
// 解锁
unlock() {
const device = getCurrentStateObject();
if (device && device.status != deviceState.Switch.status.State10) {
return true;
}
},
// 封锁
block() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.Switch.status.State14) {
return true;
}
},
// 解封
unblock() {
const device = getCurrentStateObject();
if (device && device.status != deviceState.Switch.status.State14) {
return true;
}
},
// 强扳
switchTurnoutForce() {
},
// 转动
switchTurnout() {
},
// 道岔故障解锁
fault() {
},
// 计轴预复位
axlePreReset() {
},
// 道岔切除
split() {
},
// 道岔激活
active() {
},
// 道岔设置速度
setSpeed() {
// const device = getCurrentStateObject();
},
// 道岔取消速度
cancelSpeed() {
},
// 设置故障
setStoppage() {
const device = getCurrentStateObject();
if (device && device.fault) {
return true;
}
},
// 取消故障
cancelStoppage() {
const device = getCurrentStateObject();
if (device && !device.fault) {
return true;
}
}
},
Train: {
// 添加列车识别号
addTrainId() {
},
// 删除列车识别号
delTrainId() {
},
// 修改列车识别号
editTrainId() {
},
// 修改车组号
editTrainNo() {
},
// 移动列车识别号
moveTrainId() {
},
// 交换列车识别号
switchTrainId() {
},
// 设置限速
limitSpeed() {
},
// 设置通信故障
setStoppage() {
const device = getCurrentStateObject();
if (device && device.fault) {
return true;
}
},
// 取消通信故障
cancelStoppage() {
const device = getCurrentStateObject();
if (device && !device.fault) {
return true;
}
}
}
};
export function checkOperationValidity() {
if (store.state.training.prdType == '02') {
return true;
}
}
/**
* 将menu的disabled属性使用disabledCallback计算并返回
* @param {Array} menu
*/
export function menuConvert(menu) {
if (menu.constructor === Array) {
menu.forEach(elem => {
if (elem.type === 'separator') {
elem.show = true;
return;
}
if (elem.disabledCallback.constructor === Function) {
elem.disabled = elem.defaultDisabled;
if (!elem.defaultDisabled) {
elem.disabled = elem.disabledCallback();
}
}
});
}
return menu;
}
/**
* 根据产品类型返回对应的menuBar
* @param {*} menuObj
*/
export function menuBarConvert(menu, mode) {
if (menu) {
if (mode === OperateMode.NORMAL) {
menu.forEach(item => {
if (item.type === 'separator') {
item.show = true;
return;
}
item.show = false;
if (!item.click) {
item.click = () => { };
}
if (!item.froce) {
item.show = true;
if (item.children && item.children.length > 0) {
menuBarConvert(item.children, mode);
}
}
});
} else if (mode === OperateMode.ADMIN) {
menu.forEach(item => {
item.show = true;
if (!item.click) {
item.click = () => { };
}
if (item.children && item.children.length > 0) {
menuBarConvert(item.children, mode);
}
});
}
}
return menu || [];
}
/**
* 将menu的show属性过滤返回
* @param {Array} menu
*/
export function menuFiltration(menuObj) {
var selected = getCurrentStateObject();
var control;
var menu = [];
if (selected._type == 'StationStand') {
control = store.getters['map/getStationControlByStationCode'](selected.deviceStationCode);
} else if (selected._type == 'Station') {
control = store.getters['map/getStationControlByStationCode'](selected.code);
} else {
control = store.getters['map/getStationControlByStationCode'](selected.stationCode);
}
if (control) {
if (store.state.training.prdType != '') {
const type = State2SimulationMap[store.state.training.prdType];
const status = State2ControlMap[control.status];
menu = [...menuObj[type]];
if (menu.constructor === Array) {
menu.forEach(elem => {
if (elem.type === 'separator') {
elem.show = true;
return;
}
if (elem.auth.constructor === Object) {
elem.show = true;
if (!elem.auth['station'] && !elem.auth['center']) { // 控制不显示
elem.show = false;
}
elem.defaultDisabled = !elem.auth[status];
}
});
}
}
}
return menu;
}
/**
* 将train menu的show属性过滤返回
*/
export function trainMenuFiltration(menuObj) {
var menu = [];
if (store.state.training.prdType != '') {
const type = State2SimulationMap[store.state.training.prdType];
menu = [...menuObj[type]];
if (menu.constructor === Array) {
menu.forEach(elem => {
if (elem.auth.constructor === Object) {
elem.show = true;
if (!elem.auth['station'] && !elem.auth['center']) { // 控制不显示
elem.show = false;
}
}
});
}
}
return menu;
}

View File

@ -1,362 +0,0 @@
import store from '@/store/index_APP_TARGET';
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
},
cancelSpeed: {
// 取消限速
operation: OperationEvent.Section.cancelSpeed.menu.operation,
cmdType: CMD.Section.CMD_SECTION_CANCEL_LIMIT_SPEED
},
fault:{
// 区段故障解锁
operation: OperationEvent.Section.fault.menu.operation,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK
},
setFault: {
operation: OperationEvent.Section.stoppage.menu.operation,
cmdType: CMD.Section.CMD_SECTION_ADD_FAULT
},
axlePreReset:{
// 区段计轴预复位
operation: OperationEvent.Section.axlePreReset.menu.operation,
cmdType: CMD.Section.CMD_SECTION_AXIS_PRE_RESET
}
},
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
},
setAutoTrigger: {
// 设置联锁自动触发
operation: OperationEvent.Signal.setAutoTrigger.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER
},
cancelAutoTrigger: {
// 取消联锁自动触发
operation: OperationEvent.Signal.cancelAutoTrigger.menu.operation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER
}
},
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
},
turnoutForce: {
// 道岔强扳
operation: OperationEvent.Switch.turnoutForce.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_FORCE_TURN
},
turnout:{
// 道岔转动
operation: OperationEvent.Switch.turnout.menu.operation,
cmdType:CMD.Switch.CMD_SWITCH_TURN
},
fault: {
// 故障解锁
operation: OperationEvent.Switch.fault.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK
},
split:{
// 区段切除
operation: OperationEvent.Switch.split.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
},
active:{
// 区段激活
operation: OperationEvent.Switch.active.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
},
setSpeed:{
// 设置临时限速
operation: OperationEvent.Switch.setSpeed.menu.operation,
cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
},
cancelSpeed: {
// 取消临时限速
operation: OperationEvent.Switch.cancelSpeed.menu.operation,
cmdType:CMD.Switch.CMD_SWITCH_CANCEL_LIMIT_SPEED
},
alxeEffective:{
// 确认计轴有效
operation: OperationEvent.Switch.alxeEffective.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE
},
axlePreReset:{
// 计轴预复位
operation: OperationEvent.Switch.axlePreReset.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_AXIS_PRE_RESET
}
},
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
},
cancelDetainTrainForce: {
// 强制取消扣车
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation,
cmdType: CMD.Stand.CMD_STAND_FORCE_CANCEL_HOLD_TRAIN
},
cancelDetainTrainAll: {
// 全线取消扣车
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation,
cmdType: CMD.Stand.CMD_STAND_WHOLE_LINE_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
}
},
TrainWindow: {
editTrainId: {
operation: OperationEvent.Train.editTrainId.menu.operation,
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
},
addTrainId: {
operation: OperationEvent.Train.addTrainId.menu.operation,
cmdType: ''
}
},
Common: {
setFault: {
operation: OperationEvent.MixinCommand.stoppage.menu.operation,
cmdType: CMD.Fault.CMD_SET_FAULT
},
cancelFault: {
operation: OperationEvent.MixinCommand.cancelStoppage.menu.operation,
cmdType: CMD.Fault.CMD_CANCEL_FAULT
}
}
};
export function commitOperate(operate, paramList, over, val) {
const step = {
start: true,
operation: operate.operation,
param:{}
};
if (val) { step.val = val; }
step.param = paramList;
// over 0为首次操作1为中间操作2为最后操作3为直接一次性操作
if (over == 0 || over == 3) {
const codeList = Object.values(paramList);
step.code = codeList[0];
}
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({ valid: valid, operate: step });
}).catch(error=>{
reject(error);
});
});
}

View File

@ -19,7 +19,7 @@ import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from './utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'SectionMenu',

View File

@ -26,7 +26,7 @@ import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
// import { querySignalStatus } from '@/api/simulation';
import {menuOperate, commitOperate} from './utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'SignalMenu',

View File

@ -26,7 +26,7 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from './utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'StationStandMenu',

View File

@ -19,7 +19,7 @@ import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import {menuOperate, commitOperate} from './utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'SwitchMenu',

View File

@ -1,570 +0,0 @@
import store from '@/store/index_APP_TARGET';
import deviceState from '@/jmap/constant/deviceState';
import { OperateMode } from '@/scripts/ConstDic';
export function getCurrentStateObject() {
return store.getters['menuOperation/selected'];
}
/** 系统类型 */
export const State2SimulationMap = {
'01': 'local', // 现地工作站
'02': 'central' // 中心调度工作站
};
export const State2ControlMap = {
'01': 'center', // 中控
'02': 'station', // 站控
'03': 'station'
};
// 控制禁用
export const MenuDisabledState = {
Section: {
// 故障解锁
fault() {
},
// 切除
split() {
const device = getCurrentStateObject();
if (device && device.cutOff != deviceState.Section.cutOff.Default) {
return true;
}
},
// 激活
active() {
const device = getCurrentStateObject();
if (device && device.cutOff == deviceState.Section.cutOff.Default) {
return true;
}
},
// 区段封锁
lock() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.Section.status.State06) {
return true;
}
},
// 区段解禁
unlock() {
const device = getCurrentStateObject();
if (device && device.status != deviceState.Section.status.State06) {
return true;
}
},
// 区段设置限速
setSpeed() {
const device = getCurrentStateObject();
if (device && device.speedUpperLimit != deviceState.Section.speedUpperLimit.Default) {
return true;
}
},
// 区段取消限速
cancelSpeed() {
const device = getCurrentStateObject();
if (device && device.speedUpperLimit == deviceState.Section.speedUpperLimit.Default) {
return true;
}
},
// 新建列车
newTrain() {
},
// 计轴预复位
axlePreReset() {
},
// 设置故障
setStoppage() {
const device = getCurrentStateObject();
if (device && device.fault) {
return true;
}
},
// 取消故障
cancelStoppage() {
const device = getCurrentStateObject();
if (device && !device.fault) {
return true;
}
}
},
Signal: {
// 进路选排
arrangementRoute() {
},
// 进路取消
cancelTrainRoute() {
},
// 信号封闭
lock() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.Signal.status.State05) {
return true;
}
},
// 信号解封
unlock() {
const device = getCurrentStateObject();
if (device && device.status != deviceState.Signal.status.State05) {
return true;
}
},
// 信号重开
reopenSignal() {
},
// 进路引导
guide() {
},
// 设置联锁自动进路
setAutoInterlock() {
},
// 取消联锁自动进路
cancelAutoInterlock() {
},
// 设置联锁自动触发
setAutoTrigger() {
},
// 取消联锁自动触发
cancelAutoTrigger() {
},
// 关灯
signalClose() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.Signal.status.State01) {
return true;
}
},
// 人工控
humanControl() {
},
// ats自动控
atsAutoControl() {
},
// 查询进路状态
detail() {
},
// 设置故障
setStoppage() {
const device = getCurrentStateObject();
if (device && device.fault) {
return true;
}
},
// 取消故障
cancelStoppage() {
const device = getCurrentStateObject();
if (device && !device.fault) {
return true;
}
}
},
Station: {
// 全站设置联锁自动触发
setAutoTrigger() {
},
// 全站取消联锁自动触发
cancelAutoTrigger() {
},
// 上电解锁
powerUnLock() {
},
// 执行关键操作测试
execKeyOperationTest() {
},
// 所有进路自排开
atsAutoControlALL() {
},
// 所有进路自排关
humanControlALL() {
},
// 设置ZC故障
setStoppage() {
const device = getCurrentStateObject();
if (device && device.fault) {
return true;
}
},
// 取消ZC故障
cancelStoppage() {
const device = getCurrentStateObject();
if (device && !device.fault) {
return true;
}
}
},
StationControl: {
// 紧急站控
emergencyStationControl() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.StationControl.status.State03) {
return true;
}
},
// 请求站控
requestStationControl() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.StationControl.status.State02) {
return true;
}
},
// 强行站控
forcedStationControl() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.StationControl.status.State02) {
return true;
}
},
// 请求中控
requestCentralControl() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.StationControl.status.State01) {
return true;
}
},
// 设置故障
setStoppage() {
const device = getCurrentStateObject();
if (device && device.fault) {
return true;
}
},
// 取消故障
cancelStoppage() {
const device = getCurrentStateObject();
if (device && !device.fault) {
return true;
}
}
},
StationStand: {
// 设置扣车
setDetainTrain() {
const device = getCurrentStateObject();
if (store.state.training.prdType == '02') { // 中心行调模式
if (device && device.holdStatus == deviceState.StationStand.holdStatus.State04) {
return true;
} else if (device && device.holdStatus == deviceState.StationStand.holdStatus.State03) {
return true;
}
} else { // 现地模式
if (device && device.holdStatus == deviceState.StationStand.holdStatus.State04) {
return true;
} else if (device && device.holdStatus == deviceState.StationStand.holdStatus.State02) {
return true;
}
}
},
// 取消扣车
cancelDetainTrain() {
const device = getCurrentStateObject();
if (store.state.training.prdType == '02') {
if (device && device.holdStatus == deviceState.StationStand.holdStatus.State04) {
return false;
} else if (device && device.holdStatus != deviceState.StationStand.holdStatus.State03) {
return true;
}
} else {
if (device && device.holdStatus == deviceState.StationStand.holdStatus.State04) {
return false;
} else if (device && device.holdStatus != deviceState.StationStand.holdStatus.State02) {
return true;
}
}
},
// 强制取消扣车
cancelDetainTrainForce() {
const device = getCurrentStateObject();
if (device && device.holdStatus == deviceState.StationStand.holdStatus.State01) {
return true;
}
},
// 设置全站扣车
cancelDetainTrainAll() {
},
// 设置运行等级
setRunLevel() {
},
// 设置停站时间
setStopTime() {
},
// 设置跳停
setJumpStop() {
const device = getCurrentStateObject();
if (device && device.jumpStopStatus != deviceState.StationStand.jumpStopStatus.State01) {
return true;
}
},
// 取消跳停
cancelJumpStop() {
const device = getCurrentStateObject();
if (device && device.jumpStopStatus == deviceState.StationStand.jumpStopStatus.State01) {
return true;
}
},
// 提前发车
earlyDeparture() {
},
// 站台详细信息
detail() {
},
// 设置折返策略
setBackStrategy() {
},
// 设置故障
setStoppage() {
const device = getCurrentStateObject();
if (device && device.fault) {
return true;
}
},
// 取消故障
cancelStoppage() {
const device = getCurrentStateObject();
if (device && !device.fault) {
return true;
}
}
},
Switch: {
// 单锁
lock() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.Switch.status.State10) {
return true;
}
},
// 解锁
unlock() {
const device = getCurrentStateObject();
if (device && device.status != deviceState.Switch.status.State10) {
return true;
}
},
// 封锁
block() {
const device = getCurrentStateObject();
if (device && device.status == deviceState.Switch.status.State14) {
return true;
}
},
// 解封
unblock() {
const device = getCurrentStateObject();
if (device && device.status != deviceState.Switch.status.State14) {
return true;
}
},
// 强扳
switchTurnoutForce() {
},
// 转动
switchTurnout() {
},
// 道岔故障解锁
fault() {
},
// 计轴预复位
axlePreReset() {
},
// 道岔切除
split() {
},
// 道岔激活
active() {
},
// 道岔设置速度
setSpeed() {
// const device = getCurrentStateObject();
},
// 道岔取消速度
cancelSpeed() {
},
// 设置故障
setStoppage() {
const device = getCurrentStateObject();
if (device && device.fault) {
return true;
}
},
// 取消故障
cancelStoppage() {
const device = getCurrentStateObject();
if (device && !device.fault) {
return true;
}
}
},
Train: {
// 添加列车识别号
addTrainId() {
},
// 删除列车识别号
delTrainId() {
},
// 修改列车识别号
editTrainId() {
},
// 修改车组号
editTrainNo() {
},
// 移动列车识别号
moveTrainId() {
},
// 交换列车识别号
switchTrainId() {
},
// 设置限速
limitSpeed() {
},
// 设置通信故障
setStoppage() {
const device = getCurrentStateObject();
if (device && device.fault) {
return true;
}
},
// 取消通信故障
cancelStoppage() {
const device = getCurrentStateObject();
if (device && !device.fault) {
return true;
}
}
}
};
export function checkOperationValidity() {
if (store.state.training.prdType == '02') {
return true;
}
}
/**
* 将menu的disabled属性使用disabledCallback计算并返回
* @param {Array} menu
*/
export function menuConvert(menu) {
if (menu.constructor === Array) {
menu.forEach(elem => {
if (elem.type === 'separator') {
elem.show = true;
return;
}
if (elem.disabledCallback.constructor === Function) {
elem.disabled = elem.defaultDisabled;
if (!elem.defaultDisabled) {
elem.disabled = elem.disabledCallback();
}
}
});
}
return menu;
}
/**
* 根据产品类型返回对应的menuBar
* @param {*} menuObj
*/
export function menuBarConvert(menu, mode) {
if (menu) {
if (mode === OperateMode.NORMAL) {
menu.forEach(item => {
if (item.type === 'separator') {
item.show = true;
return;
}
item.show = false;
if (!item.click) {
item.click = () => { };
}
if (!item.froce) {
item.show = true;
if (item.children && item.children.length > 0) {
menuBarConvert(item.children, mode);
}
}
});
} else if (mode === OperateMode.ADMIN) {
menu.forEach(item => {
item.show = true;
if (!item.click) {
item.click = () => { };
}
if (item.children && item.children.length > 0) {
menuBarConvert(item.children, mode);
}
});
}
}
return menu || [];
}
/**
* 将menu的show属性过滤返回
* @param {Array} menu
*/
export function menuFiltration(menuObj) {
var selected = getCurrentStateObject();
var control;
var menu = [];
if (selected._type == 'StationStand') {
control = store.getters['map/getStationControlByStationCode'](selected.deviceStationCode);
} else if (selected._type == 'Station') {
control = store.getters['map/getStationControlByStationCode'](selected.code);
} else {
control = store.getters['map/getStationControlByStationCode'](selected.stationCode);
}
if (control) {
if (store.state.training.prdType != '') {
const type = State2SimulationMap[store.state.training.prdType];
const status = State2ControlMap[control.status];
menu = [...menuObj[type]];
if (menu.constructor === Array) {
menu.forEach(elem => {
if (elem.type === 'separator') {
elem.show = true;
return;
}
if (elem.auth.constructor === Object) {
elem.show = true;
if (!elem.auth['station'] && !elem.auth['center']) { // 控制不显示
elem.show = false;
}
elem.defaultDisabled = !elem.auth[status];
}
});
}
}
}
return menu;
}
/**
* 将train menu的show属性过滤返回
*/
export function trainMenuFiltration(menuObj) {
var menu = [];
if (store.state.training.prdType != '') {
const type = State2SimulationMap[store.state.training.prdType];
menu = [...menuObj[type]];
if (menu.constructor === Array) {
menu.forEach(elem => {
if (elem.auth.constructor === Object) {
elem.show = true;
if (!elem.auth['station'] && !elem.auth['center']) { // 控制不显示
elem.show = false;
}
}
});
}
}
return menu;
}

View File

@ -1,306 +0,0 @@
import store from '@/store/index_APP_TARGET';
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
},
setFault: {
operation: OperationEvent.Section.stoppage.menu.operation,
cmdType: CMD.Section.CMD_SECTION_ADD_FAULT
}
},
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
},
split:{
// 区段切除
operation: OperationEvent.Switch.split.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF
},
active:{
// 区段激活
operation: OperationEvent.Switch.active.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE
},
setSpeed:{
// 设置临时限速
operation: OperationEvent.Switch.setSpeed.menu.operation,
cmdType:CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED
},
alxeEffective:{
// 确认计轴有效
operation: OperationEvent.Switch.alxeEffective.menu.operation,
cmdType: CMD.Switch.CMD_SWITCH_COMFIRMATION_AXLE
}
},
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
}
},
Common: {
setFault: {
operation: OperationEvent.MixinCommand.stoppage.menu.operation,
cmdType: CMD.Fault.CMD_SET_FAULT
},
cancelFault: {
operation: OperationEvent.MixinCommand.cancelStoppage.menu.operation,
cmdType: CMD.Fault.CMD_CANCEL_FAULT
}
}
};
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) {
const codeList = Object.values(paramList);
step.code = codeList[0];
}
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({ valid: valid, operate: step });
}).catch(error=>{
reject(error);
});
});
}