代码调整

This commit is contained in:
fan 2022-10-20 17:57:41 +08:00
parent f1ab35ce4b
commit c8c9ec4b43
5 changed files with 158 additions and 168 deletions

View File

@ -2,12 +2,12 @@
<div class="menus" :style="{width: width + 'px'}"> <div class="menus" :style="{width: width + 'px'}">
<menu-bar ref="menuBar" :selected="selected" /> <menu-bar ref="menuBar" :selected="selected" />
<menu-deplot-button ref="menuDeplotButton" /> <menu-deplot-button ref="menuDeplotButton" />
<menu-station-stand ref="menuStationStand" :selected="selected" /> <menu-station-stand ref="menuStationStand" :selected="selected" :work="'dispatchWork'" />
<menu-switch ref="menuSwitch" :selected="selected" /> <menu-switch ref="menuSwitch" :selected="selected" :work="'dispatchWork'" />
<menu-signal ref="menuSignal" :selected="selected" /> <menu-signal ref="menuSignal" :selected="selected" :work="'dispatchWork'" />
<menu-section ref="menuSection" :selected="selected" :work="'dispatchWork'" /> <menu-section ref="menuSection" :selected="selected" :work="'dispatchWork'" />
<menu-train ref="menuTrain" :selected="selected" /> <menu-train ref="menuTrain" :selected="selected" :work="'dispatchWork'" />
<menu-station ref="menuStation" :selected="selected" /> <menu-station ref="menuStation" :selected="selected" :work="'dispatchWork'" />
<passive-alarm ref="passiveAlarm" /> <passive-alarm ref="passiveAlarm" />
<passive-contorl ref="passiveControl" pop-class="fuzhou-01__systerm" /> <passive-contorl ref="passiveControl" pop-class="fuzhou-01__systerm" />
<passive-Timeout ref="passiveTimeout" /> <passive-Timeout ref="passiveTimeout" />

View File

@ -2,12 +2,12 @@
<div class="menus" :style="{width: width + 'px'}"> <div class="menus" :style="{width: width + 'px'}">
<menu-bar ref="menuBar" :selected="selected" /> <menu-bar ref="menuBar" :selected="selected" />
<menu-deplot-button ref="menuDeplotButton" /> <menu-deplot-button ref="menuDeplotButton" />
<menu-station-stand ref="menuStationStand" :selected="selected" /> <menu-station-stand ref="menuStationStand" :selected="selected" :work="'localWork'" />
<menu-switch ref="menuSwitch" :selected="selected" /> <menu-switch ref="menuSwitch" :selected="selected" :work="'localWork'" />
<menu-signal ref="menuSignal" :selected="selected" /> <menu-signal ref="menuSignal" :selected="selected" :work="'localWork'" />
<menu-section ref="menuSection" :selected="selected" :work="'localWork'" /> <menu-section ref="menuSection" :selected="selected" :work="'localWork'" />
<menu-train ref="menuTrain" :selected="selected" /> <menu-train ref="menuTrain" :selected="selected" />
<menu-station ref="menuStation" :selected="selected" /> <menu-station ref="menuStation" :selected="selected" :work="'localWork'" />
<passive-alarm ref="passiveAlarm" /> <passive-alarm ref="passiveAlarm" />
<passive-contorl ref="passiveControl" pop-class="fuzhou-01__systerm" /> <passive-contorl ref="passiveControl" pop-class="fuzhou-01__systerm" />
<passive-Timeout ref="passiveTimeout" /> <passive-Timeout ref="passiveTimeout" />

View File

