From 29c5821ce140e89a8b35e53f41672dd86da56982 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 18 二月 2020 18:43:38 +0800
Subject: [PATCH] 2020-02-18

---
 src/tabviews/commontable/index.jsx |   55 ++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 32 insertions(+), 23 deletions(-)

diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index 1ddb53e..544400a 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/index.jsx
@@ -59,7 +59,8 @@
     popData: false,       // 寮规椤甸潰锛屾墍閫夌殑琛ㄦ牸鏁版嵁
     visible: false,       // 寮规鏄剧ず闅愯棌鎺у埗
     tabBtn: null,         // 琛ㄥ崟鏍囩鎸夐挳
-    tabParam: null        // 琛ㄥ崟鏍囩鍙傛暟
+    tabParam: null,       // 琛ㄥ崟鏍囩鍙傛暟
+    refreshtabs: null     // 闇�瑕佸埛鏂扮殑鏍囩闆�
   }
 
   /**
@@ -166,25 +167,14 @@
 
       
       let _isLinkMain = false // 妫�鏌ユ槸鍚︽湁涓庝富琛ㄥ叧鑱旂殑瀛愯〃
-      let supmenus = {}
-      config.tabgroups.forEach(group => {
-        if (config[group] && config[group].length > 0) {
-          config[group] = config[group].map(tab => {
-            if (tab.subtabs && tab.subtabs.length > 0) {
-              tab.subtabs.forEach(id => {
-                supmenus[id] = tab.uuid
-              })
-            }
-            if (config.setting.subtabs.includes(tab.uuid)) {
-              tab.supMenu = 'mainTable'
-              _isLinkMain = true
-            } else if (supmenus[tab.uuid]) {
-              tab.supMenu = supmenus[tab.uuid]
-            }
+      config.tabgroups.forEach(groupId => {
+        if (!config[groupId] || config[groupId].length === 0) return
 
-            return tab
-          })
-        }
+        config[groupId].forEach(tab => {
+          if (tab.supMenu === 'mainTable') {
+            _isLinkMain = true
+          }
+        })
       })
 
       this.setState({
@@ -594,8 +584,26 @@
   /**
    * @description 瀛愯〃鎿嶄綔瀹屾垚鍚庡埛鏂颁富琛�
    */
-  handleMainTable = () => {
-    this.reloadtable()
+  handleMainTable = (type, tab) => {
+    if (type === 'maingrid' && tab.supMenu === 'mainTable') {
+      this.reloadtable()
+    } else if (type === 'maingrid' && tab.supMenu) {
+      this.setState({
+        refreshtabs: [tab.supMenu]
+      }, () => {
+        this.setState({
+          refreshtabs: null
+        })
+      })
+    } else if (type === 'equaltab' && tab.equalTab && tab.equalTab.length > 0) {
+      this.setState({
+        refreshtabs: tab.equalTab
+      }, () => {
+        this.setState({
+          refreshtabs: null
+        })
+      })
+    }
   }
 
   /**
@@ -852,11 +860,12 @@
                             Tab={_tab}
                             MenuID={_tab.linkTab}
                             SupMenuID={this.props.MenuID}
+                            refreshtabs={this.state.refreshtabs}
                             ContainerId={this.state.ContainerId}
                             BID={this.state.BIDs[_tab.supMenu] || ''}
                             BData={this.state.BIDs[_tab.supMenu + 'data'] || ''}
                             handleTableId={this.handleTableId}
-                            handleMainTable={this.handleMainTable}
+                            handleMainTable={(type) => this.handleMainTable(type, _tab)}
                           /> : null}
                       </TabPane>
                     )
@@ -873,7 +882,7 @@
             visible={this.state.visible}
             onCancel={this.popclose}
             footer={[
-              <Button key="cancel" onClick={this.popclose}>{this.state.dict['main.close']}</Button>
+              <Button key="close" onClick={this.popclose}>{this.state.dict['main.close']}</Button>
             ]}
             destroyOnClose
           >

--
Gitblit v1.8.0