增加车次窗右键操作
This commit is contained in:
parent
c4b37c1519
commit
d22f2582c3
@ -19,9 +19,6 @@
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, trainMenuFiltration } from './utils/menuItemStatus';
|
||||
import TrainDelete from './dialog/trainDelete';
|
||||
import TrainDefine from './dialog/trainDefine';
|
||||
@ -35,6 +32,12 @@ import TrainSetHead from './dialog/trainSetHead';
|
||||
import TrainSetWork from './dialog/trainSetWork';
|
||||
import TrainFlag from './dialog/trainFlag';
|
||||
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
|
||||
export default {
|
||||
name: 'MenuTrain',
|
||||
components: {
|
||||
@ -64,197 +67,163 @@ export default {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [
|
||||
Local: [
|
||||
// {
|
||||
// label: '定义车组号',
|
||||
// handler: this.addTrainId,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// label: '删除车组号',
|
||||
// handler: this.delTrainId,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// label: '修改车组号',
|
||||
// handler: this.editTrainId,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// label: '移动车组号',
|
||||
// handler: this.moveTrainId,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
// {
|
||||
// label: '设置计划车',
|
||||
// handler: this.setPlanTrain,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// label: '设置头码车',
|
||||
// handler: this.setHeadTrain,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// label: '设置人工车',
|
||||
// handler: this.setWorkTrain,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
{
|
||||
label: '定义车组号',
|
||||
handler: this.addTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.addTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '删除车组号',
|
||||
handler: this.delTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.delTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '修改车组号',
|
||||
handler: this.editTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.editTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '移动车组号',
|
||||
handler: this.moveTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '设置计划车',
|
||||
handler: this.setPlanTrain,
|
||||
disabledCallback: MenuDisabledState.Train.setPlanTrain,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设置头码车',
|
||||
handler: this.setHeadTrain,
|
||||
disabledCallback: MenuDisabledState.Train.setHeadTrain,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设置人工车',
|
||||
handler: this.setWorkTrain,
|
||||
disabledCallback: MenuDisabledState.Train.setWorkTrain,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '添加计划车',
|
||||
// handler: this.undeveloped,
|
||||
label: '新建计划车',
|
||||
handler: this.addPlanTrain,
|
||||
// disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.addPlanTrain,
|
||||
auth: { station: true, center: true }
|
||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
|
||||
},
|
||||
{
|
||||
label: '删除计划车',
|
||||
// handler: this.undeveloped,
|
||||
handler: this.deletePlanTrain,
|
||||
disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '平移计划车',
|
||||
// handler: this.undeveloped,
|
||||
handler: this.moveEventlyTrain,
|
||||
disabledCallback: MenuDisabledState.Train.moveEventlyTrain,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '标记重点列车',
|
||||
handler: this.trainToFlag,
|
||||
disabledCallback: MenuDisabledState.Train.trainToFlag,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '取消标记重点列车',
|
||||
handler: this.trainUnFlag,
|
||||
disabledCallback: MenuDisabledState.Train.trainUnFlag,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '列车信息',
|
||||
handler: this.undeveloped,
|
||||
disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||
auth: { station: true, center: true }
|
||||
}
|
||||
// {
|
||||
// label: '删除计划车',
|
||||
// handler: this.deletePlanTrain,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// label: '平移计划车',
|
||||
// handler: this.moveEventlyTrain,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
// {
|
||||
// label: '标记重点列车',
|
||||
// handler: this.trainToFlag,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// label: '取消标记重点列车',
|
||||
// handler: this.trainUnFlag,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
// {
|
||||
// label: '列车信息',
|
||||
// handler: this.undeveloped,
|
||||
// cmdType: ''
|
||||
// }
|
||||
],
|
||||
central: [
|
||||
Center: [
|
||||
// {
|
||||
// label: '定义车组号',
|
||||
// handler: this.addTrainId,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// label: '删除车组号',
|
||||
// handler: this.delTrainId,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// label: '修改车组号',
|
||||
// handler: this.editTrainId,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// label: '移动车组号',
|
||||
// handler: this.moveTrainId,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
// {
|
||||
// label: '设置计划车',
|
||||
// handler: this.setPlanTrain,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// label: '设置头码车',
|
||||
// handler: this.setHeadTrain,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// label: '设置人工车',
|
||||
// handler: this.setWorkTrain,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
{
|
||||
label: '定义车组号',
|
||||
handler: this.addTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.addTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '删除车组号',
|
||||
handler: this.delTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.delTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '修改车组号',
|
||||
handler: this.editTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.editTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '移动车组号',
|
||||
handler: this.moveTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '设置计划车',
|
||||
handler: this.setPlanTrain,
|
||||
disabledCallback: MenuDisabledState.Train.setPlanTrain,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设置头码车',
|
||||
handler: this.setHeadTrain,
|
||||
disabledCallback: MenuDisabledState.Train.setHeadTrain,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设置人工车',
|
||||
handler: this.setWorkTrain,
|
||||
disabledCallback: MenuDisabledState.Train.setWorkTrain,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '添加计划车',
|
||||
// handler: this.undeveloped,
|
||||
label: '新建计划车',
|
||||
handler: this.addPlanTrain,
|
||||
// disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||
disabledCallback: MenuDisabledState.Train.addPlanTrain,
|
||||
auth: { station: true, center: true }
|
||||
cmdType: CMD.TrainWindow.CMD_Train_Init_Plan
|
||||
},
|
||||
{
|
||||
label: '删除计划车',
|
||||
// handler: this.undeveloped,
|
||||
handler: this.deletePlanTrain,
|
||||
disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '平移计划车',
|
||||
// handler: this.undeveloped,
|
||||
handler: this.moveEventlyTrain,
|
||||
disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '标记重点列车',
|
||||
handler: this.trainToFlag,
|
||||
disabledCallback: MenuDisabledState.Train.trainToFlag,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '取消标记重点列车',
|
||||
handler: this.trainUnFlag,
|
||||
disabledCallback: MenuDisabledState.Train.trainUnFlag,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: '列车信息',
|
||||
handler: this.undeveloped,
|
||||
disabledCallback: MenuDisabledState.Train.moveTrainId,
|
||||
auth: { station: true, center: true }
|
||||
}
|
||||
// {
|
||||
// label: '删除计划车',
|
||||
// handler: this.deletePlanTrain,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// label: '平移计划车',
|
||||
// handler: this.moveEventlyTrain,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
// {
|
||||
// label: '标记重点列车',
|
||||
// handler: this.trainToFlag,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// label: '取消标记重点列车',
|
||||
// handler: this.trainUnFlag,
|
||||
// cmdType: ''
|
||||
// },
|
||||
// {
|
||||
// type: 'separator'
|
||||
// },
|
||||
// {
|
||||
// label: '列车信息',
|
||||
// handler: this.undeveloped,
|
||||
// cmdType: ''
|
||||
// }
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
@ -305,17 +274,12 @@ export default {
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = trainMenuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce, ...this.menuSpeed];
|
||||
}
|
||||
|
||||
this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||
console.log(this.menu);
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = [...this.menuForce, ...this.menuSpeed];
|
||||
this.menu = this.menuForce;
|
||||
}
|
||||
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
@ -485,17 +449,19 @@ export default {
|
||||
},
|
||||
// 添加计划车
|
||||
addPlanTrain() {
|
||||
const operate = {
|
||||
const step = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.Train.type,
|
||||
label: MapDeviceType.Train.label,
|
||||
operation: OperationEvent.Train.addPlanTrainId.menu.operation
|
||||
operation: OperationEvent.Train.createPlanTrain.menu.operation,
|
||||
param: {
|
||||
trainWindowCode: this.selected.code
|
||||
}
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
|
||||
this.$store.dispatch('training/nextNew', step).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.trainAddPlan.doShow(operate, this.selected);
|
||||
this.$refs.trainAddPlan.doShow(step, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -19,6 +19,8 @@ class MenuContextHandler {
|
||||
control = store.getters['map/getDeviceStationCodeByStationCode'](selected.deviceStationCode);
|
||||
} else if (selected._type == 'Station') {
|
||||
control = store.getters['map/getDeviceStationCodeByStationCode'](selected.code);
|
||||
} else if (selected._type == 'Train') { // 车次窗单独处理
|
||||
control = store.getters['map/getDeviceTrainWindowCodeByStationCode'](selected.code);
|
||||
} else {
|
||||
control = store.getters['map/getDeviceStationCodeByStationCode'](selected.stationCode);
|
||||
}
|
||||
@ -88,7 +90,7 @@ class MenuContextHandler {
|
||||
let menu = [];
|
||||
const control = this.getStationControl(selected);
|
||||
if (control) {
|
||||
if ( this.getPrdType() != '') {
|
||||
if (this.getPrdType() != '') {
|
||||
const type = State2SimulationMap[this.getPrdType()];
|
||||
const status = State2ControlMap[control.controlMode];
|
||||
menu = [...menuList[type]];
|
||||
|
@ -456,6 +456,28 @@ const map = {
|
||||
});
|
||||
}
|
||||
|
||||
return device;
|
||||
},
|
||||
|
||||
// 通过循环区段来获取控制模式
|
||||
getDeviceTrainWindowCodeByStationCode: (state) => (code) => {
|
||||
let device = null;
|
||||
if (code &&
|
||||
state.map &&
|
||||
state.map.sectionList && state.map.sectionList.length) {
|
||||
state.map.sectionList.forEach(elem => {
|
||||
if (elem.trainWindowCode == code) {
|
||||
if (state.map.stationList && state.map.stationList.length) {
|
||||
state.map.stationList.forEach(elems => {
|
||||
if (elems.code == elem.stationCode) {
|
||||
device = state.mapDevice[elems.code];
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return device;
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user