| | |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | formlist: PropTypes.array |
| | | dict: PropTypes.object, // 字典项 |
| | | formlist: PropTypes.array, |
| | | inputSubmit: PropTypes.func |
| | | } |
| | | |
| | | openTypeChange = (key, value) => { |
| | |
| | | message: this.props.dict['form.required.input'] + item.label + '!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)} |
| | | })(<Input placeholder="" autoFocus={item.key.toLowerCase() === 'menuname'} autoComplete="off" disabled={item.readonly} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | |
| | | }) |
| | | } |
| | | |
| | | onEnterSubmit = (e) => { |
| | | // 表单回车提交 |
| | | if (e.key !== 'Enter') return |
| | | |
| | | this.props.inputSubmit && this.props.inputSubmit() |
| | | } |
| | | |
| | | render() { |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | } |
| | | } |
| | | return ( |
| | | <Form {...formItemLayout} className="ant-advanced-search-form" id="form-box"> |
| | | <Form {...formItemLayout} className="ant-advanced-search-form" id="form-box" onKeyDown={this.onEnterSubmit}> |
| | | <Row gutter={24}>{this.getFields()}</Row> |
| | | </Form> |
| | | ) |