From 42fae277ae5ebe794fc070bf38482a919eb661fc Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 25 十一月 2020 14:36:02 +0800
Subject: [PATCH] 2020-11-25

---
 src/menu/components/search/main-search/wrapsetting/settingform/index.jsx |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/src/menu/components/search/main-search/wrapsetting/settingform/index.jsx b/src/menu/components/search/main-search/wrapsetting/settingform/index.jsx
index 03954cf..9d728db 100644
--- a/src/menu/components/search/main-search/wrapsetting/settingform/index.jsx
+++ b/src/menu/components/search/main-search/wrapsetting/settingform/index.jsx
@@ -8,12 +8,27 @@
   static propTpyes = {
     dict: PropTypes.object,      // 瀛楀吀椤�
     wrap: PropTypes.object,      // 鏁版嵁婧愰厤缃�
-    sysRoles: PropTypes.array,   // 瑙掕壊鍒楄〃
     inputSubmit: PropTypes.func  // 鍥炶溅浜嬩欢
   }
 
   state = {
-    float: this.props.wrap.float
+    float: this.props.wrap.float,
+    roleList: []
+  }
+
+  UNSAFE_componentWillMount () {
+    let roleList = sessionStorage.getItem('sysRoles')
+    if (roleList) {
+      try {
+        roleList = JSON.parse(roleList)
+      } catch {
+        roleList = []
+      }
+    } else {
+      roleList = []
+    }
+
+    this.setState({roleList})
   }
 
   handleConfirm = () => {
@@ -38,9 +53,9 @@
   }
 
   render() {
-    const { wrap, sysRoles } = this.props
+    const { wrap } = this.props
     const { getFieldDecorator } = this.props.form
-    const { float } = this.state
+    const { float, roleList } = this.state
 
     const formItemLayout = {
       labelCol: {
@@ -132,7 +147,7 @@
                     mode="multiple"
                     filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                   >
-                    {sysRoles.map(option =>
+                    {roleList.map(option =>
                       <Select.Option key={option.uuid} value={option.value}>{option.text}</Select.Option>
                     )}
                   </Select>

--
Gitblit v1.8.0