diff --git a/src/jmapNew/theme/components/menus/dialog/trainOperation.vue b/src/jmapNew/theme/components/menus/dialog/trainOperation.vue index a9519773e..317e3ce5e 100644 --- a/src/jmapNew/theme/components/menus/dialog/trainOperation.vue +++ b/src/jmapNew/theme/components/menus/dialog/trainOperation.vue @@ -25,13 +25,13 @@ - + - + @@ -70,6 +70,9 @@ export default { }; }, computed: { + showRight() { + return (this.right && !this.reversal) || (!this.right && this.reversal); + }, trainPic() { if ((this.right && this.reversal) || (!this.right && !this.reversal)) { return this.leftTrainPic; @@ -107,9 +110,9 @@ export default { sandTableTrainControl(this.$route.query.group, { groupNumber: this.groupNumber, right: this.right, speed: this.speed }).then(resp => { }).catch(err => { this.$message.error(err.message); this.speed = this.train.speed; }).finally(() => { this.changeSpeedFlag = false; }); }, - adjustDirection(value) { - sandTableTrainControl(this.$route.query.group, { groupNumber: this.groupNumber, right: value === 'right', speed: this.speed }).then(resp => { - this.right = value === 'right'; + adjustDirection() { + sandTableTrainControl(this.$route.query.group, { groupNumber: this.groupNumber, right: !this.right, speed: this.speed }).then(resp => { + this.right = !this.right; }).catch(err => { this.$message.error(err.message); }); }, brakeTrain() {