king
2020-11-10 5df578ff69f6b02e821d59a8883bc75d78695a62
src/templates/sharecomponent/fieldscomponent/index.jsx
@@ -27,7 +27,7 @@
  queryField = () => {
    const { type, config, tableFields } = this.props
    // 判断是否已选择表名
    if (!config.tables || config.tables.length === 0) {
    if (!tableFields || tableFields.length === 0) {
      notification.warning({
        top: 92,
        message: '请选择表名!',
@@ -145,11 +145,6 @@
            resourceType: '0',
            setAll: 'false',
            options: [],
            dataSource: '',
            linkField: '',
            valueField: '',
            valueText: '',
            orderBy: '',
            orderType: 'asc',
            match: _match,
            display: 'dropdown'
@@ -185,6 +180,12 @@
            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)
@@ -254,7 +255,7 @@
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
    return !is(fromJS(this.state), fromJS(nextState))
  }
  /**
@@ -270,18 +271,9 @@
    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"