From 9798a9fa338ee5d022793ae1ef91a49e2e2b4c62 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 22 十二月 2019 10:10:28 +0800
Subject: [PATCH] 2019-12-22

---
 src/components/sidemenu/editthdmenu/index.jsx |   55 ++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/src/components/sidemenu/editthdmenu/index.jsx b/src/components/sidemenu/editthdmenu/index.jsx
index 1ef770b..859cf32 100644
--- a/src/components/sidemenu/editthdmenu/index.jsx
+++ b/src/components/sidemenu/editthdmenu/index.jsx
@@ -18,6 +18,8 @@
 
 const ComTableConfig = asyncLoadComponent(() => import('@/templates/comtableconfig'))
 const ModalConfig = asyncLoadComponent(() => import('@/templates/modalconfig'))
+const SubTable = asyncLoadComponent(() => import('@/templates/subtableconfig'))
+
 const { confirm } = Modal
 const { TabPane } = Tabs
 const { Search } = Input
@@ -36,19 +38,20 @@
   }
 
   state = {
+    dict: (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS,
     show: true,
     thawmenulist: null, // 宸插喕缁撶殑浜岀骇鑿滃崟
     visible: null,
     title: '',
     type: '',
-    tabview: '', // 閫夋嫨妯℃澘绐楀彛锛坱emplate锛夈�佸熀纭�琛ㄦ牸閰嶇疆锛圕ommonTable锛�
+    tabview: '',           // 閫夋嫨妯℃澘绐楀彛锛坱emplate锛夈�佸熀纭�琛ㄦ牸閰嶇疆锛圕ommonTable锛�
     formlist: null,
-    editMenu: null, // 缂栬緫鑿滃崟
-    editAction: null, // 缂栬緫鎸夐挳
-    thawMvisible: false, // 瑙i櫎鍐荤粨妯℃�佹
+    editMenu: null,        // 缂栬緫鑿滃崟
+    editAction: null,      // 缂栬緫鎸夐挳
+    editTab: null,         // 缂栬緫鏍囩
+    thawMvisible: false,   // 瑙i櫎鍐荤粨妯℃�佹
     confirmLoading: false, // 鎻愪氦涓�傘�傘��
-    dict: (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS,
-    selectTemp: '', // 閫夋嫨妯℃澘
+    selectTemp: '',        // 閫夋嫨妯℃澘
     usedTemplates: null,
     menuConfig: '',
     tempSearchKey: '',
@@ -383,18 +386,29 @@
     document.getElementById('root').style.overflowY = 'unset'
   }
 
-  handleSubConfig = (item, originMenu, config) => {
-    if (item.OpenType === 'pop') {
-      item.pageParam = ''
-      if (config && config.type === 'Modal') {
-        item.pageParam = config
+  handleSubConfig = (item, originMenu, config, type) => {
+    if (type === 'button') {
+      if (item.OpenType === 'pop') {
+        item.pageParam = ''
+        if (config && config.type === 'Modal') {
+          item.pageParam = config
+        }
+  
+        this.setState({
+          editMenu: originMenu,
+          editAction: item,
+          tabview: 'Modal'
+        })
       }
-
-      this.setState({
-        editMenu: originMenu,
-        editAction: item,
-        tabview: 'Modal'
-      })
+    } else if (type === 'tab') {
+      console.log(item)
+      // if (item.type === 'SubTable') {
+      //   this.setState({
+      //     editMenu: originMenu,
+      //     editTab: item,
+      //     tabview: 'SubTable'
+      //   })
+      // }
     }
   }
 
@@ -525,6 +539,13 @@
             handleConfig={this.handleConfig}
           />
         }
+        {this.state.tabview === 'SubTable' &&
+          <SubTable
+            menu={this.state.editMenu}
+            editTab={this.state.editTab}
+            handleConfig={this.handleConfig}
+          />
+        }
         {/* 鍥剧墖棰勮 */}
         <Preview cancel={this.cancelPrePicture} preview={this.state.preview} template={this.state.pretemplate} confirm={this.useTemplate}/>
         {/* 瑙e喕鑿滃崟妯℃�佹 */}

--
Gitblit v1.8.0