| | |
| | | }; |
| | | |
| | | render() { |
| | | const { formData = {}, data = [], children } = this.props; |
| | | const { formData = {}, data = [], children, width = "25%" } = this.props; |
| | | let size = 'default'; |
| | | |
| | | return ( |
| | | <div className="search-form-view-main"> |
| | |
| | | |
| | | {data.length > 0 && |
| | | data.map((item, idx) => ( |
| | | <Card.Grid key={idx} style={{ width: '20%' }} hoverable={false} > |
| | | <Card.Grid key={idx} style={{ width }} hoverable={false} > |
| | | {(() => { |
| | | switch (item.type) { |
| | | case 'select': |
| | | return ( |
| | | <Form.Item label={item.label}> |
| | | <Select |
| | | size="small" |
| | | size={size} |
| | | style={{ width: '100%' }} |
| | | placeholder={item.name} |
| | | value={formData[item.key]} |
| | |
| | | return ( |
| | | <Form.Item label={item.label}> |
| | | <Input |
| | | size="small" |
| | | size={size} |
| | | placeholder={item.name} |
| | | name={item.key} |
| | | value={formData[item.key]} |
| | |
| | | return ( |
| | | <Form.Item label={item.label}> |
| | | <DatePicker |
| | | size="small" |
| | | size={size} |
| | | style={{ width: '100%' }} |
| | | placeholder={item.name} |
| | | onChange={(date, dateString) => { |
| | |
| | | return ( |
| | | <Form.Item label={item.label}> |
| | | <RangePicker |
| | | style={{ width: '100%'}} |
| | | size="small" |
| | | style={{ width: '100%' }} |
| | | size={size} |
| | | ranges={{ |
| | | Today: [moment(), moment()], |
| | | 'This Month': [ |
| | |
| | | })()} |
| | | </Card.Grid> |
| | | ))} |
| | | <Card.Grid style={{ width: '20%' }}> |
| | | <Card.Grid style={{ width }}> |
| | | <Row type="flex" gutter={20} align="middle" align="middle" style={{ height: 40 }}> |
| | | <Col> |
| | | <Button |
| | | size="small" |
| | | size={size} |
| | | type="primary" |
| | | onClick={() => { |
| | | this.onClick('search'); |
| | |
| | | </Col> |
| | | <Col> |
| | | <Button |
| | | size="small" |
| | | size={size} |
| | | onClick={() => { |
| | | this.onClick('reset'); |
| | | }}> |