From 1da6506bf58270bacc2a4345002c6b082835580e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 21 十月 2021 23:17:08 +0800
Subject: [PATCH] 2021-10-21

---
 src/tabviews/custom/components/chart/antv-dashboard/index.jsx |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx
index af8a9bf..5f64a9e 100644
--- a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx
+++ b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx
@@ -177,7 +177,7 @@
 
     if (!config.timer) return
 
-    const _change = { '15s': 15000, '30s': 30000, '1min': 60000, '5min': 300000, '10min': 600000, '15min': 900000, '30min': 1800000, '1hour': 3600000 }
+    const _change = { '5s': 5000, '15s': 15000, '30s': 30000, '1min': 60000, '5min': 300000, '10min': 600000, '15min': 900000, '30min': 1800000, '1hour': 3600000 }
 
     let timer = _change[config.timer]
 
@@ -289,11 +289,17 @@
           data.value = result.data[0][config.plot.valueField]
         }
       }
+      let reset = true
+
+      if (hastimer && is(fromJS(data), fromJS(this.state.data))) {
+        reset = false
+      }
 
       this.setState({
         data,
         loading: false
       }, () => {
+        if (!reset) return
         this.handleData()
       })
     } else {

--
Gitblit v1.8.0