From b786fa52322e1192652ff44a41c39bfed9738006 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 01 二月 2020 16:34:26 +0800
Subject: [PATCH] 2020-02-01

---
 src/templates/subtableconfig/index.jsx |   44 ++++++++++++++++++++++++++++++--------------
 1 files changed, 30 insertions(+), 14 deletions(-)

diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx
index f9863eb..b41de8f 100644
--- a/src/templates/subtableconfig/index.jsx
+++ b/src/templates/subtableconfig/index.jsx
@@ -36,9 +36,9 @@
   static propTpyes = {
     menu: PropTypes.any,
     editTab: PropTypes.any,
+    editSubTab: PropTypes.any,
     config: PropTypes.any,
-    handleSubConfig: PropTypes.func,
-    supMenuList: PropTypes.array
+    handleView: PropTypes.func
   }
 
   state = {
@@ -1684,19 +1684,10 @@
    * @description 璁剧疆鍙厤缃寜閽�
    */
   setSubConfig = (btn) => {
+    const { menu } = this.props
     const { config, originConfig } = this.state
 
-    let isAdd = false
-
-    if (
-      (config.search[0] && config.search[0].origin) ||
-      (config.action[0] && config.action[0].origin) ||
-      (config.columns[0] && config.columns[0].origin)
-    ) {
-      isAdd = true
-    }
-
-    if (isAdd) {
+    if (originConfig.isAdd) {
       notification.warning({
         top: 92,
         message: '鑿滃崟灏氭湭淇濆瓨锛岃淇濆瓨鑿滃崟閰嶇疆锛�',
@@ -1716,6 +1707,25 @@
           this.setState({
             loading: true
           })
+
+          // 瀛愯彍鍗曚俊鎭獙璇侀�氳繃鍚庯紝璺宠浆瀛愭寜閽厤缃〉闈�
+          let _view = ''
+
+          if (btn.OpenType === 'pop') {
+            _view = 'Modal'             // 琛ㄥ崟椤甸潰
+          } else if (btn.OpenType === 'popview') {
+            _view = btn.tabType        // 鏂板脊绐楁爣绛炬ā鏉�
+          }
+
+          let param = {
+            editMenu: menu,
+            editTab: originConfig,
+            editSubTab: '',
+            editAction: btn,
+            subConfig: '',
+            tabview: _view
+          }
+
           Api.getSystemConfig({
             func: 'sPC_Get_LongParam',
             MenuID: btn.OpenType === 'popview' ? btn.linkTab : btn.uuid
@@ -1734,7 +1744,13 @@
                 }
               }
 
-              this.props.handleSubConfig(btn, config, _LongParam, 'tabButton')
+              if (_LongParam && param.tabview === 'Modal' && _LongParam.type === 'Modal') {
+                param.subConfig = _LongParam
+              } else if (_LongParam && param.tabview === 'SubTable' && _LongParam.Template === 'SubTable') {
+                param.subConfig = _LongParam
+              }
+
+              this.props.handleView(param)
             } else {
               this.setState({
                 loading: false

--
Gitblit v1.8.0