@ -23,7 +23,6 @@ import RouteHandControl from './dialog/routeHandControl';
import RouteDetail from './dialog/routeDetail'; import RouteDetail from './dialog/routeDetail';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo'; import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic'; import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
@ -48,6 +47,12 @@ export default {
default() { default() {
return null; return null;
} }
},
work: {
type: String,
default() {
return '';
}
} }
}, },
data() { data() {
@ -55,8 +60,7 @@ export default {
menu: [], menu: [],
clickNum:0, clickNum:0,
oldSelected:null, oldSelected:null,
menuNormal: { menuNormal: [
Local: [
{ {
label: this.$t('menu.menuSignal.routeSelect'), label: this.$t('menu.menuSignal.routeSelect'),
handler: this.arrangementRoute, handler: this.arrangementRoute,
@ -70,12 +74,14 @@ export default {
{ {
label: this.$t('menu.menuSignal.signalBlock'), label: this.$t('menu.menuSignal.signalBlock'),
handler: this.lock, handler: this.lock,
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK cmdType: CMD.Signal.CMD_SIGNAL_BLOCK,
isDisabled: signal => signal.blockade === 1
}, },
{ {
label: this.$t('menu.menuSignal.signalDeblock'), label: this.$t('menu.menuSignal.signalDeblock'),
handler: this.unlock, handler: this.unlock,
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK,
isDisabled: signal => signal.blockade !== 1
}, },
{ {
label: this.$t('menu.menuSignal.signalReopen'), label: this.$t('menu.menuSignal.signalReopen'),
@ -90,27 +96,54 @@ export default {
{ {
label: '进路引导', label: '进路引导',
handler: this.guide, handler: this.guide,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
isShow: (signal, work) => work === 'localWork'
},
{
label: '引导进路办理',
handler: this.guide,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
isShow: (signal, work) => work === 'dispatchWork'
}, },
{ {
label: this.$t('menu.menuSignal.setInterlockAutoRoute'), label: this.$t('menu.menuSignal.setInterlockAutoRoute'),
handler: this.setAutoInterlock, handler: this.setAutoInterlock,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO,
isDisabled: signal => signal.fleetMode === 1,
isShow: (signal, work) => work === 'localWork'
}, },
{ {
label: this.$t('menu.menuSignal.cancelInterlockAutoRoute'), label: this.$t('menu.menuSignal.cancelInterlockAutoRoute'),
handler: this.cancelAutoInterlock, handler: this.cancelAutoInterlock,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO,
isDisabled: signal => signal.fleetMode === 0,
isShow: (signal, work) => work === 'localWork'
}, },
{ {
label: this.$t('menu.menuSignal.setInterlockAutoTrigger'), label: this.$t('menu.menuSignal.setInterlockAutoTrigger'),
handler: this.setAutoTrigger, handler: this.setAutoTrigger,
cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER,
isDisabled: signal => signal.ciControl === 1,
isShow: (signal, work) => work === 'localWork'
}, },
{ {
label: this.$t('menu.menuSignal.cancelInterlockAutoTrigger'), label: this.$t('menu.menuSignal.cancelInterlockAutoTrigger'),
handler: this.cancelAutoTrigger, handler: this.cancelAutoTrigger,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER,
isDisabled: signal => signal.ciControl !== 0,
isShow: (signal, work) => work === 'localWork'
},
{
label: '进路交人工控',
handler: this.humanControl,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING,
isShow: (signal, work) => work === 'dispatchWork'
},
{
label: '进路交ATS自动控',
handler: this.atsAutoControl,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING,
isShow: (signal, work) => work === 'dispatchWork'
}, },
{ {
label: '查询进路控制模式', label: '查询进路控制模式',
@ -118,79 +151,6 @@ export default {
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL cmdType: CMD.Signal.CMD_SIGNAL_DETAIL
} }
], ],
Center: [
{
label: this.$t('menu.menuSignal.routeSelect'),
handler: this.arrangementRoute,
cmdType: CMD.Signal.CMD_SIGNAL_SET_ROUTE
},
{
label: this.$t('menu.menuSignal.routeCancel'),
handler: this.cancelTrainRoute,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE
},
{
label: this.$t('menu.menuSignal.signalBlock'),
handler: this.lock,
cmdType: CMD.Signal.CMD_SIGNAL_BLOCK
},
{
label: this.$t('menu.menuSignal.signalDeblock'),
handler: this.unlock,
cmdType: CMD.Signal.CMD_SIGNAL_UNBLOCK
},
{
label: this.$t('menu.menuSignal.signalOff'),
handler: this.signalClose,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_SIGNAL
},
{
label: this.$t('menu.menuSignal.signalReopen'),
handler: this.reopenSignal,
cmdType: CMD.Signal.CMD_SIGNAL_REOPEN_SIGNAL
},
{
label: '引导进路办理',
handler: this.guide,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
},
// {
// label: this.$t('menu.menuSignal.setInterlockAutoRoute'),
// handler: this.setAutoInterlock,
// cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO
// },
// {
// label: this.$t('menu.menuSignal.cancelInterlockAutoRoute'),
// handler: this.cancelAutoInterlock,
// cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO
// },
// {
// label: this.$t('menu.menuSignal.setInterlockAutoTrigger'),
// handler: this.setAutoTrigger,
// cmdType: CMD.Signal.CMD_SIGNAL_SET_CI_AUTO_TRIGGER
// },
// {
// label: this.$t('menu.menuSignal.cancelInterlockAutoTrigger'),
// handler: this.cancelAutoTrigger,
// cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_CI_AUTO_TRIGGER
// },
{
label: '进路交人工控',
handler: this.humanControl,
cmdType: CMD.Signal.CMD_SIGNAL_CLOSE_AUTO_SETTING
},
{
label: '进路交ATS自动控',
handler: this.atsAutoControl,
cmdType: CMD.Signal.CMD_SIGNAL_OPEN_AUTO_SETTING
},
{
label: '查询进路控制模式',
handler: this.detail,
cmdType: CMD.Signal.CMD_SIGNAL_DETAIL
}
]
},
menuForce: [ menuForce: [
{ {
label: this.$t('menu.menuSignal.setFault'), label: this.$t('menu.menuSignal.setFault'),
@ -299,7 +259,12 @@ export default {
}, },
methods: { methods: {
initMenu() { initMenu() {
this.menu = MenuContextHandler.covert(this.menuNormal); this.menu = [];
this.menuNormal.forEach(menuItem => {
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected) : false;
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.word) : 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

@ -38,12 +38,50 @@ export default {
default() { default() {
return null; return null;
} }
},
work: {
type: String,
default() {
return '';
}
} }
}, },
data() { data() {
return { return {
menu: [], menu: [],
menuNormal: { menuNormal: [
{
label: this.$t('menu.menuStation.fullSiteSetInterlockAutoTrigger'),
handler: this.setAutoTrigger,
cmdType: CMD.Station.CMD_STATION_SET_CI_AUTO_TRIGGER,
isShow: (station, work) => work === 'localWork'
},
{
label: this.$t('menu.menuStation.fullSiteCancelInterlockAutoTrigger'),
handler: this.cancelAutoTrigger,
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER,
isShow: (station, work) => work === 'localWork'
},
{
label: '全站进路交人工控',
handler: this.humanControlALL,
cmdType: CMD.Station.CMD_STATION_CLOSE_AUTO_SETTING,
isShow: (station, work) => work === 'dispatchWork'
},
{
label: '全站进路ATS自排',
handler: this.atsAutoControlALL,
cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING,
isShow: (station, work) => work === 'dispatchWork'
},
{
label: this.$t('menu.menuStation.execKeyOperationTest'),
handler: this.execKeyOperationTest,
cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST,
isShow: (station, work) => work === 'dispatchWork'
}
],
menuNormal1: {
Local: [ Local: [
{ {
label: this.$t('menu.menuStation.fullSiteSetInterlockAutoTrigger'), label: this.$t('menu.menuStation.fullSiteSetInterlockAutoTrigger'),
@ -55,18 +93,6 @@ export default {
handler: this.cancelAutoTrigger, handler: this.cancelAutoTrigger,
cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER cmdType: CMD.Station.CMD_STATION_CANCEL_CI_AUTO_TRIGGER
} }
// {
// label: this.$t('menu.menuStation.powerUnLock'),
// handler: this.powerUnLock,
// auth: { station: true, center: false }
// // cmdType: CMD.Station.
// },
// {
// label: this.$t('menu.menuStation.execKeyOperationTest'),
// handler: this.execKeyOperationTest,
// auth: { station: true, center: false }
// // cmdType: CMD.Station.
// }
], ],
Center: [ Center: [
{ {
@ -84,13 +110,6 @@ export default {
handler: this.execKeyOperationTest, handler: this.execKeyOperationTest,
cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST cmdType: CMD.Station.CMD_STATION_KEY_OPERATION_TEST
} }
// {
// label: this.$t('menu.menuStation.execKeyOperationTest'),
// handler: this.execKeyOperationTest,
// auth: { station: false, center: true },
// cmdType: CMD.Station.CMD_STATION_OPEN_AUTO_SETTING
// // cmdType: CMD.Section.
// }
] ]
}, },
menuForce: [ menuForce: [

View File

@ -41,6 +41,12 @@ export default {
default() { default() {
return null; return null;
} }
},
work: {
type: String,
default() {
return '';
}
} }
}, },
data() { data() {