From 6b680ace26dc95031a1b7a3e33f8785c112f787d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 20 四月 2020 18:32:01 +0800
Subject: [PATCH] 2020-04-20

---
 src/tabviews/subtable/index.jsx |   31 ++++++++++++++++++++++++++-----
 1 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx
index 11b05d8..f044c02 100644
--- a/src/tabviews/subtable/index.jsx
+++ b/src/tabviews/subtable/index.jsx
@@ -31,6 +31,7 @@
     BData: PropTypes.any,            // 涓婄骇鏁版嵁
     MenuID: PropTypes.string,        // 鑿滃崟Id
     SupMenuID: PropTypes.string,     // 涓婄骇鑿滃崟Id
+    mainSearch: PropTypes.any,       // 涓昏〃鎼滅储鏉′欢
     ContainerId: PropTypes.any,      // 涓夌骇鑿滃崟Container(html) ID
     handleTableId: PropTypes.func,   // 鎺у埗琛ㄦ牸鏁版嵁鍒囨崲鏃讹紝鏇存柊鍦ㄤ富琛ㄤ腑鐨刬d
     handleMainTable: PropTypes.func, // 鍒锋柊涓昏〃
@@ -81,6 +82,10 @@
 
       this.setState({
         triggerBtn: trigger
+      })
+    } else if (!this.props.Tab.supMenu && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
+      this.setState({}, () => {
+        this.loadmaindata()
       })
     }
   }
@@ -474,9 +479,15 @@
    * @description 鑾峰彇鐢ㄦ埛鑷畾涔夊瓨鍌ㄨ繃绋嬩紶鍙�
    */
   getCustomParam = (BID) => {
+    const { mainSearch } = this.props
     const { pageIndex, pageSize, orderBy, search, setting } = this.state
 
-    let _search = Utils.formatCustomMainSearch(search)
+    let searches = search
+    if (mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢
+      searches = [...mainSearch, ...search]
+    }
+
+    let _search = Utils.formatCustomMainSearch(searches)
 
     let param = {
       PageIndex: pageIndex,
@@ -515,9 +526,15 @@
    * @description 鑾峰彇绯荤粺瀛樺偍杩囩▼ sPC_Get_TableData 鐨勫弬鏁�
    */
   getDefaultParam = (BID) => {
+    const { mainSearch } = this.props
     const { arr_field, pageIndex, pageSize, orderBy, search, setting } = this.state
 
-    let _search = Utils.joinMainSearchkey(search)
+    let searches = search
+    if (mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢
+      searches = [...mainSearch, ...search]
+    }
+
+    let _search = Utils.joinMainSearchkey(searches)
     _search = _search ? 'where ' + _search : ''
 
     let param = {
@@ -679,13 +696,18 @@
    * @description 瀵煎嚭Excel鏃讹紝鑾峰彇椤甸潰鎼滅储鎺掑簭绛夊弬鏁�
    */
   getexceloutparam = () => {
-    const { Tab } = this.props
+    const { Tab, mainSearch } = this.props
     const { arr_field, orderBy, search, setting} = this.state
+
+    let searches = search
+    if (mainSearch && mainSearch.length > 0) { // 涓昏〃鎼滅储鏉′欢
+      searches = [...mainSearch, ...search]
+    }
 
     return {
       arr_field: arr_field,
       orderBy: orderBy || setting.order,
-      search: search,
+      search: searches,
       menuName: Tab.label
     }
   }
@@ -713,7 +735,6 @@
         data: record
       }
     })
-    // this.refs.subButton.actionTrigger(btn, record)
   }
 
   /**

--
Gitblit v1.8.0