content: import React from 'react'
  import PropTypes from 'prop-types'
  import { Form, Button, Row, Col, Icon } from 'antd'
  import SearchGroup from 'components/Search'
  
  const Search = ({
    field,
    keyword,
    addPower,
    onSearch,
    onAdd,
  }) => {
    const searchGroupProps = {
      field,
      keyword,
      size: 'large',
      select: true,
      selectOptions: [{ value: 'name', name: '用户名' }, { value: 'mobile', name: '手机号' }, { value: 'email', name: '邮箱' }],
      selectProps: {
        defaultValue: field || 'name',
      },
      onSearch: (value) => {
        onSearch(value)
      },
    }
  
    return (
      <Row gutter={24}>
        <Col lg={8} md={12} sm={16} xs={24} style={{ marginBottom: 16 }}>
          <SearchGroup {...searchGroupProps} />
        </Col>
        {addPower &&
        <Col lg={{ offset: 8, span: 8 }} md={12} sm={8} xs={24} style={{ marginBottom: 16, textAlign: 'right' }}>
          <Button size="large" type="ghost" onClick={onAdd}><Icon type="plus-circle-o" />添加</Button>
        </Col>}
      </Row>
    )
  }
  
  Search.propTypes = {
    form: PropTypes.object.isRequired,
    onSearch: PropTypes.func,
    onAdd: PropTypes.func,
    field: PropTypes.string,
    keyword: PropTypes.string,
    addPower: PropTypes.bool.isRequired,
  }
  
  export default Form.create()(Search)
  