代码调整
This commit is contained in:
parent
812ef04cbd
commit
1b90935de6
@ -6,7 +6,7 @@
|
||||
<menu-switch ref="menuSwitch" :selected="selected" :work="'localWork'" />
|
||||
<menu-signal ref="menuSignal" :selected="selected" :work="'localWork'" />
|
||||
<menu-section ref="menuSection" :selected="selected" :work="'localWork'" />
|
||||
<menu-train ref="menuTrain" :selected="selected" />
|
||||
<menu-train ref="menuTrain" :selected="selected" :work="'localWork'" />
|
||||
<menu-station ref="menuStation" :selected="selected" :work="'localWork'" />
|
||||
<passive-alarm ref="passiveAlarm" />
|
||||
<passive-contorl ref="passiveControl" pop-class="fuzhou-01__systerm" />
|
||||
|
@ -174,7 +174,7 @@ export default {
|
||||
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;
|
||||
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
|
||||
this.menu.push(menuItem);
|
||||
});
|
||||
// 故障模式菜单列表
|
||||
|
@ -262,7 +262,7 @@ export default {
|
||||
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;
|
||||
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
|
||||
this.menu.push(menuItem);
|
||||
});
|
||||
// 故障模式菜单列表
|
||||
|
@ -19,7 +19,6 @@ import { mapGetters } from 'vuex';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFault';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
|
||||
export default {
|
||||
@ -157,8 +156,11 @@ export default {
|
||||
methods: {
|
||||
initMenu() {
|
||||
this.menu = [];
|
||||
// 编辑模式菜单列表
|
||||
this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||
this.menuNormal.forEach(menuItem => {
|
||||
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(this.selected) : false;
|
||||
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
|
||||
this.menu.push(menuItem);
|
||||
});
|
||||
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
|
@ -27,7 +27,6 @@ import Psl from '@/jmapNew/theme/components/menus/dialog/psl';
|
||||
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 '@/jmapNew/theme/components/utils/menuOperate';
|
||||
|
||||
export default {
|
||||
@ -50,22 +49,45 @@ export default {
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
work: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
Local: [
|
||||
menuNormal: [
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setDetainTrain'),
|
||||
handler: this.setDetainTrain,
|
||||
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
|
||||
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN,
|
||||
isDisabled: stand => stand.centerHoldTrain === 1,
|
||||
isShow: (station, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
|
||||
handler: this.cancelDetainTrain,
|
||||
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
|
||||
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN,
|
||||
isDisabled: stand => stand.centerHoldTrain !== 1,
|
||||
isShow: (station, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setDetainTrain'),
|
||||
handler: this.setDetainTrain,
|
||||
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN,
|
||||
isDisabled: stand => stand.stationHoldTrain === 1,
|
||||
isShow: (station, work) => work === 'localWork'
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
|
||||
handler: this.cancelDetainTrain,
|
||||
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN,
|
||||
isDisabled: stand => stand.stationHoldTrain !== 1,
|
||||
isShow: (station, work) => work === 'localWork'
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelDetainTrainForce'),
|
||||
@ -75,12 +97,39 @@ export default {
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.jumpStop'),
|
||||
handler: this.setJumpStop,
|
||||
cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP
|
||||
cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP,
|
||||
isDisabled: stand => stand.allSkip === 1
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelJumpStop'),
|
||||
handler: this.cancelJumpStop,
|
||||
cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
|
||||
cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP,
|
||||
isDisabled: stand => stand.allSkip !== 1 && stand.assignSkip !== 1
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setStopTime'),
|
||||
handler: this.setStopTime,
|
||||
cmdType:CMD.Stand.CMD_STAND_SET_PARK_TIME,
|
||||
isShow: (station, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setRunLevel'),
|
||||
handler: this.setRunLevel,
|
||||
cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME,
|
||||
isShow: (station, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setEarlyDeparture'),
|
||||
handler: this.earlyDeparture,
|
||||
cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART,
|
||||
isDisabled: stand => stand.trainParking !== 1,
|
||||
isShow: (station, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setBackStrategy'),
|
||||
handler: this.setBackStrategy,
|
||||
cmdType:CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY,
|
||||
isShow: (station, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.getStationStandStatus'),
|
||||
@ -88,59 +137,6 @@ export default {
|
||||
cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS
|
||||
}
|
||||
],
|
||||
Center: [
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setDetainTrain'),
|
||||
handler: this.setDetainTrain,
|
||||
cmdType:CMD.Stand.CMD_STAND_SET_HOLD_TRAIN
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelDetainTrain'),
|
||||
handler: this.cancelDetainTrain,
|
||||
cmdType:CMD.Stand.CMD_STAND_CANCEL_HOLD_TRAIN
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelDetainTrainAll'),
|
||||
handler: this.cancelDetainTrainAll,
|
||||
cmdType:CMD.Stand.CMD_STAND_WHOLE_LINE_CANCEL_HOLD_TRAIN
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.jumpStop'),
|
||||
handler: this.setJumpStop,
|
||||
cmdType:CMD.Stand.CMD_STAND_SET_JUMP_STOP
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.cancelJumpStop'),
|
||||
handler: this.cancelJumpStop,
|
||||
cmdType:CMD.Stand.CMD_STAND_CANCEL_JUMP_STOP
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setStopTime'),
|
||||
handler: this.setStopTime,
|
||||
cmdType:CMD.Stand.CMD_STAND_SET_PARK_TIME
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setRunLevel'),
|
||||
handler: this.setRunLevel,
|
||||
cmdType:CMD.Stand.CMD_STAND_SET_RUN_TIME
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setEarlyDeparture'),
|
||||
handler: this.earlyDeparture,
|
||||
cmdType:CMD.Stand.CMD_STAND_EARLY_DEPART
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setBackStrategy'),
|
||||
handler: this.setBackStrategy,
|
||||
cmdType:CMD.Stand.CMD_STAND_SET_REENTRY_STRATEGY
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.getStationStandStatus'),
|
||||
handler: this.detail,
|
||||
cmdType:CMD.Stand.CMD_STAND_VIEW_STATUS
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: this.$t('menu.menuStationStand.setFault'),
|
||||
@ -191,8 +187,12 @@ export default {
|
||||
methods: {
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||
// this.menu = MenuContextHandler.menuFiltration(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.work) : true;
|
||||
this.menu.push(menuItem);
|
||||
});
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce];
|
||||
}
|
||||
@ -202,7 +202,7 @@ export default {
|
||||
this.menu = this.menuForce;
|
||||
}
|
||||
// 非故障模式 且 角色为车站值班员时 增加PSL盘
|
||||
if (this.operatemode !== OperateMode.FAULT && this.$store.state.training.prdType === '01') {
|
||||
if (this.operatemode !== OperateMode.FAULT && this.work === 'localWork') {
|
||||
this.menu = [
|
||||
...this.menu,
|
||||
{
|
||||
@ -211,8 +211,6 @@ export default {
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
// this.menu = MenuContextHandler.covert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.initMenu();
|
||||
|
@ -155,7 +155,7 @@ export default {
|
||||
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;
|
||||
menuItem.show = menuItem.isShow ? menuItem.isShow(this.selected, this.work) : true;
|
||||
this.menu.push(menuItem);
|
||||
});
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
|
@ -26,7 +26,6 @@ import TrainDelete from './dialog/trainDelete';
|
||||
import TrainMove from './dialog/trainMove';
|
||||
import TrainSwitch from './dialog/trainSwitch';
|
||||
import TrainEditNumber from './dialog/trainEditNumber';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import SpeedLimit from '@/jmapNew/theme/components/menus/dialog/trainSpeedLimit';
|
||||
import { menuOperate, commitOperate, commitTrainSend } from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import TrainOperation from './menuDialog/trainOperation';
|
||||
@ -53,46 +52,37 @@ export default {
|
||||
default() {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
work: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
Local: [],
|
||||
Center: [
|
||||
menuNormal: [
|
||||
{
|
||||
label: this.$t('menu.menuTrain.addTrainId'),
|
||||
handler: this.addTrainId,
|
||||
cmdType: CMD.TrainWindow.CMD_TRAIN_ADD_TRAIN_TRACE
|
||||
cmdType: CMD.TrainWindow.CMD_TRAIN_ADD_TRAIN_TRACE,
|
||||
isShow: (train, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuTrain.deleteTrainId'),
|
||||
handler: this.delTrainId,
|
||||
cmdType: CMD.TrainWindow.CMD_TRAIN_REMOVE_TRAIN_TRACE
|
||||
cmdType: CMD.TrainWindow.CMD_TRAIN_REMOVE_TRAIN_TRACE,
|
||||
isShow: (train, work) => work === 'dispatchWork'
|
||||
},
|
||||
{
|
||||
label: this.$t('menu.menuTrain.editTrainId'),
|
||||
handler: this.editTrainId,
|
||||
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
|
||||
cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE,
|
||||
isShow: (train, work) => work === 'dispatchWork'
|
||||
}
|
||||
// {
|
||||
// label: this.$t('menu.menuTrain.editTrainNo'),
|
||||
// handler: this.undeveloped,
|
||||
// cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
|
||||
// },
|
||||
// {
|
||||
// label: this.$t('menu.menuTrain.moveTrainId'),
|
||||
// handler: this.undeveloped,
|
||||
// cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
|
||||
// },
|
||||
// {
|
||||
// label: this.$t('menu.menuTrain.switchTrainId'),
|
||||
// handler: this.undeveloped,
|
||||
// cmdType: CMD.TrainWindow.CMD_TRAIN_UPDATE_TYPE
|
||||
// }
|
||||
]
|
||||
},
|
||||
],
|
||||
menuForce: [
|
||||
{
|
||||
label: '设置故障',
|
||||
@ -108,26 +98,10 @@ export default {
|
||||
}
|
||||
],
|
||||
menuDirective: [
|
||||
// {
|
||||
// label: '确认运行至前方站',
|
||||
// handler: this.nextStation
|
||||
// },
|
||||
// {
|
||||
// label: '越引导信号行驶',
|
||||
// handler: this.handleOverFuideSignal
|
||||
// },
|
||||
// {
|
||||
// label: '越红灯行驶',
|
||||
// handler: this.handleOverEedLight
|
||||
// },
|
||||
{
|
||||
label: '开关门',
|
||||
handler: this.handleOpenOrCloseDoor
|
||||
},
|
||||
// {
|
||||
// label: '限速指令',
|
||||
// handler: this.handleSpeedLimit
|
||||
// },
|
||||
{
|
||||
label: '换端',
|
||||
handler: this.handleTurnDirection
|
||||
@ -217,8 +191,12 @@ export default {
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
// this.menu = MenuContextHandler.menuFiltration(this.menuNormal);
|
||||
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.work) : true;
|
||||
this.menu.push(menuItem);
|
||||
});
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed];
|
||||
}
|
||||
@ -239,7 +217,6 @@ export default {
|
||||
},
|
||||
doShow(point) {
|
||||
this.initMenu();
|
||||
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user