From 9b6ce1a5778c6e1a813237e87588c0052aae1bbb Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 29 四月 2020 17:26:15 +0800
Subject: [PATCH] 2020-04-29

---
 src/tabviews/subtable/index.jsx |   57 ++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 44 insertions(+), 13 deletions(-)

diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx
index 2ee84a9..88105fc 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()
       })
     }
   }
@@ -170,6 +175,7 @@
 
         config.action = config.action.map(item => {
           if (userConfig.action[item.uuid]) {
+            delete userConfig.action[item.uuid].label
             item = {...item, ...userConfig.action[item.uuid]}
           }
 
@@ -265,6 +271,7 @@
       if (userConfig) {
         _columns = _columns.map(item => {
           if (userConfig.columns[item.uuid]) {
+            delete userConfig.columns[item.uuid].label
             item = {...item, ...userConfig.columns[item.uuid]}
           }
 
@@ -298,10 +305,12 @@
         loadingview: false,
         viewlost: true
       })
+      let prex = Tab && Tab.label ? Tab.label + ': ' : ''
+
       notification.warning({
         top: 92,
-        message: result.message,
-        duration: 10
+        message: prex + result.message,
+        duration: 5
       })
     }
   }
@@ -349,10 +358,12 @@
         })
         deffers.push(defer)
       } else if (item.resourceType === '1' && !item.dataSource) {
+        let prex = this.props.Tab && this.props.Tab.label ? this.props.Tab.label + '-' : ''
+
         notification.warning({
           top: 92,
-          message: item.label + ': ' + this.state.dict['main.datasource.settingerror'],
-          duration: 10
+          message: prex + item.label + ': ' + this.state.dict['main.datasource.settingerror'],
+          duration: 5
         })
       }
     })
@@ -384,10 +395,12 @@
             return item
           })
         } else {
+          let prex = this.props.Tab && this.props.Tab.label ? this.props.Tab.label + '-' : ''
+
           notification.warning({
             top: 92,
-            message: res.search.label + ':' + res.message,
-            duration: 10
+            message: prex + res.search.label + ':' + res.message,
+            duration: 5
           })
         }
       })
@@ -454,10 +467,12 @@
       this.setState({
         loading: false
       })
+      let prex = this.props.Tab && this.props.Tab.label ? this.props.Tab.label + ': ' : ''
+
       notification.error({
         top: 92,
-        message: result.message,
-        duration: 15
+        message: prex + result.message,
+        duration: 10
       })
     }
   }
@@ -466,9 +481,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,
@@ -507,9 +528,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 = {
@@ -671,13 +698,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
     }
   }
@@ -705,7 +737,6 @@
         data: record
       }
     })
-    // this.refs.subButton.actionTrigger(btn, record)
   }
 
   /**

--
Gitblit v1.8.0