From 32430607dd7ea065cffa4c1b41f9da3b08171247 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Sat, 14 Sep 2024 11:30:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=B6=88=E5=A4=B1=E9=97=AE=E9=A2=98=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trainingList/trainingPositionTip.vue | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/views/newMap/display/trainingList/trainingPositionTip.vue b/src/views/newMap/display/trainingList/trainingPositionTip.vue index 2887749a4..d72c919ad 100644 --- a/src/views/newMap/display/trainingList/trainingPositionTip.vue +++ b/src/views/newMap/display/trainingList/trainingPositionTip.vue @@ -22,7 +22,8 @@ export default { x: 0, y: 0 }, - tip: '' + tip: '', + timetamp: 0 }; }, computed: { @@ -47,7 +48,8 @@ export default { awaitOperateFlag = !document.getElementById(OperationEvent.StationControl.requestStationControl.awaitAlarm.domId); } if (val && this.trainingDetail && this.trainingDetail.type === 'SINGLE' && val.memberId == this.myMemberId && !awaitOperateFlag) { - this.tipInit(); + this.timetamp = new Date().getTime(); + this.tipInit(this.timetamp); } else { this.tip = ''; this.popShow = false; @@ -56,7 +58,8 @@ export default { }, '$store.state.trainingNew.voiceStepIndex': function(val) { if (val > -1 && this.trainingDetail && this.trainingDetail.type === 'SINGLE') { - this.tipInit(); + this.timetamp = new Date().getTime(); + this.tipInit(this.timetamp); } else { this.tip = ''; this.popShow = false; @@ -76,9 +79,11 @@ export default { this.position = { x: 0, y: 0 }; }, '$store.state.training.tipEvent': function (val) { + const timetamp = new Date().getTime(); + this.timetamp = timetamp; setTimeout(() => { if (this.tip) { - this.tipInit(); + this.tipInit(timetamp); } }, 10); }, @@ -87,13 +92,18 @@ export default { const stepInfo = this.$store.state.trainingNew.stepInfo; const domId = OperationEvent.StationControl.requestStationControl.awaitAlarm.operation; if (val && val.sourceMemberId == this.$store.state.training.myMemberId && stepInfo && stepInfo.tipPosition && stepInfo.tipPosition.domId === domId) { - setTimeout(() => { this.tipInit(); }, 10); + const timetamp = new Date().getTime(); + this.timetamp = timetamp; + setTimeout(() => { this.tipInit(timetamp); }, 10); } } } }, methods: { - async tipInit() { + async tipInit(timetamp) { + if (this.timetamp !== timetamp) { + return; + } if (this.teachMode === ScriptMode.TEACH) { this.tipShow = true; const offset = this.$store.state.config.canvasOffset; From f2efa437df5608edeea65c0810ce5ab650198d3b Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Sat, 14 Sep 2024 13:50:40 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=B6=88=E5=A4=B1?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E8=B0=83=E6=95=B42?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trainingList/trainingPositionTip.vue | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/views/newMap/display/trainingList/trainingPositionTip.vue b/src/views/newMap/display/trainingList/trainingPositionTip.vue index d72c919ad..8c678f8d1 100644 --- a/src/views/newMap/display/trainingList/trainingPositionTip.vue +++ b/src/views/newMap/display/trainingList/trainingPositionTip.vue @@ -101,9 +101,6 @@ export default { }, methods: { async tipInit(timetamp) { - if (this.timetamp !== timetamp) { - return; - } if (this.teachMode === ScriptMode.TEACH) { this.tipShow = true; const offset = this.$store.state.config.canvasOffset; @@ -123,28 +120,34 @@ export default { x: position.x + offset.x, y: position.y + offset.y - distance }; - this.popTipShow(); + this.popTipShow(timetamp); } } else if (stepInfo.tipPosition && stepInfo.tipPosition.domId) { const position = await this.getOtherTipPoint(stepInfo.tipPosition); if (position) { this.position = position; this.position.y -= distance; - this.popTipShow(); + this.popTipShow(timetamp); } else { - this.popTipHide(); + this.popTipHide(timetamp); } } else { - this.popTipHide(); + this.popTipHide(timetamp); } } else { this.tipShow = false; } }, - popTipShow() { + popTipShow(timetamp) { + if (this.timetamp !== timetamp) { + return; + } this.popShow = true; }, - popTipHide() { + popTipHide(timetamp) { + if (this.timetamp !== timetamp) { + return; + } this.popShow = false; }, // 获取地图设备提示位置