| | |
| | | selectCards.forEach(item => { |
| | | let _match = '' |
| | | let initval = '' |
| | | if (item.type === 'select') { |
| | | let _type = item.type |
| | | if (item.type === 'date') { |
| | | _type = 'daterange' |
| | | } else if (item.type === 'select') { |
| | | _match = '=' |
| | | } else { |
| | | item.type = 'text' |
| | | _type = 'text' |
| | | _match = 'like' |
| | | } |
| | | |
| | |
| | | label: item.label, |
| | | field: item.field, |
| | | initval: initval, |
| | | type: item.type, |
| | | type: _type, |
| | | resourceType: '0', |
| | | options: [], |
| | | orderType: 'asc', |
| | |
| | | field: item.field, |
| | | datatype: _t |
| | | } |
| | | items.push(newcard) |
| | | items.unshift(newcard) |
| | | keys.push(item.field.toLowerCase()) |
| | | }) |
| | | |
| | |
| | | |
| | | if (item.type === 'text' && item.length >= 256) { |
| | | newcard.type = 'textarea' |
| | | newcard.required = 'false' |
| | | newcard.fieldlength = item.length |
| | | if (firstItem) { |
| | | if (firstItem.type === newcard.type) { |
| | |
| | | const { type } = this.props |
| | | const { fields } = this.state |
| | | |
| | | let label = '批量添加' |
| | | if (type === 'search') { |
| | | label = '添加搜索' |
| | | } else if (type === 'columns') { |
| | | label = '添加显示列' |
| | | } |
| | | |
| | | return ( |
| | | <div className="quickly-add"> |
| | | <Button type="primary" block onClick={this.queryField}>批量添加</Button> |
| | | <Button type="primary" block onClick={this.queryField}>{label}</Button> |
| | | {/* 根据字段名添加显示列及搜索条件 */} |
| | | <Modal |
| | | wrapClassName="model-table-fieldmanage-modal" |