宁波线路操作代码整理

This commit is contained in:
joylink_cuiweidong 2020-06-19 09:44:03 +08:00
parent 5bf46c151c
commit 411c1cc13e
19 changed files with 28 additions and 369 deletions

View File

@ -31,7 +31,7 @@
<script>
import { OperationEvent } from '@/scripts/ConstDic';
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: 'ConfirmControl',

View File

@ -36,7 +36,7 @@
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { deepAssign } from '@/utils/index';
import { mapGetters } from 'vuex';

View File

@ -31,7 +31,7 @@
import { mapGetters } from 'vuex';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'RouteLock',

View File

@ -35,7 +35,7 @@
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { commitOperate } from '../utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { deviceFaultType, deviceType} from '@/scripts/cmdPlugin/Config';
export default {

View File

@ -49,7 +49,7 @@
<script>
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
export default {

View File

@ -46,7 +46,7 @@
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
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: 'TrainSetHead',

View File

@ -46,7 +46,7 @@
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
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: 'TrainSetPlan',

View File

@ -32,7 +32,7 @@
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
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: 'TrainSetWork',

View File

@ -47,7 +47,7 @@
import { OperationEvent } 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: 'RouteControl',

View File

@ -9,7 +9,7 @@
import PopMenu from '@/components/PopMenu';
import TurnBackControl from './dialog/turnBackControl';
import { mapGetters } from 'vuex';
import {menuOperate, commitOperate} from './utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';

View File

@ -47,7 +47,7 @@
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import TwoConfirmation from './childDialog/twoConfirmation';
import {menuOperate, commitOperate} from '../utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'StationControl',

View File

@ -9,8 +9,10 @@
import PopMenu from '@/components/PopMenu';
import CancelAllLimit from './dialog/cancelAllLimit';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
import { DeviceMenu } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'MenuLimit',
@ -28,27 +30,20 @@ export default {
},
data() {
return {
menu: [{
label: '取消全线临时限速',
handler: this.cancelSpeed,
disabledCallback: '',
auth: { station: true, center: false }
}],
menu: [],
menuNormal: {
local: [
Local: [
{
label: '取消全线临时限速',
handler: this.cancelSpeed,
disabledCallback: '',
auth: { station: true, center: false }
cmdType: CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED
}
],
central: [
Center: [
{
label: '取消全线临时限速',
handler: this.cancelSpeed,
disabledCallback: '',
auth: { station: false, center: true }
cmdType: CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED
}
]
}
@ -81,9 +76,7 @@ export default {
},
initMenu() {
//
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu];
}
this.menu = MenuContextHandler.covert(this.menuNormal);
},
doShow(point) {
this.clickEvent();
@ -99,17 +92,8 @@ export default {
},
//
cancelSpeed() {
const operate = {
start: true,
send: true,
code: this.selected.code,
type: MapDeviceType.LimitControl.type,
label: MapDeviceType.LimitControl.label,
operation: OperationEvent.LimitControl.CancelAllLimit.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
commitOperate(menuOperate.LimitControl.cancelSpeed, {}, 0).then(({valid, operate})=>{
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
this.$refs.cancelAllLimit.doShow(operate, this.selected);
}
});

View File

@ -20,7 +20,7 @@ import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
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';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
export default {

View File

@ -20,7 +20,7 @@ import RouteHandControl from '@/jmapNew/theme/components/menus/dialog/routeHandC
import RouterCommand from './dialog/routerCommand';
import RouteDetail from '@/jmapNew/theme/components/menus/dialog/routeDetail';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import {menuOperate, commitOperate} from './utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { mapGetters } from 'vuex';

View File

@ -9,7 +9,7 @@
import PopMenu from '@/components/PopMenu';
import StationControl from './dialog/stationControl';
import { mapGetters } from 'vuex';
import {menuOperate, commitOperate} from './utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';

View File

@ -20,7 +20,7 @@ import StandRunLevel from '@/jmapNew/theme/components/menus/dialog/standRunLevel
import StandStopTime from '@/jmapNew/theme/components/menus/dialog/standStopTime';
import StandBulkBuckleTrain from './dialog/standBulkBuckleTrain';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import {menuOperate, commitOperate} from './utils/menuOperate';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import CMD from '@/scripts/cmdPlugin/CommandEnum';

View File

@ -13,7 +13,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: 'MenuStationTurnBack',

View File

@ -21,7 +21,7 @@ import { mapGetters } from 'vuex';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
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,325 +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
},
setBackStrategy:{
// 设置折返策略
operation: OperationEvent.Station.setBackStrategy.menu.operation,
cmdType: CMD.Station.CMD_STATION_SET_TURN_BACK_STRATEGY
}
},
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
}
},
TrainWindow: {
destinationTrainId: {
operation: OperationEvent.Train.editTrainId.menu.operation,
cmdType: CMD.TrainWindow.CMD_TRAIN_SET_HEAD
},
setPlanTrainId: {
operation: OperationEvent.Train.setPlanTrainId.menu.operation,
cmdType: CMD.TrainWindow.CMD_TRAIN_SET_PLAN
},
artificialTrainId: {
operation: OperationEvent.Train.artificialTrainId.menu.operation,
cmdType: CMD.TrainWindow.CMD_TRAIN_SET_MANUAL
}
}
};
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);
});
});
}