From 26d0fa42ea8c63a87e8ef93d0915f75f46fb1f9c Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 24 三月 2022 11:09:53 +0800
Subject: [PATCH] 2022-03-24

---
 src/tabviews/custom/components/chart/custom-chart/index.jsx |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/tabviews/custom/components/chart/custom-chart/index.jsx b/src/tabviews/custom/components/chart/custom-chart/index.jsx
index d72aae8..f84f163 100644
--- a/src/tabviews/custom/components/chart/custom-chart/index.jsx
+++ b/src/tabviews/custom/components/chart/custom-chart/index.jsx
@@ -61,7 +61,9 @@
       search: Utils.initMainSearch(config.search)
     }, () => {
       if (config.setting.sync !== 'true' && config.setting.onload === 'true') {
-        this.loadData()
+        setTimeout(() => {
+          this.loadData()
+        }, _config.setting.delay || 0)
       } else if (config.setting.sync === 'true' && _data) {
         this.handleData()
       }
@@ -203,7 +205,7 @@
     const { config } = this.state
 
     if (!config.setting.supModule || config.setting.supModule !== MenuID) return
-    if (id !== this.state.BID) {
+    if (id !== this.state.BID || id !== '') {
       this.setState({ BID: id }, () => {
         this.loadData()
       })
@@ -279,11 +281,18 @@
 
     let result = await Api.genericInterface(param)
     if (result.status) {
+      let reset = true
+
+      if (hastimer && is(fromJS(result.data), fromJS(this.state.data))) {
+        reset = false
+      }
+
       this.setState({
         data: result.data,
         loading: false,
         empty: result.data.length === 0
       }, () => {
+        if (!reset) return
         this.handleData()
       })
     } else {

--
Gitblit v1.8.0