From 0bff15b120b3e3ff1f1c3d2ce4d9aa8d3ad3917e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 06 十一月 2020 13:49:44 +0800 Subject: [PATCH] 2020-11-06 --- src/menu/components/tabs/tabsetting/settingform/index.jsx | 32 +++++++++++++++++++++++++++++--- 1 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/menu/components/tabs/tabsetting/settingform/index.jsx b/src/menu/components/tabs/tabsetting/settingform/index.jsx index 76976c4..818ea3f 100644 --- a/src/menu/components/tabs/tabsetting/settingform/index.jsx +++ b/src/menu/components/tabs/tabsetting/settingform/index.jsx @@ -8,6 +8,8 @@ static propTpyes = { dict: PropTypes.object, // 瀛楀吀椤� setting: PropTypes.object, // 鏁版嵁婧愰厤缃� + sysRoles: PropTypes.array, // 瑙掕壊鍒楄〃 + inputSubmit: PropTypes.func // 鍥炶溅浜嬩欢 } state = {} @@ -29,9 +31,16 @@ }) } + handleSubmit = (e) => { + e.preventDefault() + + if (this.props.inputSubmit) { + this.props.inputSubmit() + } + } render() { - const { setting } = this.props + const { setting, sysRoles } = this.props const { getFieldDecorator } = this.props.form const formItemLayout = { @@ -64,7 +73,7 @@ message: this.props.dict['form.required.input'] + '缁勪欢鍚嶇О!' } ] - })(<Input placeholder={''} autoComplete="off" />)} + })(<Input placeholder={''} autoComplete="off" onPressEnter={this.handleSubmit}/>)} </Form.Item> </Col> <Col span={12}> @@ -82,7 +91,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}> @@ -116,6 +125,23 @@ )} </Form.Item> </Col> + <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} + > + {sysRoles.map(option => + <Select.Option key={option.uuid} value={option.value}>{option.text}</Select.Option> + )} + </Select> + )} + </Form.Item> + </Col> </Row> </Form> </div> -- Gitblit v1.8.0