Merge remote-tracking branch 'origin/test' into thailand

This commit is contained in:
fan 2023-06-02 17:33:18 +08:00
commit 9648f95d4e

View File

@ -25,13 +25,13 @@
</el-row>
<el-row style="margin-top: 40px">
<el-col :span="3" :offset="7" style="text-align: right;">
<el-button :type="right?'':'primary'" size="mini" icon="el-icon-arrow-left" @click="adjustDirection('left')" />
<el-button :disabled="!showRight" type="primary" size="mini" icon="el-icon-arrow-left" @click="adjustDirection" />
</el-col>
<el-col :span="3" style="text-align: center;">
<img style="width: 50px" :src="trainPic">
</el-col>
<el-col :span="3">
<el-button :type="right?'primary':''" size="mini" icon="el-icon-arrow-right" @click="adjustDirection('right')" />
<el-button :disabled="showRight" type="primary" size="mini" icon="el-icon-arrow-right" @click="adjustDirection" />
</el-col>
</el-row>
</el-dialog>
@ -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() {