king
2020-08-11 04b5222fcf0c8f24b3a577cf3a05fb57462982a5
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
@@ -1,5 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { Form, Tabs, Row, Col, Input, Button, Table, Popconfirm, Icon, Tooltip, notification, Modal, message, InputNumber, Radio, Typography } from 'antd'
import moment from 'moment'
@@ -218,10 +219,43 @@
  }
  UNSAFE_componentWillMount() {
    let _verify = this.props.card.verify || {}
    _verify = JSON.parse(JSON.stringify(_verify))
    const { columns, card } = this.props
    let _verify = fromJS(card.verify || {}).toJS()
    let _columns = _verify.columns || []
    // 同步显示列
    if (_columns.length === 0) {
      columns.forEach(col => {
        if (!col.field) return
        let _type = 'Nvarchar(50)'
        let _limit = '50'
        if (col.type === 'number' && !col.decimal) {
          _type = 'Int'
          _limit = ''
        } else if (col.type === 'number') {
          _type = 'Decimal(18,' + col.decimal + ')'
          _limit = col.decimal
        }
        let _cell = {
          uuid: col.uuid,
          Column: col.field,
          Text: col.label,
          type: _type,
          limit: _limit,
          import: 'true',
          required: 'true'
        }
        if (_type !== 'Nvarchar(50)') {
          _cell.min = 0
          _cell.max = 999999
        }
        _columns.push(_cell)
      })
    } else {
      // 旧数据兼容
    _columns = _columns.map(col => {
      col.required = col.required || 'true'
      col.type = col.type || 'Nvarchar(50)'
@@ -236,6 +270,7 @@
      return col
    })
    }
    this.setState({
      verify: {