king
2020-01-19 b15a4427ee710576dbdcc4ed932b38f1b47257e3
src/tabviews/tableshare/mutilform/index.jsx
@@ -201,15 +201,15 @@
    })
  }
  handleInputNumber = (rule, value, callback, item) => {
    if (item.required === 'true' && (!value && value !== 0)) {
      callback()
    } else if ((item.min || item.min === 0) && (value || value === 0) && value < item.min) {
      callback(item.label + '最小值为' + item.min + '!')
    } else if ((item.max || item.max === 0) && (value || value === 0) && value > item.max) {
      callback(item.label + '最大值为' + item.max + '!')
    }
  }
  // handleInputNumber = (rule, value, callback, item) => {
  //   if (item.required === 'true' && (!value && value !== 0)) {
  //     callback(this.props.dict['form.required.input'] + item.label + '!')
  //   } else if ((item.min || item.min === 0) && (value || value === 0) && value < item.min) {
  //     callback(item.label + '最小值为' + item.min + '!')
  //   } else if ((item.max || item.max === 0) && (value || value === 0) && value > item.max) {
  //     callback(item.label + '最大值为' + item.max + '!')
  //   }
  // }
  getFields() {
    const { getFieldDecorator } = this.props.form
@@ -257,12 +257,6 @@
        let max = (item.max || item.max === 0) ? item.max : Infinity
        let _initval = item.initval
        let precision = (item.decimal || item.decimal === 0) ? item.decimal : null
        let rules = []
        if ((item.min || item.min === 0) || (item.max || item.max === 0)) {
          rules.push({
            validator: (rule, value, callback) => {this.handleInputNumber(rule, value, callback, item)}
          })
        }
        
        fields.push(
          <Col span={24 / cols} key={index}>
@@ -273,8 +267,7 @@
                  {
                    required: item.required === 'true',
                    message: this.props.dict['form.required.input'] + item.label + '!'
                  },
                  ...rules
                  }
                ]
              })(
                precision === null ?