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/tabs/tabsetting/settingform/index.jsx | 25 +++++++++++++++++++++---- 1 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/menu/components/tabs/tabsetting/settingform/index.jsx b/src/menu/components/tabs/tabsetting/settingform/index.jsx index c82dd8c..6362d5a 100644 --- a/src/menu/components/tabs/tabsetting/settingform/index.jsx +++ b/src/menu/components/tabs/tabsetting/settingform/index.jsx @@ -8,11 +8,27 @@ 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 = () => { // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� @@ -36,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: { @@ -131,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