From 75623dd039b742dbb44fb4c6b4af563404ed9c7f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 03 二月 2020 16:06:04 +0800
Subject: [PATCH] 2020-02-03

---
 src/components/sidemenu/editthdmenu/index.jsx |  101 +++++---------------------------------------------
 1 files changed, 11 insertions(+), 90 deletions(-)

diff --git a/src/components/sidemenu/editthdmenu/index.jsx b/src/components/sidemenu/editthdmenu/index.jsx
index 88615d5..026d4eb 100644
--- a/src/components/sidemenu/editthdmenu/index.jsx
+++ b/src/components/sidemenu/editthdmenu/index.jsx
@@ -61,7 +61,9 @@
     tabConfig: null,        // 鏍囩閰嶇疆淇℃伅
     editSubTab: null,       // 缂栬緫瀛愭爣绛撅紙鏍囩涓殑鏍囩锛�
     subTabConfig: null,     // 瀛愭爣绛鹃厤缃俊鎭�
-    subConfig: null         // 瀛愰厤缃俊鎭�
+    subConfig: null,        // 瀛愰厤缃俊鎭�
+    btnTab: null,           // 鎵撳紑鏂版爣绛炬垨褰撳墠椤甸潰鍒锋柊鐨勬寜閽�
+    btnTabConfig: null      // 鎵撳紑鏂版爣绛炬寜閽厤缃�
   }
 
   /**
@@ -184,7 +186,7 @@
       this.setState({
         tabview: 'template',
         editMenu: {
-          MenuID: '',
+          MenuID: Utils.getuuid(),
           MenuName: '',
           MenuNo: '',
           type: '',
@@ -445,15 +447,6 @@
     document.getElementById('root').style.overflowY = 'unset'
   }
 
-  handleConfig = (type) => {
-    this.setState({tabview: type})
-    if (type) {
-      document.getElementById('root').style.overflowY = 'hidden'
-    } else {
-      document.getElementById('root').style.overflowY = 'unset'
-    }
-  }
-
   handleView = (param) => {
     this.setState({
       tabview: ''
@@ -463,81 +456,6 @@
         document.getElementById('root').style.overflowY = 'hidden'
       } else {
         document.getElementById('root').style.overflowY = 'unset'
-      }
-    })
-  }
-
-  handleSubConfig = (item, originMenu, config, type) => {
-    this.setState({
-      tabview: ''
-    }, () => {
-      if (type === 'button') { // 涓夌骇鑿滃崟椤甸潰锛屾寜閽厤缃�
-        if (item.OpenType === 'pop') {
-          let pageParam = ''
-          if (config && config.type === 'Modal') {
-            pageParam = config
-          }
-    
-          this.setState({
-            editMenu: originMenu,
-            editTab: '',
-            editAction: item,
-            btnParam: pageParam,
-            tabview: 'Modal'
-          })
-        }
-      } else if (type === 'tab') { // 涓夌骇鑿滃崟椤甸潰锛屾爣绛鹃厤缃�
-        if (item.type === 'SubTable' || item.tabType === 'SubTable') {
-          this.setState({
-            editMenu: originMenu,
-            editTab: config,
-            editAction: '',
-            tabview: 'SubTable'
-          })
-        }
-      } else if (type === 'tabButton') { // 涓夌骇鑿滃崟涓嬶紝鏍囩涓嬶紝鎸夐挳閰嶇疆
-
-        let pageParam = ''
-        if (item.OpenType === 'popview') {
-          if (config && config.Template === 'SubTable') {
-            pageParam = config
-          } else {
-            pageParam = {
-              ...item,
-              uuid: item.linkTab,
-              create: true
-            }
-          }
-  
-          this.setState({
-            editMenu: originMenu,
-            editTab: pageParam,
-            editAction: item,
-            tabview: 'SubTable'
-          })
-        } else {
-          if (config && config.type === 'Modal') {
-            pageParam = config
-          }
-          this.setState({
-            editTab: originMenu,
-            editAction: item,
-            btnParam: pageParam,
-            tabview: 'Modal'
-          })
-        }
-      } else if (type === 'tabview') { // 涓夌骇鑿滃崟涓嬶紝鎵撳紑鏂版爣绛鹃〉鎴栧綋鍓嶉〉璺宠浆锛岀被鍨嬬殑鎸夐挳閰嶇疆
-        let pageParam = ''
-        if (config && config.type === 'FormTab') {
-          pageParam = config
-        }
-  
-        this.setState({
-          editMenu: originMenu,
-          editAction: item,
-          btnParam: pageParam,
-          tabview: 'FormTab'
-        })
       }
     })
   }
@@ -668,6 +586,8 @@
             tabConfig={this.state.tabConfig}
             editSubTab={this.state.editSubTab}
             subTabConfig={this.state.subTabConfig}
+            btnTab={this.state.btnTab}
+            btnTabConfig={this.state.btnTabConfig}
             editAction={this.state.editAction}
             subConfig={this.state.subConfig}
             handleView={this.handleView}
@@ -679,6 +599,8 @@
             editTab={this.state.editTab}
             editSubTab={this.state.editSubTab}
             tabConfig={this.state.tabConfig}
+            btnTab={this.state.btnTab}
+            btnTabConfig={this.state.btnTabConfig}
             config={this.state.subConfig}
             handleView={this.handleView}
           />
@@ -686,10 +608,9 @@
         {this.state.tabview === 'FormTab' &&
           <FormTabConfig
             menu={this.state.editMenu}
-            config={this.state.btnParam}
-            editAction={this.state.editAction}
-            handleConfig={this.handleConfig}
-            handleSubConfig={this.handleSubConfig}
+            btnTab={this.state.btnTab}
+            config={this.state.subConfig}
+            handleView={this.handleView}
           />
         }
         {/* 鍥剧墖棰勮 */}

--
Gitblit v1.8.0