From 639fad34874ff57f1de713a44bf2e796ea35f734 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 28 七月 2022 14:41:58 +0800
Subject: [PATCH] 2022-07-28

---
 src/tabviews/custom/components/chart/antv-scatter/index.jsx |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/tabviews/custom/components/chart/antv-scatter/index.jsx b/src/tabviews/custom/components/chart/antv-scatter/index.jsx
index a56089e..bad1040 100644
--- a/src/tabviews/custom/components/chart/antv-scatter/index.jsx
+++ b/src/tabviews/custom/components/chart/antv-scatter/index.jsx
@@ -153,22 +153,30 @@
         })
         return
       } else if (result.run_type) {
-        this.setState({timer})
+        let repeats = config.timerRepeats || 0
+        this.setState({timer, repeats})
         this.timer = setTimeout(() => {
-          this.timerTask()
+          this.timerTask(repeats)
         }, timer)
       }
     })
   }
 
-  timerTask = () => {
-    const { timer } = this.state
+  timerTask = (times) => {
+    const { timer, repeats } = this.state
     if (!timer) return
     
     this.loadData(true)
-    
+
+    if (repeats) {
+      times = times - 1
+      if (times <= 0) {
+        clearTimeout(this.timer)
+        return
+      }
+    }
     this.timer = setTimeout(() => {
-      this.timerTask()
+      this.timerTask(times)
     }, timer)
   }
 

--
Gitblit v1.8.0