佛山有轨电车 信号机代码调整

This commit is contained in:
joylink_cuiweidong 2022-12-07 15:18:44 +08:00
parent 941dd2d24a
commit e5869a3ce0
2 changed files with 104 additions and 114 deletions

View File

@ -51,120 +51,107 @@ export default {
default() { default() {
return null; return null;
} }
},
work: {
type: String,
default() {
return '';
}
} }
}, },
data() { data() {
return { return {
menu: [], menu: [],
menuNormal: { menuNormal: [
Local: [ {
{ label: '进路选排',
label: '进路选排', handler: this.arrangementRoute,
handler: this.arrangementRoute, cmdType:CMD.Signal.CMD_SIGNAL_SET_ROUTE
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE },
}, {
// { label: '进路取消',
// label: '', handler: this.cancelTrainRoute,
// handler: this.cancelTrainRoute, cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE,
// cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE isShow: (signalDevice, work) => work === 'dispatchWork'
// }, },
{ {
label: '信号重开', label: '信号重开',
handler: this.reopenSignal, handler: this.reopenSignal,
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
}, },
{ {
label: '进路引导', label: '进路引导',
handler: this.guide, handler: this.guide,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
}, isShow: (signalDevice, work) => work === 'localWork'
// { },
// label: '', // {
// handler: this.humanTrainRoute, label: '进路交人工控',
// cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE handler: this.humanControl,
// }, cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
// { },
// label: '', {
// handler: this.singalPassModel, label: '进路交自动控',
// cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO handler: this.atsAutoControl,
// }, cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
// { },
// label: '', {
// handler: this.singalCancelPassModel, label: '设置联锁自动进路',
// cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO handler: this.setAutoInterlock,
// }, cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO,
{ isDisabled: signalDevice => signalDevice.fleetMode === 1,
label: '进路交人工控', isShow: (signalDevice, work) => work === 'localWork'
handler: this.humanControl, },
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING {
}, label: '取消联锁自动进路',
{ handler: this.cancelAutoInterlock,
label: '进路交自动控', cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO,
handler: this.atsAutoControl, isDisabled: signalDevice => signalDevice.fleetMode !== 1,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING isShow: (signalDevice, work) => work === 'localWork'
}, },
{ {
label: '设置联锁自动进路', label: '设置联锁自动触发',
handler: this.setAutoInterlock, handler: this.setAutoTrigger,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER,
}, isDisabled: signalDevice => signalDevice.ciControl === 1,
{ isShow: (signalDevice, work) => work === 'localWork'
label: '取消联锁自动进路', },
handler: this.cancelAutoInterlock, {
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO label: '取消联锁自动触发',
}, handler: this.cancelAutoTrigger,
{ cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER,
label: '设置联锁自动触发', isDisabled: signalDevice => signalDevice.ciControl !== 1,
handler: this.setAutoTrigger, isShow: (signalDevice, work) => work === 'localWork'
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER },
}, {
{ label: '查询进路状态',
label: '取消联锁自动触发', handler: this.detail,
handler: this.cancelAutoTrigger, cmdType: CMD.Signal.CMD_SIGNAL_DETAIL
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER }
}, // Local: [
{ // // {
label: '查询进路状态', // // label: '',
handler: this.detail, // // handler: this.cancelTrainRoute,
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL // // cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
} // // },
], //
Center: [ // // {
{ // // label: '', //
label: '进路选排', // // handler: this.humanTrainRoute,
handler: this.arrangementRoute, // // cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE // // },
}, // // {
{ // // label: '',
label: '进路取消', // // handler: this.singalPassModel,
handler: this.cancelTrainRoute, // // cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE // // },
}, // // {
{ // // label: '',
label: '信号重开', // // handler: this.singalCancelPassModel,
handler: this.reopenSignal, // // cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL // // },
}, // ],
{ ],
type: 'separator'
},
{
label: '进路交人工控',
handler: this.humanControl,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
},
{
label: '进路交自动控',
handler: this.atsAutoControl,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
},
{
label: '查询进路状态',
handler: this.detail,
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL
}
]
},
menuForce: [ menuForce: [
{ {
label: '设置故障', label: '设置故障',
@ -221,7 +208,14 @@ export default {
}; };
}, },
initMenu() { initMenu() {
// this.menu = MenuContextHandler.covert(this.menuNormal);
//
this.menu = [];
this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected, this.work) : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
this.menu.push(menuItem);
});
// //
if (this.operatemode === OperateMode.FAULT) { if (this.operatemode === OperateMode.FAULT) {
this.menu = this.menuForce; this.menu = this.menuForce;

View File

@ -56,7 +56,6 @@ export default {
return { return {
menu: [], menu: [],
menuNormal: [ menuNormal: [
{ {
label: '道岔总定', label: '道岔总定',
handler: this.locate, handler: this.locate,
@ -196,9 +195,6 @@ export default {
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true; menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
this.menu.push(menuItem); this.menu.push(menuItem);
}); });
if (this.operatemode === OperateMode.ADMIN) {
this.menu = [...this.menu, ...this.menuForce];
}
// //
if (this.operatemode === OperateMode.FAULT) { if (this.operatemode === OperateMode.FAULT) {