From 67e7787f24a1ca3dc45f77fb7bbcb76edc33fe55 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 22 十一月 2019 09:55:52 +0800
Subject: [PATCH] 2019-11-22-01

---
 src/components/sidemenu/editthdmenu/index.jsx |  140 ++++++++--------------------------------------
 1 files changed, 25 insertions(+), 115 deletions(-)

diff --git a/src/components/sidemenu/editthdmenu/index.jsx b/src/components/sidemenu/editthdmenu/index.jsx
index 421da31..53ee91e 100644
--- a/src/components/sidemenu/editthdmenu/index.jsx
+++ b/src/components/sidemenu/editthdmenu/index.jsx
@@ -8,16 +8,15 @@
 import TransferForm from '@/components/transferform'
 import Utils from '@/utils/utils.js'
 import DragElement from '../menuelement'
-// import MenuForm from '../menuform'
-// import ComTableConfig from '../comtableconfig'
-import asyncComponent from '@/utils/asyncComponent'
+import asyncLoadComponent from '@/utils/asyncLoadComponent'
 import Api from '@/api'
 import zhCN from '@/locales/zh-CN/header.js'
 import enUS from '@/locales/en-US/header.js'
 import nortable from '@/assets/img/normaltable.jpg'
 import './index.scss'
 
-const ComTableConfig = asyncComponent(() => import('../comtableconfig'))
+const ComTableConfig = asyncLoadComponent(() => import('@/templates/comtableconfig'))
+const ModalConfig = asyncLoadComponent(() => import('@/templates/modalconfig'))
 const { confirm } = Modal
 const { TabPane } = Tabs
 const illust = {
@@ -43,7 +42,6 @@
     tabview: '', // 閫夋嫨妯℃澘绐楀彛锛坱emplate锛夈�佸熀纭�琛ㄦ牸閰嶇疆锛圕ommonTable锛�
     formlist: null,
     editMenu: null, // 缂栬緫鑿滃崟
-    editMvisible: false, // 缂栬緫鑿滃崟妯℃�佹
     thawMvisible: false, // 瑙i櫎鍐荤粨妯℃�佹
     confirmLoading: false, // 鎻愪氦涓�傘�傘��
     dict: (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS,
@@ -118,6 +116,7 @@
             }
           }
           _menu.LongParam = _LongParam
+          _menu.ParentID = this.props.supMenu.MenuID
           // console.log(_menu)
           // 妫�娴嬫ā鏉挎槸鍚﹀瓨鍦�
           let _Template = this.state.baseTemplates.filter(temp => temp.type === _menu.PageParam.Template)
@@ -212,14 +211,6 @@
     }
   }
 
-  // memuHandleCancel = () => {
-  //   this.setState({
-  //     editMvisible: false,
-  //     visible: false
-  //   })
-  //   this.resetFormlist()
-  // }
-
   thawMemuSubmit = () => {
     // 涓夌骇鑿滃崟瑙i櫎鍐荤粨
     if (this.refs.trawmenu.state.targetKeys.length === 0) {
@@ -303,7 +294,8 @@
           text: '',
           type: template.type,
           PageParam: {OpenType: "newtab", Template: template.type},
-          LongParam: ''
+          LongParam: '',
+          ParentID: this.props.supMenu.MenuID
         }
       })
     } else {
@@ -316,107 +308,6 @@
     }
     document.getElementById('root').style.overflowY = 'hidden'
   }
