From 458a16314b4ffee596490ba5c44878570287b21b Mon Sep 17 00:00:00 2001
From: luohairen <3399054449@qq.com>
Date: 星期四, 14 十一月 2024 10:34:54 +0800
Subject: [PATCH] 班级成绩图表分析

---
 src/views/exam/exam/ExamManage.vue |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/src/views/exam/exam/ExamManage.vue b/src/views/exam/exam/ExamManage.vue
index 83b70f0..d2f1ae2 100644
--- a/src/views/exam/exam/ExamManage.vue
+++ b/src/views/exam/exam/ExamManage.vue
@@ -115,7 +115,7 @@
           </el-popconfirm>
 
           <el-button
-            v-if="scope.row.status === 'finished'"
+            v-if="scope.row.status !== 'not_start'"
             type="success"
             size="small"
             @click="markPaper(scope.row)"
@@ -264,7 +264,7 @@
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="closeHandler">鍙� 娑�</el-button>
-        <el-button type="primary" @click="addOrEditExam">纭� 瀹�</el-button>
+        <el-button type="primary" @click="handleDebouncedClick">纭� 瀹�</el-button>
       </div>
     </el-dialog>
   </div>
@@ -302,6 +302,8 @@
         endTime: null,
         time: []
       },
+      // 澹版槑涓�涓畾鏃跺櫒
+      debounceTimeout: null,
       selectExamPaper: {},
       examRules: {
         examName: [
@@ -339,6 +341,7 @@
     this.page()
     this.getMyClasses()
     this.MyExamPaperList()
+    this.handleDebouncedClick = this.debounce(this.addOrEditExam, 500); // 500ms鐨勯槻鎶栨椂闂�
   },
   methods: {
     // 浣滃簾鑰冭瘯
@@ -477,7 +480,20 @@
     },
     handleExamPaperSelect (e) {
       this.selectExamPaper = this.examPaperList.find((o) => o.id === e)
-    }
+    },
+    // 闃叉姈鍑芥暟
+    debounce(func, wait) {
+      return (...args) => {
+        if (this.debounceTimeout) {
+          clearTimeout(this.debounceTimeout);
+        }
+        this.debounceTimeout = setTimeout(() => {
+          func.apply(this, args);
+        }, wait);
+      };
+    },
+    // 闃叉姈澶勭悊鐨勭偣鍑讳簨浠�
+    handleDebouncedClick: null,
   }
 }
 </script>

--
Gitblit v1.8.0