代码调整
This commit is contained in:
parent
f6145d9ad8
commit
1555c0ccd5
@ -59,12 +59,14 @@ export default {
|
||||
label: '区故解',
|
||||
handler: this.fault,
|
||||
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK,
|
||||
isDisabled: (sectionDevice, work) => false,
|
||||
isShow: (sectionDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '属性',
|
||||
handler: this.detail,
|
||||
cmdType: CMD.Section.CMD_SECTION_DETAILS,
|
||||
isDisabled: (sectionDevice, work) => false,
|
||||
isShow: (sectionDevice, work) => work === 'dispatchWork'
|
||||
}
|
||||
],
|
||||
@ -113,10 +115,11 @@ export default {
|
||||
mounted() {
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
if (isDev) {
|
||||
this.menuNormal.Center.push( {
|
||||
this.menuNormal.push({
|
||||
label: '新建计划列车',
|
||||
handler: this.createPlanTrain,
|
||||
cmdType: CMD.Section.CMD_Train_Init_Plan
|
||||
cmdType: CMD.Section.CMD_Train_Init_Plan,
|
||||
isShow: (sectionDevice, work) => work === 'dispatchWork'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -65,30 +65,35 @@ export default {
|
||||
label: '办理进路',
|
||||
handler: this.arrangementRoute,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (signalDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '办理引导进路',
|
||||
handler: this.guide,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (signalDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '取消进路',
|
||||
handler: this.cancelTrainRoute,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (signalDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '总人解',
|
||||
handler: this.humanTrainRoute,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (signalDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '信号重开',
|
||||
handler: this.reopenSignal,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (signalDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
@ -109,18 +114,21 @@ export default {
|
||||
label: '进路收人工控',
|
||||
handler: this.humanControl,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (signalDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '进路交自动控',
|
||||
handler: this.atsAutoControl,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (signalDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '进路信息',
|
||||
handler: this.detail,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (signalDevice, work) => work === 'dispatchWork'
|
||||
}
|
||||
// Local: [
|
||||
|
@ -100,6 +100,7 @@ export default {
|
||||
label: '区故解',
|
||||
handler: this.fault,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_FAULT_UNLOCK,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (switchDevice, work) => work === 'dispatchWork'
|
||||
}
|
||||
// Center: [
|
||||
|
@ -70,57 +70,68 @@ export default {
|
||||
{
|
||||
label: '新建车组号',
|
||||
handler: this.createTrainNo,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (trainDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '移动车组号',
|
||||
handler: this.moveTrainNo,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (trainDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '删除车组号',
|
||||
handler: this.deleteTrainNo,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (trainDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '修改车组号',
|
||||
handler: this.editTrainNo,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (trainDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '设计划车',
|
||||
handler: this.setPlanTrainId,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (trainDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '设目的地',
|
||||
handler: this.destinationTrainId,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (trainDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '设人工车',
|
||||
handler: this.artificialTrainId,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (trainDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '设特殊人工车',
|
||||
handler: this.undeveloped,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (trainDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '详细列车信息',
|
||||
handler: this.detailTrainInfo,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (trainDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '属性',
|
||||
handler: this.undeveloped,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (trainDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '新建计划列车',
|
||||
handler: this.createPlanTrain,
|
||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (trainDevice, work) => work === 'localWork'
|
||||
}
|
||||
],
|
||||
|
@ -32,28 +32,28 @@ export default {
|
||||
return {
|
||||
menu: [{
|
||||
label: '取消全线临时限速',
|
||||
handler: this.cancelSpeed,
|
||||
disabledCallback: '',
|
||||
auth: { station: true, center: false }
|
||||
}],
|
||||
menuNormal: {
|
||||
local: [
|
||||
{
|
||||
label: '取消全线临时限速',
|
||||
handler: this.cancelSpeed,
|
||||
disabledCallback: '',
|
||||
auth: { station: true, center: false }
|
||||
}
|
||||
],
|
||||
central: [
|
||||
{
|
||||
label: '取消全线临时限速',
|
||||
handler: this.cancelSpeed,
|
||||
disabledCallback: '',
|
||||
auth: { station: false, center: true }
|
||||
}
|
||||
]
|
||||
}
|
||||
handler: this.cancelSpeed
|
||||
// disabledCallback: '',
|
||||
// auth: { station: true, center: false }
|
||||
}]
|
||||
// menuNormal: {
|
||||
// local: [
|
||||
// {
|
||||
// label: '取消全线临时限速',
|
||||
// handler: this.cancelSpeed,
|
||||
// disabledCallback: '',
|
||||
// auth: { station: true, center: false }
|
||||
// }
|
||||
// ],
|
||||
// central: [
|
||||
// {
|
||||
// label: '取消全线临时限速',
|
||||
// handler: this.cancelSpeed,
|
||||
// disabledCallback: '',
|
||||
// auth: { station: false, center: true }
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
@ -75,18 +75,23 @@ export default {
|
||||
{
|
||||
label: '设置临时限速',
|
||||
handler: this.setSpeed,
|
||||
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED
|
||||
},
|
||||
{
|
||||
label: '全线取消限速',
|
||||
handler: this.cancelSpeed,
|
||||
cmdType:CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED
|
||||
cmdType: CMD.Section.CMD_SECTION_SET_LIMIT_SPEED,
|
||||
isDisabled: (sectionDevice, work) => false
|
||||
|
||||
},
|
||||
{
|
||||
label: '全线取消限速',
|
||||
handler: this.cancelSpeed,
|
||||
cmdType:CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED,
|
||||
isShow: (signalDevice, work) => work === 'dispatchWork'
|
||||
isDisabled: (sectionDevice, work) => false
|
||||
|
||||
},
|
||||
{
|
||||
label: '全线取消限速',
|
||||
handler: this.cancelSpeed,
|
||||
cmdType:CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (sectionDevice, work) => work === 'dispatchWork'
|
||||
}
|
||||
// Local: [
|
||||
// // {
|
||||
@ -151,7 +156,7 @@ export default {
|
||||
label: '新建计划车',
|
||||
handler: this.addPlanTrain,
|
||||
cmdType: CMD.Section.CMD_Train_Init_Plan,
|
||||
isShow: (signalDevice, work) => work === 'dispatchWork'
|
||||
isShow: (sectionDevice, work) => work === 'dispatchWork'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -66,34 +66,40 @@ export default {
|
||||
{
|
||||
label: '进路选排',
|
||||
handler: this.arrangementRoute,
|
||||
cmdType:CMD.Signal.CMD_SIGNAL_SET_ROUTE
|
||||
cmdType:CMD.Signal.CMD_SIGNAL_SET_ROUTE,
|
||||
isDisabled: (signal, work) => false
|
||||
},
|
||||
{
|
||||
label: '进路取消',
|
||||
handler: this.cancelTrainRoute,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (signalDevice, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: '信号重开',
|
||||
handler: this.reopenSignal,
|
||||
isDisabled: (signal, work) => false,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
|
||||
},
|
||||
{
|
||||
label: '进路引导',
|
||||
handler: this.guide,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (signalDevice, work) => work === 'localWork'
|
||||
},
|
||||
{
|
||||
label: '进路交人工控',
|
||||
handler: this.humanControl,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING,
|
||||
isDisabled: (signal, work) => false
|
||||
},
|
||||
{
|
||||
label: '进路交自动控',
|
||||
handler: this.atsAutoControl,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING,
|
||||
isDisabled: (signal, work) => false
|
||||
},
|
||||
{
|
||||
label: '设置联锁自动进路',
|
||||
@ -126,7 +132,8 @@ export default {
|
||||
{
|
||||
label: '查询进路状态',
|
||||
handler: this.detail,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL,
|
||||
isDisabled: (signal, work) => false
|
||||
}
|
||||
// Local: [
|
||||
// // {
|
||||
|
@ -56,6 +56,7 @@ export default {
|
||||
{
|
||||
label: '上电解锁',
|
||||
handler: this.powerUnLock,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (signalDevice, work) => work === 'localWork'
|
||||
}
|
||||
],
|
||||
|
@ -118,24 +118,28 @@ export default {
|
||||
label: '区段激活',
|
||||
handler: this.active,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_ACTIVE,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (switchDevice, work) => work === 'localWork'
|
||||
},
|
||||
{
|
||||
label: '区段切除',
|
||||
handler: this.split,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_CUT_OFF,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (switchDevice, work) => work === 'localWork'
|
||||
},
|
||||
{
|
||||
label: '设置临时限速',
|
||||
handler: this.setSpeed,
|
||||
cmdType: CMD.Switch.CMD_SWITCH_SET_LIMIT_SPEED,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (switchDevice, work) => work === 'localWork'
|
||||
},
|
||||
{
|
||||
label: '全线取消限速',
|
||||
handler: this.cancelSpeed,
|
||||
cmdType:CMD.LimitControl.CMD_CANCEL_ALL_LIMIT_SPEED,
|
||||
isDisabled: (signal, work) => false,
|
||||
isShow: (switchDevice, work) => work === 'localWork'
|
||||
}
|
||||
],
|
||||
|
@ -37,7 +37,6 @@ import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import {judgeStationControl} from '../../components/utils/menuJudge';
|
||||
|
||||
export default {
|
||||
name: 'MenuTrain',
|
||||
@ -227,7 +226,7 @@ export default {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = [];
|
||||
this.menuNormal.forEach(menuItem => {
|
||||
menuItem.disabled = !judgeStationControl(this.selected.belongStationCode, this.selected.stationCode, this.work) || menuItem.isDisabled(this.selected, this.work);
|
||||
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected) : false;
|
||||
menuItem.show = menuItem.isShow(this.selected, this.work);
|
||||
this.menu.push(menuItem);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user