king
2021-06-02 e543372cc70a19ff2630c79d8421c2c593e54e5f
src/menu/components/tabs/tabsetting/settingform/index.jsx
@@ -8,14 +8,27 @@
  static propTpyes = {
    dict: PropTypes.object,       // 字典项
    setting: PropTypes.object,    // 数据源配置
    sysRoles: PropTypes.array,    // 角色列表
    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 = () => {
@@ -40,8 +53,9 @@
  }
  render() {
    const { setting, sysRoles } = this.props
    const { setting } = this.props
    const { getFieldDecorator } = this.props.form
    const { roleList, appType } = this.state
    const formItemLayout = {
      labelCol: {
@@ -108,7 +122,7 @@
                )}
              </Form.Item>
            </Col>
            <Col span={12}>
            {appType !== 'mob' ? <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="标签位置为top时有效,默认值为line。">
                  <Icon type="question-circle" />
@@ -124,7 +138,7 @@
                  </Radio.Group>
                )}
              </Form.Item>
            </Col>
            </Col> : null}
            <Col span={12}>
              <Form.Item label="黑名单">
                {getFieldDecorator('blacklist', {
@@ -135,7 +149,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>