From ee50d5424a093209d1c5c549f4578107893b22f8 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 05 十一月 2020 18:40:54 +0800
Subject: [PATCH] 2020-11-05

---
 src/tabviews/custom/components/chart/antv-bar-line/index.jsx |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx
index 3ddb731..d16b55b 100644
--- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx
+++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -125,7 +125,7 @@
       search: Utils.initMainSearch(config.search),
       showHeader
     }, () => {
-      if (config.setting.sync !== 'true') {
+      if (config.setting.sync !== 'true' && config.setting.onload === 'true') {
         this.loadData()
       } else if (config.setting.sync === 'true') {
         if (!_data) {
@@ -161,6 +161,12 @@
       this.setState({sync: false, loading: false, data: _data}, () => {
         this.handleData()
       })
+    } else if (!is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
+      if (config.setting.syncRefresh === 'true') {
+        this.setState({}, () => {
+          this.loadData()
+        })
+      }
     }
   }
 
@@ -197,10 +203,15 @@
   async loadData () {
     const { mainSearch, BID, menuType, dataManager } = this.props
     const { config, arr_field, search } = this.state
-    
+
     let searches = fromJS(search).toJS()
     if (mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢
-      searches = [...mainSearch, ...searches]
+      let keys = searches.map(item => item.key)
+      mainSearch.forEach(item => {
+        if (!keys.includes(item.key)) {
+          searches.push(item)
+        }
+      })
     }
 
     this.setState({

--
Gitblit v1.8.0