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/index.jsx |   57 ++++++++++++++++++++++++++++++++-------------------------
 1 files changed, 32 insertions(+), 25 deletions(-)

diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx
index 9541ee1..73a4d2b 100644
--- a/src/tabviews/custom/index.jsx
+++ b/src/tabviews/custom/index.jsx
@@ -181,7 +181,12 @@
         }
       }
 
+      if (!component.setting) return component // 涓嶄娇鐢ㄧ郴缁熷嚱鏁版椂
       if (!component.format || (component.subtype === 'propcard' && component.wrap.datatype === 'static')) return component // 娌℃湁鍔ㄦ�佹暟鎹�  鏁版嵁鏍煎紡 array 鎴� object
+      if (component.setting.interType !== 'system') { // 涓嶄娇鐢ㄧ郴缁熷嚱鏁版椂
+        component.setting.sync = 'false'
+        return component
+      }
 
       let _customScript = ''
       component.scripts && component.scripts.forEach(script => {
@@ -193,36 +198,32 @@
       })
       delete component.scripts
 
-      if (component.setting && component.setting.interType === 'system') { // 浣跨敤绯荤粺鍑芥暟
-        component.setting.execute = component.setting.execute !== 'false'  // 榛樿sql鏄惁鎵ц锛岃浆涓篵oolean 缁熶竴鏍煎紡
-        component.setting.laypage = component.setting.laypage === 'true'   // 鏄惁鍒嗛〉锛岃浆涓篵oolean 缁熶竴鏍煎紡
+      component.setting.execute = component.setting.execute !== 'false'  // 榛樿sql鏄惁鎵ц锛岃浆涓篵oolean 缁熶竴鏍煎紡
+      component.setting.laypage = component.setting.laypage === 'true'   // 鏄惁鍒嗛〉锛岃浆涓篵oolean 缁熶竴鏍煎紡
 
-        if (!component.setting.execute) {
-          component.setting.dataresource = ''
-        }
-        if (/\s/.test(component.setting.dataresource)) {
-          component.setting.dataresource = '(' + component.setting.dataresource + ') tb'
-        }
-    
-        if (this.props.dataManager) { // 鏁版嵁鏉冮檺
-          component.setting.dataresource = component.setting.dataresource.replace(/\$@/ig, '/*')
-          component.setting.dataresource = component.setting.dataresource.replace(/@\$/ig, '*/')
-          _customScript = _customScript.replace(/\$@/ig, '/*')
-          _customScript = _customScript.replace(/@\$/ig, '*/')
-        } else {
-          component.setting.dataresource = component.setting.dataresource.replace(/@\$|\$@/ig, '')
-          _customScript = _customScript.replace(/@\$|\$@/ig, '')
-        }
+      if (!component.setting.execute) {
+        component.setting.dataresource = ''
+      }
+      if (/\s/.test(component.setting.dataresource)) {
+        component.setting.dataresource = '(' + component.setting.dataresource + ') tb'
+      }
+  
+      if (this.props.dataManager) { // 鏁版嵁鏉冮檺
+        component.setting.dataresource = component.setting.dataresource.replace(/\$@/ig, '/*')
+        component.setting.dataresource = component.setting.dataresource.replace(/@\$/ig, '*/')
+        _customScript = _customScript.replace(/\$@/ig, '/*')
+        _customScript = _customScript.replace(/@\$/ig, '*/')
+      } else {
+        component.setting.dataresource = component.setting.dataresource.replace(/@\$|\$@/ig, '')
+        _customScript = _customScript.replace(/@\$|\$@/ig, '')
       }
 
-      if (component.setting) {
-        component.setting.customScript = _customScript // 鏁寸悊鍚庤嚜瀹氫箟鑴氭湰
-      }
+      component.setting.customScript = _customScript // 鏁寸悊鍚庤嚜瀹氫箟鑴氭湰
 
       // floor    缁勪欢鐨勫眰绾�
       // dataName 绯荤粺鐢熸垚鐨勬暟鎹簮鍚嶇О
       // pageable 鏄惁鍒嗛〉锛岀粍浠跺睘鎬э紝涓嶅垎椤电殑缁勪欢鎵嶅彲浠ョ粺涓�鏌ヨ
-      if (component.floor === 1 && component.dataName && !component.pageable && component.setting.interType === 'system' && component.setting.onload === 'true' && component.setting.sync === 'true') {
+      if (component.floor === 1 && component.dataName && (!component.pageable || (component.pageable && !component.setting.laypage)) && component.setting.onload === 'true' && component.setting.sync === 'true') {
         let param = this.getDefaultParam(component, mainSearch)
         params.push(param)
       } else if (component.floor === 1) {
@@ -243,8 +244,14 @@
     if (search && search.length > 0) {
       searchlist = Utils.initMainSearch(search)
     }
+
     if (setting.useMSearch === 'true') {
-      searchlist = [...mainSearch, ...searchlist]
+      let keys = searchlist.map(item => item.key)
+      mainSearch.forEach(item => {
+        if (!keys.includes(item.key)) {
+          searchlist.push(item)
+        }
+      })
     }
 
     let arr_field = columns.map(col => col.field)
@@ -440,7 +447,7 @@
         if (item.subtype === 'datacard') {
           return (
             <Col span={item.width} key={item.uuid}>
-              <DataCard config={item} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} />
+              <DataCard config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} />
             </Col>
           )
         } else if (item.subtype === 'propcard') {

--
Gitblit v1.8.0