From e543372cc70a19ff2630c79d8421c2c593e54e5f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 02 六月 2021 17:15:21 +0800
Subject: [PATCH] 2021-06-02

---
 src/menu/components/tabs/tabsetting/settingform/index.jsx |   50 +++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 45 insertions(+), 5 deletions(-)

diff --git a/src/menu/components/tabs/tabsetting/settingform/index.jsx b/src/menu/components/tabs/tabsetting/settingform/index.jsx
index 8e99efa..a4aeb33 100644
--- a/src/menu/components/tabs/tabsetting/settingform/index.jsx
+++ b/src/menu/components/tabs/tabsetting/settingform/index.jsx
@@ -8,12 +8,27 @@
   static propTpyes = {
     dict: PropTypes.object,       // 瀛楀吀椤�
     setting: PropTypes.object,    // 鏁版嵁婧愰厤缃�
+    inputSubmit: PropTypes.func   // 鍥炶溅浜嬩欢
   }
 
-  state = {}
+  state = {
+    appType: sessionStorage.getItem('appType'),
+    roleList: []
+  }
 
   UNSAFE_componentWillMount () {
+    let roleList = sessionStorage.getItem('sysRoles')
+    if (roleList) {
+      try {
+        roleList = JSON.parse(roleList)
+      } catch {
+        roleList = []
+      }
+    } else {
+      roleList = []
+    }
 
+    this.setState({roleList})
   }
 
   handleConfirm = () => {
@@ -29,10 +44,18 @@
     })
   }
 
+  handleSubmit = (e) => {
+    e.preventDefault()
+
+    if (this.props.inputSubmit) {
+      this.props.inputSubmit()
+    }
+  }
 
   render() {
     const { setting } = this.props
     const { getFieldDecorator } = this.props.form
+    const { roleList, appType } = this.state
 
     const formItemLayout = {
       labelCol: {
@@ -64,12 +87,12 @@
                       message: this.props.dict['form.required.input'] + '缁勪欢鍚嶇О!'
                     }
                   ]
-                })(<Input placeholder={''} autoComplete="off" />)}
+                })(<Input placeholder={''} autoComplete="off" onPressEnter={this.handleSubmit}/>)}
               </Form.Item>
             </Col>
             <Col span={12}>
               <Form.Item label={
-                <Tooltip placement="topLeft" title="鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒�24浠姐��">
+                <Tooltip placement="topLeft" title="鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��">
                   <Icon type="question-circle" />
                   瀹藉害
                 </Tooltip>
@@ -82,7 +105,7 @@
                       message: this.props.dict['form.required.input'] + '瀹藉害!'
                     }
                   ]
-                })(<InputNumber min={1} max={24} precision={0} />)}
+                })(<InputNumber min={1} max={24} precision={0} onPressEnter={this.handleSubmit}/>)}
               </Form.Item>
             </Col>
             <Col span={12}>
@@ -99,7 +122,7 @@
                 )}
               </Form.Item>
             </Col>
-            <Col span={12}>
+            {appType !== 'mob' ? <Col span={12}>
               <Form.Item label={
                 <Tooltip placement="topLeft" title="鏍囩浣嶇疆涓簍op鏃舵湁鏁堬紝榛樿鍊间负line銆�">
                   <Icon type="question-circle" />
@@ -115,6 +138,23 @@
                   </Radio.Group>
                 )}
               </Form.Item>
+            </Col> : null}
+            <Col span={12}>
+              <Form.Item label="榛戝悕鍗�">
+                {getFieldDecorator('blacklist', {
+                  initialValue: setting.blacklist || []
+                })(
+                  <Select
+                    showSearch
+                    mode="multiple"
+                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
+                  >
+                    {roleList.map(option =>
+                      <Select.Option key={option.uuid} value={option.value}>{option.text}</Select.Option>
+                    )}
+                  </Select>
+                )}
+              </Form.Item>
             </Col>
           </Row>
         </Form>

--
Gitblit v1.8.0