From 1ed3cfb3778e13904839e9729cb5b4ce9f5c905d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 08 六月 2020 09:12:51 +0800
Subject: [PATCH] 2020-06-08

---
 src/tabviews/rolemanage/index.jsx |   80 +++++++++++++++++++++++++++------------
 1 files changed, 55 insertions(+), 25 deletions(-)

diff --git a/src/tabviews/rolemanage/index.jsx b/src/tabviews/rolemanage/index.jsx
index 8262f33..85a4fe4 100644
--- a/src/tabviews/rolemanage/index.jsx
+++ b/src/tabviews/rolemanage/index.jsx
@@ -373,7 +373,7 @@
   /**
    * @description 鎻愪氦宸查�夌殑鏉冮檺
    */
-  roleSubmit = async () => {
+  roleSubmit = () => {
     const { checkedKeys, halfCheckedKeys, selectRoleId, initCheckKeys } = this.state
 
     let _keys = []
@@ -401,34 +401,64 @@
       })
     }
 
+    let localParam = fromJS(param).toJS()
+    localParam.func = 's_rolemenu_sub_local'
+
     this.setState({
       submitloading: true
     })
 
-    let result = await Api.getSystemConfig(param)
-
-    if (result.status) {
-      notification.success({
-        top: 92,
-        message: '淇濆瓨鎴愬姛',
-        duration: 2
-      })
-      this.setState({
-        submitloading: false,
-        loadingTree: true
-      }, () => {
-        this.getSelectMenuList()
-      })
-    } else {
-      this.setState({
-        submitloading: false
-      })
-      notification.warning({
-        top: 92,
-        message: result.message,
-        duration: 5
-      })
-    }
+    Api.getSystemConfig(param).then(result => {
+      if (result.status) {
+        if (!window.GLOB.mainSystemApi) {
+          notification.success({
+            top: 92,
+            message: '淇濆瓨鎴愬姛',
+            duration: 2
+          })
+          this.setState({
+            submitloading: false,
+            loadingTree: true
+          }, () => {
+            this.getSelectMenuList()
+          })
+        } else {
+          Api.getLocalConfig(localParam).then(res => {
+            if (res.status) {
+              notification.success({
+                top: 92,
+                message: '淇濆瓨鎴愬姛',
+                duration: 2
+              })
+              this.setState({
+                submitloading: false,
+                loadingTree: true
+              }, () => {
+                this.getSelectMenuList()
+              })
+            } else {
+              this.setState({
+                submitloading: false
+              })
+              notification.warning({
+                top: 92,
+                message: res.message,
+                duration: 5
+              })
+            }
+          })
+        }
+      } else {
+        this.setState({
+          submitloading: false
+        })
+        notification.warning({
+          top: 92,
+          message: result.message,
+          duration: 5
+        })
+      }
+    })
   }
 
   UNSAFE_componentWillMount () {

--
Gitblit v1.8.0