king
2023-05-09 7b0dbecd1d6155d26ec67be0a47a16264c738c85
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
@@ -122,7 +122,7 @@
      {
        title: '报错编码',
        dataIndex: 'errorCode',
        width: '12%',
        width: '10%',
        editable: true,
        inputType: 'select',
        options: [
@@ -135,13 +135,24 @@
      {
        title: '验证类型',
        dataIndex: 'verifyType',
        width: '12%',
        render: (text, record) => record.verifyType === 'logic' ? '逻辑验证' : '物理验证',
        width: '14%',
        render: (text, record) => {
          let names = {
            physical: '物理验证(全量验证)',
            logic: '逻辑验证(全量验证)',
            physical_temp: '物理验证(仅临时表)',
            logic_temp: '逻辑验证(仅临时表)',
          }
          return names[text] || '物理验证(全量验证)'
        },
        inputType: 'select',
        editable: true,
        options: [
          { value: 'physical', text: '物理验证' },
          { value: 'logic', text: '逻辑验证' }
          { value: 'physical', text: '物理验证(全量验证)' },
          { value: 'logic', text: '逻辑验证(全量验证)' },
          { value: 'physical_temp', text: '物理验证(仅临时表)' },
          { value: 'logic_temp', text: '逻辑验证(仅临时表)' }
        ]
      },
      {
@@ -239,15 +250,22 @@
  UNSAFE_componentWillMount() {
    const { card } = this.props
    let _verify = fromJS(card.verify || {range: 1}).toJS()
    let _verify = fromJS(card.verify || {}).toJS()
    let _columns = _verify.columns || []
    delete _verify.dataresource
    // 旧数据兼容
    _columns = _columns.map(col => {
      col.required = col.required || 'true'
      col.type = col.type || 'Nvarchar(50)'
      col.import = col.import || 'true'
      col.required = col.required || 'true'
      if (col.type === 'text' || col.type === 'image') {
        col.type = 'Nvarchar(50)'
      } else if (col.type === 'number') {
        col.type = 'Decimal(18,2)'
      }
      
      if (/^Nvarchar/ig.test(col.type)) {
        col.limit = col.type.match(/\d+/)[0]
@@ -259,6 +277,10 @@
      return col
    })
    if (!_verify.hasOwnProperty('range')) {
      _verify.range = 1
    }
    this.setState({
      verify: {
@@ -353,7 +375,7 @@
    let _columns = JSON.parse(JSON.stringify(verify.columns))
    let _cols = _columns.map(col => col.Column )
    let _cols = _columns.map(col => col.Column)
    columns.forEach(col => {
      if (col.field && !_cols.includes(col.field)) {
@@ -443,6 +465,13 @@
    const { verify } = this.state
    columns = columns.map(col => {
      col.type = col.type || 'Nvarchar(50)'
      if (col.type === 'text' || col.type === 'image') {
        col.type = 'Nvarchar(50)'
      } else if (col.type === 'number') {
        col.type = 'Decimal(18,2)'
      }
      if (/^Nvarchar/ig.test(col.type)) {
        col.limit = col.type.match(/\d+/) ? col.type.match(/\d+/)[0] : '20000'
      } else if (/^Decimal/ig.test(col.type)) {
@@ -453,6 +482,9 @@
      } else {
        col.limit = ''
      }
      col.required = col.required || 'true'
      col.import = col.import || 'true'
      return col
    })
@@ -741,13 +773,18 @@
            <Form {...formItemLayout}>
              <Row gutter={24}>
                <Col span={8}>
                  <Form.Item label="表名">
                  <Form.Item label={
                    <Tooltip placement="bottomLeft" title="导入时工作表名与excel中必须一致,注:工作表名为Sheet1且excel中仅有一个工作表时不进行表名验证。">
                      <QuestionCircleOutlined className="mk-form-tip" />
                      工作表
                    </Tooltip>
                  }>
                    {getFieldDecorator('sheet', {
                      initialValue: verify.sheet || '',
                      rules: [
                        {
                          required: true,
                          message: '请输入表名!'
                          message: '请输入工作表名!'
                        }
                      ]
                    })(<Input placeholder="" autoComplete="off" />)}