king
2020-11-25 42fae277ae5ebe794fc070bf38482a919eb661fc
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>