From 0472ec32cadb4f9bca6dbab82ac33a42e76f37ed Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 28 六月 2022 16:24:15 +0800
Subject: [PATCH] 菜单栏&时间轴

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

diff --git a/src/tabviews/custom/components/code/sand-box/index.jsx b/src/tabviews/custom/components/code/sand-box/index.jsx
index 8f8eac0..0938216 100644
--- a/src/tabviews/custom/components/code/sand-box/index.jsx
+++ b/src/tabviews/custom/components/code/sand-box/index.jsx
@@ -67,7 +67,9 @@
       arr_field: _config.columns.map(col => col.field).join(','),
     }, () => {
       if (_config.wrap.datatype !== 'static' && _config.setting && _config.setting.sync !== 'true' && _config.setting.onload === 'true') {
-        this.loadData()
+        setTimeout(() => {
+          this.loadData()
+        }, _config.setting.delay || 0)
       }
       this.renderView()
     })
@@ -139,16 +141,10 @@
       return
     }
 
-    let searches = []
-    if (config.setting.useMSearch && 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
     }
 
@@ -201,7 +197,7 @@
         try {
           // eslint-disable-next-line no-eval
           eval(js)
-        } catch {
+        } catch (e) {
           console.warn('JS 鎵ц澶辫触锛�')
         }
       }
@@ -212,7 +208,7 @@
     const { config, loading, html } = this.state
 
     return (
-      <div className="custom-sand-box" style={{...config.style}}>
+      <div className="custom-sand-box" id={'anchor' + config.uuid} style={{...config.style}}>
         {loading ?
           <div className="loading-mask">
             <div className="ant-spin-blur"></div>

--
Gitblit v1.8.0