| | |
| | | resetSearch = (result) => { |
| | | let _searchlist = this.state.searchlist.map(item => { |
| | | if (['select', 'link', 'multiselect', 'checkcard'].includes(item.type) && result[item.field] && result[item.field].length > 0) { |
| | | let options = result[item.field].map(cell => { |
| | | let options = [] |
| | | result[item.field].forEach(cell => { |
| | | let _item = { |
| | | key: Utils.getuuid() |
| | | } |
| | |
| | | if (item.type !== 'checkcard') { |
| | | _item.Value = cell[item.valueField] |
| | | _item.Text = cell[item.valueText] |
| | | if (!_item.Text && _item.Text !== 0) { |
| | | return |
| | | } |
| | | } else { |
| | | _item.$value = cell[item.cardValField] |
| | | _item = {..._item, ...cell} |
| | |
| | | _item.ParentID = cell[item.linkField] |
| | | } |
| | | |
| | | return _item |
| | | options.push(_item) |
| | | }) |
| | | |
| | | item.oriOptions = [...item.oriOptions, ...options] |
| | |
| | | |
| | | getFields() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const { dict, showButton, showAdvanced, float } = this.state |
| | | const { dict, showButton, showAdvanced, float, visible } = this.state |
| | | const fields = [] |
| | | |
| | | this.state.searchlist.forEach((item, index) => { |
| | |
| | | |
| | | if (item.type === 'text') { |
| | | if (item.inputType === 'search') { |
| | | content = <Search placeholder={item.labelShow === 'false' ? item.label : ''} autoComplete="off" onSearch={this.handleSubmit} enterButton/> |
| | | content = <Search allowClear placeholder={item.labelShow === 'false' ? item.label : ''} autoComplete="off" onSearch={this.handleSubmit} enterButton/> |
| | | } else { |
| | | content = <Input placeholder={item.labelShow === 'false' ? item.label : ''} autoComplete="off" onPressEnter={this.handleSubmit} /> |
| | | content = <Input allowClear placeholder={item.labelShow === 'false' ? item.label : ''} autoComplete="off" onPressEnter={this.handleSubmit} /> |
| | | } |
| | | } else if (item.type === 'select' || item.type === 'link' || item.type === 'multiselect') { |
| | | content = (<MKSelect config={item} onChange={(val, defer) => this.recordChange(val, defer, item)} />) |
| | |
| | | <Button style={{ marginLeft: 8 }} onClick={this.handleReset}> |
| | | {dict['main.reset']} |
| | | </Button> |
| | | {showAdvanced ? <Button type="link" onClick={this.handleAdvance}> |
| | | {showAdvanced && !visible ? <Button type="link" onClick={this.handleAdvance}> |
| | | 高级 |
| | | </Button> : null} |
| | | </Form.Item> |