From ecbe0dc46ce2b8f607b9afd063104adeb7f10fe8 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 30 三月 2021 15:19:31 +0800 Subject: [PATCH] 2021-03-30 --- src/menu/components/tabs/tabsetting/settingform/index.jsx | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/menu/components/tabs/tabsetting/settingform/index.jsx b/src/menu/components/tabs/tabsetting/settingform/index.jsx index 818ea3f..6362d5a 100644 --- a/src/menu/components/tabs/tabsetting/settingform/index.jsx +++ b/src/menu/components/tabs/tabsetting/settingform/index.jsx @@ -8,14 +8,26 @@ static propTpyes = { dict: PropTypes.object, // 瀛楀吀椤� setting: PropTypes.object, // 鏁版嵁婧愰厤缃� - sysRoles: PropTypes.array, // 瑙掕壊鍒楄〃 inputSubmit: PropTypes.func // 鍥炶溅浜嬩欢 } - state = {} + state = { + roleList: [] + } UNSAFE_componentWillMount () { + let roleList = sessionStorage.getItem('sysRoles') + if (roleList) { + try { + roleList = JSON.parse(roleList) + } catch { + roleList = [] + } + } else { + roleList = [] + } + this.setState({roleList}) } handleConfirm = () => { @@ -40,8 +52,9 @@ } render() { - const { setting, sysRoles } = this.props + const { setting } = this.props const { getFieldDecorator } = this.props.form + const { roleList } = this.state const formItemLayout = { labelCol: { @@ -135,7 +148,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