列车操作调整
This commit is contained in:
parent
8d2939197f
commit
8b2c00e7fa
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
title="列车操作"
|
||||
title="Train operation"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%"
|
||||
:modal="false"
|
||||
@ -20,7 +20,7 @@
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="3" :offset="2">
|
||||
<el-button size="mini" type="danger" style="margin-top: 15px;" @click="brakeTrain">刹车</el-button>
|
||||
<el-button size="mini" type="danger" style="margin-top: 15px;" @click="brakeTrain">brake</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 40px">
|
||||
@ -34,6 +34,9 @@
|
||||
<el-button :disabled="showRight" type="primary" size="mini" icon="el-icon-arrow-right" @click="adjustDirection" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="text-align: center;margin-top: 15px;">
|
||||
<el-button type="primary" size="mini" @click="handleRun">Run</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@ -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!');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user