From d59f518f466274b2caeb2e01c10c92deafe7c93b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 09 二月 2022 11:48:29 +0800
Subject: [PATCH] 2022-02-09

---
 src/tabviews/custom/components/code/sand-box/index.jsx |   22 +++++++---------------
 1 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/src/tabviews/custom/components/code/sand-box/index.jsx b/src/tabviews/custom/components/code/sand-box/index.jsx
index afa5ac5..508932b 100644
--- a/src/tabviews/custom/components/code/sand-box/index.jsx
+++ b/src/tabviews/custom/components/code/sand-box/index.jsx
@@ -106,12 +106,10 @@
       this.setState({sync: false, data: _data}, () => {
         this.renderView()
       })
-    } else if (nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
-      if (config.wrap.datatype !== 'static' && config.setting.syncRefresh === 'true') {
-        this.setState({}, () => {
-          this.loadData()
-        })
-      }
+    } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
+      this.setState({}, () => {
+        this.loadData()
+      })
     }
   }
 
@@ -141,16 +139,10 @@
       return
     }
 
-    let searches = []
-    if (mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢
-      searches = mainSearch
-    }
+    let searches = config.setting.useMSearch && mainSearch ? mainSearch : []
 
-    let requireFields = searches.filter(item => item.required && (!item.value || item.value.length === 0))
+    let requireFields = searches.filter(item => item.required && item.value === '')
     if (requireFields.length > 0) {
-      this.setState({
-        loading: false
-      })
       return
     }
 
@@ -203,7 +195,7 @@
         try {
           // eslint-disable-next-line no-eval
           eval(js)
-        } catch {
+        } catch (e) {
           console.warn('JS 鎵ц澶辫触锛�')
         }
       }

--
Gitblit v1.8.0