diff --git a/src/jmapNew/theme/components/menus/dialog/trainOperation.vue b/src/jmapNew/theme/components/menus/dialog/trainOperation.vue index 317e3ce5e..5addb257a 100644 --- a/src/jmapNew/theme/components/menus/dialog/trainOperation.vue +++ b/src/jmapNew/theme/components/menus/dialog/trainOperation.vue @@ -1,7 +1,7 @@ @@ -41,6 +44,7 @@ import LeftTrain from '@/assets/left_train.png'; import RightTrain from '@/assets/right_train.png'; import { sandTableTrainControl } from '@/api/simulation'; +import { menuOperate } from '@/jmapNew/theme/components/utils/menuOperate'; export default { name: 'TrainOperation', data() { @@ -119,6 +123,30 @@ export default { sandTableTrainControl(this.$route.query.group, { groupNumber: this.groupNumber, right: this.right, speed: 0 }).then(resp => { this.speed = 0; }).catch(err => { this.$message.error(err.message); }); + }, + handleRun() { + const step = { + over: true, + operation: menuOperate.Common.trainDrive.operation, + cmdType: menuOperate.Common.trainDrive.cmdType, + param: { + groupNumber: this.groupNumber, + param: { + speedLimit: '', + through: 0, + targetDeviceCode: '' + } + } + }; + this.$store.dispatch('trainingNew/next', step).then(({ valid }) => { + if (valid) { + this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); + } else { + this.$messageBox('Failed to set or cancel the fault!'); + } + }).catch((error) => { + this.$messageBox(error.message || 'Failed to set or cancel the fault!'); + }); } } };