From 3193df5faaacb0fe903ce993b16319276528524f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 06 七月 2020 23:14:17 +0800
Subject: [PATCH] 2020-07-06

---
 src/tabviews/commontable/index.jsx |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index c5f75a0..52f6d59 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/index.jsx
@@ -44,6 +44,7 @@
   state = {
     dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
     ContainerId: Utils.getuuid(), // 鑿滃崟澶栧眰html Id
+    BID: null,            // 椤甸潰璺宠浆鏃舵惡甯D
     loadingview: true,    // 椤甸潰鍔犺浇涓�
     viewlost: false,      // 椤甸潰涓㈠け锛�1銆佹湭鑾峰彇鍒伴厤缃�-椤甸潰涓㈠け锛�2銆侀〉闈㈡湭鍚敤
     lostmsg: '',          // 椤甸潰涓㈠け鏃剁殑鎻愮ず淇℃伅
@@ -381,6 +382,7 @@
       }
 
       this.setState({
+        BID: param && param.BID ? param.BID : '',
         loadingview: false,
         chartId: chartId,
         config: config,
@@ -537,6 +539,10 @@
           arr_field: _option.field
         }
 
+        if (this.state.BID) {
+          param.BID = this.state.BID
+        }
+
         if (this.props.dataManager) { // 鏁版嵁鏉冮檺
           param.LText = param.LText.replace(/\$@/ig, '/*')
           param.LText = param.LText.replace(/@\$/ig, '*/')
@@ -610,7 +616,7 @@
    * @description 涓昏〃鏁版嵁鍔犺浇
    */ 
   async loadmaindata () {
-    const { setting, BIDs, search } = this.state
+    const { setting, BIDs, search, BID } = this.state
     let param = ''
     let requireFields = search.filter(item => item.required && (!item.value || item.value.length === 0))
 
@@ -635,6 +641,8 @@
     } else {
       param = this.getDefaultParam()
     }
+
+    param.BID = BID
 
     let result = await Api.genericInterface(param)
     if (result.status) {
@@ -889,8 +897,8 @@
    * @description 椤甸潰鍒锋柊锛岄噸鏂拌幏鍙栭厤缃�
    */
   reloadview = () => {
-    this.setState({ loadingview: true, viewlost: false, lostmsg: '', config: {}, userConfig: null, searchlist: null,
-      actions: null, columns: null, arr_field: '', setting: null, data: null, total: 0, loading: false, pageIndex: 1,
+    this.setState({ loadingview: true, viewlost: false, lostmsg: '',
+      data: null, total: 0, loading: false, pageIndex: 1,
       pageSize: 10, orderBy: '', search: '', BIDs: {}, pickup: false
     }, () => {
       this.loadconfig()
@@ -1106,7 +1114,7 @@
   }
 
   render() {
-    const { setting, searchlist, pageSize, actions, columns, loadingview, viewlost, pickup, config, triggerBtn, userConfig, tabActive, chartId, search, selectedData } = this.state
+    const { BID, setting, searchlist, pageSize, actions, columns, loadingview, viewlost, pickup, config, triggerBtn, userConfig, tabActive, chartId, search, selectedData } = this.state
 
     return (
       <div className="commontable pick-control" id={this.state.ContainerId}>
@@ -1134,6 +1142,7 @@
                   {config.charts.length > 1 && item.title ? <p className="chart-table chart-title">{item.title}</p> : null}
                   <div style={{minHeight: '25px'}}>
                     <MainAction
+                      BID={BID}
                       setting={setting}
                       actions={actions}
                       dict={this.state.dict}
@@ -1187,6 +1196,7 @@
               return (
                 <Col span={item.width} key={item.uuid}>
                   <CardComponent
+                    BID={BID}
                     plot={item}
                     config={config}
                     tableId="mainTable"

--
Gitblit v1.8.0