From 2ff464f30d94235b3ad04475593b75a74a354de9 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 09 四月 2020 19:04:01 +0800
Subject: [PATCH] 2020-04-09

---
 src/components/sidemenu/editthdmenu/index.jsx |  128 +++++++++++++++---------------------------
 1 files changed, 47 insertions(+), 81 deletions(-)

diff --git a/src/components/sidemenu/editthdmenu/index.jsx b/src/components/sidemenu/editthdmenu/index.jsx
index 3128f22..8226e8f 100644
--- a/src/components/sidemenu/editthdmenu/index.jsx
+++ b/src/components/sidemenu/editthdmenu/index.jsx
@@ -71,8 +71,7 @@
     sysMenu: false,         // 娣诲姞鎴栫紪杈戣彍鍗曪紙瑙掕壊鏉冮檺鍒嗛厤绛夛級
     optionLibs: [],         // 鑷畾涔変笅鎷夐�夐」搴�
     fstMenuId: null,        // 涓�绾ц彍鍗旾d
-    fstMenuList: null,      // 涓�绾ц彍鍗曞垪琛�
-    roleList: null          // 瑙掕壊鍒楄〃锛屽缓绔嬮粦鍚嶅崟
+    fstMenuList: null       // 涓�绾ц彍鍗曞垪琛�
   }
 
   /**
@@ -146,7 +145,6 @@
         _menu.supMenuList = this.props.supMenuList
         _menu.fstMenuId = this.state.fstMenuId || ''
         _menu.fstMenuList = this.state.fstMenuList || []
-        _menu.roleList = this.state.roleList || []
   
         this.setState({
           handleMVisible: true,
@@ -183,7 +181,6 @@
           _menu.supMenuList = this.props.supMenuList
           _menu.fstMenuId = this.state.fstMenuId || ''
           _menu.fstMenuList = this.state.fstMenuList || []
-          _menu.roleList = this.state.roleList || []
 
           // 妫�娴嬫ā鏉挎槸鍚﹀瓨鍦�
           let _Template = this.state.sysTemplates.filter(temp => temp.type === _menu.PageParam.Template)
@@ -269,7 +266,6 @@
           isSubtable: '', // 鏄惁涓轰富瀛愯〃
           ParentID: this.props.supMenu.MenuID,
           supMenuList: this.props.supMenuList,
-          roleList: this.state.roleList || [],
           fstMenuId: this.state.fstMenuId,
           fstMenuList: this.state.fstMenuList,
           menuSort: (this.props.menulist.length + 1) * 10 // 鏂板缓鑿滃崟璁剧疆鎺掑簭
@@ -443,7 +439,6 @@
     if (!editMenu.fstMenuId) {
       editMenu.fstMenuId = this.state.fstMenuId
       editMenu.fstMenuList = this.state.fstMenuList
-      editMenu.roleList = this.state.roleList || []
     }
 
     if (useType === 'sys' && template.type === 'RolePermission') { // 鐙珛椤甸潰
@@ -680,85 +675,56 @@
       loading: true
     })
 
-    let menuDefer = new Promise(resolve => {
-      Api.getSystemConfig(_param).then(result => {
-        if (result.status) {
-          this.setState({
-            fstMenuId: result.FstIDSeleted,
-            fstMenuList: result.data.map(smenu => {
-              let _smenu = {
-                MenuID: smenu.FstID,
-                text: smenu.FstName,
-                options: smenu.SndData.map(menu => {
-                  return {
-                    MenuID: menu.SndID,
-                    text: menu.SndName,
-                  }
-                })
-              }
-  
-              return _smenu
-            })
-          })
-        } else {
-          notification.warning({
-            top: 92,
-            message: result.message,
-            duration: 10
-          })
-        }
-        resolve()
-      })
-    })
-
-    let roleDefer = new Promise(resolve => {
-      Api.getSystemConfig({func: 'sPC_Get_RolesMenu'}).then(res => {
-        if (res.status) {
-          this.setState({
-            roleList: res.Roles.map(role => {
-              return {
-                uuid: Utils.getuuid(),
-                value: role.RoleID,
-                text: role.RoleName
-              }
-            })
-          })
-        } else {
-          notification.warning({
-            top: 92,
-            message: res.message,
-            duration: 10
-          })
-        }
-        resolve()
-      })
-    })
-    
-    Promise.all([menuDefer, roleDefer]).then(() => {
-      this.setState({
-        loading: false
-      }, () => {
-        let _menu = JSON.parse(JSON.stringify(this.state.editMenu))
-
-        if (!_menu || !_menu.loadingFstMenuId) {
-          return
-        }
-
-        delete _menu.loadingFstMenuId
-        _menu.fstMenuId = this.state.fstMenuId
-        _menu.fstMenuList = this.state.fstMenuList
-        _menu.roleList = this.state.roleList || []
-
+    Api.getSystemConfig(_param).then(result => {
+      if (result.status) {
         this.setState({
-          type: 'edit',
-          editMenu: _menu,
           loading: false,
-          optionLibs: new Map(), // 缂栬緫鏃讹紝鍒濆鍖栦负绌�
-          tabview: _menu.PageParam.Template
+          fstMenuId: result.FstIDSeleted,
+          fstMenuList: result.data.map(smenu => {
+            let _smenu = {
+              MenuID: smenu.FstID,
+              text: smenu.FstName,
+              options: smenu.SndData.map(menu => {
+                return {
+                  MenuID: menu.SndID,
+                  text: menu.SndName,
+                }
+              })
+            }
+
+            return _smenu
+          })
         }, () => {
-          document.getElementById('root').style.overflowY = 'hidden'
+          let _menu = JSON.parse(JSON.stringify(this.state.editMenu))
+  
+          if (!_menu || !_menu.loadingFstMenuId) {
+            return
+          }
+  
+          delete _menu.loadingFstMenuId
+          _menu.fstMenuId = this.state.fstMenuId
+          _menu.fstMenuList = this.state.fstMenuList
+  
+          this.setState({
+            type: 'edit',
+            editMenu: _menu,
+            loading: false,
+            optionLibs: new Map(), // 缂栬緫鏃讹紝鍒濆鍖栦负绌�
+            tabview: _menu.PageParam.Template
+          }, () => {
+            document.getElementById('root').style.overflowY = 'hidden'
+          })
         })
-      })
+      } else {
+        this.setState({
+          loading: false
+        })
+        notification.warning({
+          top: 92,
+          message: result.message,
+          duration: 10
+        })
+      }
     })
   }
 

--
Gitblit v1.8.0