-
-  // submitMenuConfig = () => {
-  //   if (this.state.type !== 'edit') {
-  //     this.setState({
-  //       visible: true,
-  //       title: this.state.dict['header.menu.addtitle'],
-  //       formlist: [
-  //         {
-  //           type: 'text',
-  //           key: 'parentId',
-  //           label: this.state.dict['header.menu.supMenu'],
-  //           initVal: this.props.supMenu.text,
-  //           required: true,
-  //           readonly: true
-  //         },
-  //         {
-  //           type: 'text',
-  //           key: 'menuName',
-  //           label: this.state.dict['header.menu.menuName'],
-  //           initVal: '',
-  //           required: true,
-  //           readonly: false
-  //         },
-  //         {
-  //           type: 'text',
-  //           key: 'menuNo',
-  //           label: this.state.dict['header.menu.menuNo'],
-  //           initVal: '',
-  //           required: true,
-  //           readonly: false
-  //         },
-  //         {
-  //           type: 'select',
-  //           key: 'opentype',
-  //           label: '鎵撳紑鏂瑰紡',
-  //           initVal: 'newtab',
-  //           required: true,
-  //           options: [{
-  //             MenuID: 'newtab',
-  //             text: '鏂版爣绛鹃〉'
-  //           }, {
-  //             MenuID: 'newpage',
-  //             text: '鏂伴〉闈�'
-  //           }]
-  //         }
-  //       ]
-  //     })
-  //   } else {
-  //     console.log(this.state.editMenu)
-  //     // confirm({
-  //     //   title: this.state.dict['header.menu.update'].replace('@M', menu.card.text),
-  //     //   content: '',
-  //     //   okText: this.state.dict['header.confirm'],
-  //     //   cancelText: this.state.dict['header.cancel'],
-  //     //   onOk() {
-  //     //     let param = {
-  //     //       func: 'sPC_MainMenu_Del',
-  //     //       MenuID: menu.card.MenuID
-  //     //     }
-  //     //     return Api.getSystemConfig(param).then(res => {
-  //     //       if (res.status) {
-  //     //         _this.props.reload()
-  //     //       } else {
-  //     //         notification.warning({
-  //     //           top: 92,
-  //     //           message: res.message,
-  //     //           duration: 10
-  //     //         })
-  //     //       }
-  //     //     })
-  //     //   },
-  //     //   onCancel() {}
-  //     // })
-  //     this.setState({
-  //       tabview: this.state.selectTemp.type
-  //     })
-  //   }
-  // }
-
-  // changeTemp = () => {
-  //   this.setState({
-  //     editMvisible: false,
-  //     tabview: 'template'
-  //   })
-  //   this.resetFormlist()
-  // }
-
-  // changeConfig = () => {
-  //   this.setState({
-  //     editMvisible: false,
-  //     tabview: this.state.editMenu.PageParam.Template,
-  //     menuConfig: window.atob(this.state.editMenu.LongParam)
-  //   })
-  //   this.resetFormlist()
-  // }
-  
-  // resetFormlist = () => {
-  //   setTimeout(() => {
-  //     this.setState({formlist: null})
-  //   }, 300)
-  // }
 
   getUsedTemplate = () => {
     Api.getSystemConfig({func: 'sPC_Get_UserTemp'}).then(res => {
@@ -449,6 +340,17 @@
   handleConfig = (type) => {
     this.setState({tabview: type})
     document.getElementById('root').style.overflowY = 'unset'
+  }
+
+  handleSubConfig = (item, originMenu, config) => {
+    if (item.OpenType === 'pop') {
+      // this.setState({
+      //   editMenu: originMenu,
+      //   tabview: 'Modal'
+      // })
+    }
+    console.log(item)
+    console.log(originMenu)
   }
 
   UNSAFE_componentWillMount () {
@@ -536,6 +438,14 @@
           <ComTableConfig
             type={this.state.type}
             menu={this.state.editMenu}
+            supMenuList={this.props.supMenuList}
+            handleConfig={this.handleConfig}
+            handleSubConfig={this.handleSubConfig}
+          />
+        }
+        {this.state.tabview === 'Modal' &&
+          <ModalConfig
+            menu={this.state.editMenu}
             supMenu={this.props.supMenu}
             supMenuList={this.props.supMenuList}
             handleConfig={this.handleConfig}

--
Gitblit v1.8.0