| | |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | menu: PropTypes.any, // 搜索条件列表 |
| | | dict: PropTypes.object, // 字典项 |
| | | type: PropTypes.string // 字典项 |
| | | menu: PropTypes.any, // 菜单信息,新建时为null |
| | | dict: PropTypes.object, // 字典项 |
| | | type: PropTypes.string, // 操作类型 |
| | | inputSubmit: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | |
| | | 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> |
| | | ) |
| | |
| | | showSearch |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | onChange={(value) => {this.openTypeChange(item.key, value)}} |
| | | getPopupContainer={() => document.getElementById('form-box')} |
| | | getPopupContainer={() => document.getElementById('first-menu-form-box')} |
| | | > |
| | | {item.options.map(option => |
| | | <Select.Option key={option.id} value={option.id}>{option.text}</Select.Option> |
| | |
| | | }) |
| | | } |
| | | |
| | | 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="first-menu-form-box" onKeyDown={this.onEnterSubmit}> |
| | | <Row gutter={24}>{this.getFields()}</Row> |
| | | </Form> |
| | | ) |