| | |
| | | queryField = () => { |
| | | const { type, config, tableFields } = this.props |
| | | // 判断是否已选择表名 |
| | | if (!config.tables || config.tables.length === 0) { |
| | | if (!tableFields || tableFields.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择表名!', |
| | |
| | | resourceType: '0', |
| | | setAll: 'false', |
| | | options: [], |
| | | dataSource: '', |
| | | linkField: '', |
| | | valueField: '', |
| | | valueText: '', |
| | | orderBy: '', |
| | | orderType: 'asc', |
| | | match: _match, |
| | | display: 'dropdown' |
| | |
| | | IsSort: item.type === 'picture' ? 'false' : 'true', |
| | | type: item.type, |
| | | Width: 120 |
| | | } |
| | | |
| | | if (item.type === 'number') { |
| | | newcard.decimal = item.decimal |
| | | } else { |
| | | newcard.fieldlength = item.length || 50 |
| | | } |
| | | |
| | | items.push(newcard) |
| | |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | /** |
| | |
| | | const { type } = this.props |
| | | const { dict, fields } = this.state |
| | | |
| | | let label = '' |
| | | if (type === 'search') { |
| | | label = dict['header.menu.search.add'] |
| | | } else if (type === 'columns') { |
| | | label = dict['model.menu.column.add'] |
| | | } else if (type === 'fields') { |
| | | label = dict['model.menu.field.add'] |
| | | } |
| | | |
| | | return ( |
| | | <div className="quickly-add"> |
| | | <Button type="primary" block onClick={this.queryField}>{label}</Button> |
| | | <Button type="primary" block onClick={this.queryField}>{dict['model.batchAdd']}</Button> |
| | | {/* 根据字段名添加显示列及搜索条件 */} |
| | | <Modal |
| | | wrapClassName="model-table-fieldmanage-modal" |