From de55f13b9f316dbfcea2ab5026ae626c42adbae3 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 8 Nov 2021 15:57:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E9=A5=B6=E6=B2=99=E7=9B=98=20?= =?UTF-8?q?=E5=88=97=E8=BD=A6=E6=93=8D=E4=BD=9C=20socket=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../menus/menuDialog/trainOperation.vue | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/jmapNew/theme/fuzhou_01/menus/menuDialog/trainOperation.vue b/src/jmapNew/theme/fuzhou_01/menus/menuDialog/trainOperation.vue index ddc0d7628..bd5181a56 100644 --- a/src/jmapNew/theme/fuzhou_01/menus/menuDialog/trainOperation.vue +++ b/src/jmapNew/theme/fuzhou_01/menus/menuDialog/trainOperation.vue @@ -13,6 +13,7 @@ :max="55" :marks="marks" show-stops + @input="inputSpeed" @change="changeSpeed" /> @@ -47,6 +48,7 @@ export default { leftTrainPic: LeftTrain, rightTrainPic: RightTrain, groupNumber: '', + changeSpeedFlag: false, right: true, train: null, marks: { @@ -70,17 +72,23 @@ export default { this.dialogVisible = false; }, doShow(val) { - if (this.dialogVisible && this.groupNumber === val.groupNumber) { return; } const train = this.$store.getters['map/getDeviceByCode'](val.groupNumber); this.groupNumber = train.groupNumber; this.train = train; - this.right = !!train.right; - this.speed = train.speed; + if (this.right != train.right) { + this.right = !!train.right; + } + if (this.speed != train.speed && !this.changeSpeedFlag) { + this.speed = train.speed; + } this.dialogVisible = true; }, + inputSpeed(val) { + this.changeSpeedFlag = true; + }, changeSpeed(val) { srTrainControl(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; }); + }).catch(err => { this.$message.error(err.message); this.speed = this.train.speed; }).finally(() => { this.changeSpeedFlag = false; }); }, adjustDirection(value) { srTrainControl(this.$route.query.group, { groupNumber: this.groupNumber, right: value === 'right', speed: this.speed }).then(resp => {