From c6d3157eb616116c84d35e221ed9c57ef8da0ad6 Mon Sep 17 00:00:00 2001
From: long <515897141@qq.com>
Date: 星期四, 01 二月 2024 16:24:11 +0800
Subject: [PATCH] 操作频繁锁(60秒)

---
 src/pages/room/detail.vue |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/src/pages/room/detail.vue b/src/pages/room/detail.vue
index 48d65b0..b385645 100644
--- a/src/pages/room/detail.vue
+++ b/src/pages/room/detail.vue
@@ -156,8 +156,14 @@
       timeObj: {}, // week锛氭槦鏈燂紝date锛氬勾鏈堟棩锛宼imeMin锛氭椂鍒嗭紝time锛氭椂鍒嗙锛宼imeStamp锛氭椂闂存埑
       curTreatId: '',
       curTreatIds: '', // 宸查�変腑鐨勬不鐤楄褰昳d鏁扮粍
-      offNarcosisIds: [] // 鏄惁宸查�氱煡鍗搁夯鐨勭敤鎴穒d鏁扮粍
+      offNarcosisIds: [], // 鏄惁宸查�氱煡鍗搁夯鐨勭敤鎴穒d鏁扮粍
       // isShowAppellationName: true // 鏄惁鏄剧ず绉拌皳
+
+      // 60绉掑垏鎹㈢姸鎬侀攣 鈫撯啌鈫撯啌鈫撯啌鈫撯啌鈫撯啌
+      setStatusLock: false, // 鏇存柊鐘舵�侀攣
+      setStatusLockDuration: 60000, // 鏇存柊鐘舵�侀攣鏃堕棿
+      setStatusLockTimer: null
+      // 60绉掑垏鎹㈢姸鎬侀攣 鈫戔啈鈫戔啈鈫戔啈鈫戔啈鈫戔啈
     }
   },
   computed: {
@@ -530,6 +536,14 @@
     },
     // 鏀瑰彉鎴块棿鐘舵�佸紓姝ユ柟娉�
     changeStatusFn(item = {}, status, cb) {
+      // 鏈В閿� 20240201 long
+      if (this.setStatusLock) {
+        return this.$messageWarn('鎿嶄綔棰戠箒锛岃绋嶅悗鍐嶈瘯')
+      }
+      this.setStatusLock = true
+      clearInterval(this.setStatusLockTimer)
+      this.setStatusLockTimer = null
+
       var params = {}
       // 鎴块棿id
       if (this.id) {
@@ -612,6 +626,15 @@
         }
         // console.log('8888888888888888888888888888888888', res)
         cb && cb()
+
+        // 30s鍚庤В閿� 20240201 long
+        this.setStatusLockTimer = setInterval(() => {
+          this.setStatusLock = false
+        }, this.setStatusLockDuration)
+      }, () => {
+        setTimeout(() => {
+          this.setStatusLock = false
+        }, 1000)
       })
     },
     // 閲嶇疆鐘舵��

--
Gitblit v1.8.0