From 750d5b6ad112fe483fe4f922764c7e6fddde0554 Mon Sep 17 00:00:00 2001 From: aBin Date: Sat, 9 Oct 2021 14:45:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=87=E7=A4=BA=E7=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Panel/Panel.vue | 37 +++++++++++++++++++++++++++++++--- src/mixins/socket.js | 19 +++++++++++------ src/views/Index/Index.vue | 5 +---- src/views/RfidGauge/index.vue | 2 +- 4 files changed, 49 insertions(+), 14 deletions(-) diff --git a/src/components/Panel/Panel.vue b/src/components/Panel/Panel.vue index 46f133a..463cf05 100644 --- a/src/components/Panel/Panel.vue +++ b/src/components/Panel/Panel.vue @@ -21,7 +21,7 @@ {{ maintenanceDose }} -
+
{{ info }} @@ -32,6 +32,7 @@
{{ item }}
+
@@ -54,15 +55,18 @@ export default { }, lists: ['呼叫', '分诊', '一线', '采血', '心电', 'CT', '二线', '谈话', '签字', '团注', '介入', '置鞘', '病房'], info: '呼叫', + cirAni: false, + cirTimer: null, }; }, computed: mapState('messages', ['weightMessage', 'bolusDose', 'maintenanceDose', 'thrombolyticDose', 'startMessages', 'rfidMessage']), watch: { rfidMessage(val) { - if (this.startMessages || val.step === '0') { + if (this.startMessages || val.step === '0' || val.type - 0 === 0) { this.percent = 0; this.percentA = 0; this.info = '呼叫'; + this.startCirAni(); this.setStartMessages(false); } else { if ((val.step || val.step === '0') && val.step - 0 >= (this.percent * 12) / 100 && val.step - 0 <= 12) { @@ -79,11 +83,27 @@ export default { this.percent = 0; this.percentA = 0; this.info = '呼叫'; + this.startCirAni(val); this.setStartMessages(false); } }, }, - methods: { ...mapMutations('messages', ['setStartMessages']) }, + methods: { + ...mapMutations('messages', ['setStartMessages']), + startCirAni(val) { + console.log('val: ', val); + if (!this.cirTimer) { + const that = this; + this.cirTimer = setInterval(() => { + that.cirAni = !that.cirAni; + }, 500); + setTimeout(() => { + clearInterval(that.cirTimer); + that.cirTimer = null; + }, 3100); + } + }, + }, // mounted() { // const that = this; // var add = setInterval(function() { @@ -100,6 +120,17 @@ export default {