king
2021-03-03 6c56a138c17dc9aff9d175d20645eb176d2e024b
src/menu/components/tabs/tablabelform/index.jsx
@@ -12,10 +12,21 @@
    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 = () => {
@@ -42,6 +53,7 @@
  render() {
    const { tab } = this.props
    const { getFieldDecorator } = this.props.form
    const { roleList } = this.state
    const formItemLayout = {
      labelCol: {
@@ -85,6 +97,23 @@
              )}
            </Form.Item>
          </Col>
          <Col span={24}>
            <Form.Item label="黑名单">
              {getFieldDecorator('blacklist', {
                initialValue: tab.blacklist || []
              })(
                <Select
                  showSearch
                  mode="multiple"
                  filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                >
                  {roleList.map(option =>
                    <Select.Option key={option.uuid} value={option.value}>{option.text}</Select.Option>
                  )}
                </Select>
              )}
            </Form.Item>
          </Col>
        </Row>
      </Form>
    )