diff --git a/src/jmapNew/theme/haerbin_01/menus/dialog/trainInitPlan.vue b/src/jmapNew/theme/haerbin_01/menus/dialog/trainInitPlan.vue new file mode 100644 index 000000000..7ebd9a6ba --- /dev/null +++ b/src/jmapNew/theme/haerbin_01/menus/dialog/trainInitPlan.vue @@ -0,0 +1,226 @@ + + + + diff --git a/src/jmapNew/theme/haerbin_01/menus/menuTrain.vue b/src/jmapNew/theme/haerbin_01/menus/menuTrain.vue index 7f215a543..056684c28 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuTrain.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuTrain.vue @@ -7,6 +7,7 @@ + @@ -22,6 +23,7 @@ import TrainDelete from './dialog/trainDelete'; import TrainMove from './dialog/trainMove'; import TrainSwitch from './dialog/trainSwitch'; import TrainEditNumber from './dialog/trainEditNumber'; +import TrainInitPlan from './dialog/trainInitPlan'; import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler'; export default { @@ -33,7 +35,8 @@ export default { TrainDelete, TrainMove, TrainSwitch, - TrainEditNumber + TrainEditNumber, + TrainInitPlan }, props: { selected: { @@ -47,44 +50,19 @@ export default { return { menu: [], menuNormal: { - Local: [], + Local: [ + { + label: '新建计划列车', + handler: this.createPlanTrain, + cmdType: CMD.TrainWindow.CMD_Train_Init_Plan + } + ], Center: [ - // { - // label: this.$t('menu.menuTrain.addTrainId'), - // handler: this.addTrainId, - // auth: { station: true, center: true }, - // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT - // }, - // { - // label: this.$t('menu.menuTrain.deleteTrainId'), - // handler: this.delTrainId, - // auth: { station: true, center: true }, - // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT - // }, - // { - // label: this.$t('menu.menuTrain.editTrainId'), - // handler: this.editTrainId, - // auth: { station: true, center: true }, - // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT - // }, - // { - // label: this.$t('menu.menuTrain.editTrainNo'), - // handler: this.editTrainNo, - // auth: { station: true, center: true }, - // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT - // }, - // { - // label: this.$t('menu.menuTrain.moveTrainId'), - // handler: this.moveTrainId, - // auth: { station: true, center: true }, - // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT - // }, - // { - // label: this.$t('menu.menuTrain.switchTrainId'), - // handler: this.switchTrainId, - // auth: { station: true, center: true }, - // cmdType:CMD.Train.CMD_SWITCH_REMOVE_FAULT - // } + { + label: '新建计划列车', + handler: this.createPlanTrain, + cmdType: CMD.TrainWindow.CMD_Train_Init_Plan + } ] }, menuForce: [ @@ -162,6 +140,23 @@ export default { // this.$store.dispatch('map/setTrainWindowShow', false); } }, + createPlanTrain() { + const step = { + start: true, + code: this.selected.code, + operation: OperationEvent.Train.createPlanTrain.menu.operation, + param: { + trainWindowCode: this.selected.code + } + }; + + this.$store.dispatch('training/nextNew', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + this.$refs.trainInitPlan.doShow(step, this.selected); + } + }); + }, // 设置故障 setStoppage() { const step = {