king
2020-02-17 0594fe8d97286a535177f8ba05972d0305fc7dee
2020-02-17
11个文件已修改
468 ■■■■ 已修改文件
src/tabviews/tableshare/actionList/index.jsx 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/excelin/index.jsx 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/actionform/index.jsx 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/comtableconfig/index.jsx 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/actionform/index.jsx 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/subtableconfig/index.jsx 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/dragelement/card.jsx 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/formconfig.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/verifycard/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/tableshare/verifycardexcelin/index.jsx 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/tableshare/actionList/index.jsx
@@ -118,7 +118,12 @@
      this.refreshdata(item, 'excelOut')
    } else if (item.OpenType === 'excelIn') {
      if (item.verify && item.verify.sheet && item.verify.columns && item.verify.columns.length > 0) {
        this.refs.excelIn.exceltrigger(item)
        let primaryId = '' // 导入时行Id
        if (item.Ot === 'requiredSgl') {
          primaryId = data[0][setting.primaryKey] || ''
        }
        this.refs.excelIn.exceltrigger(item, primaryId)
      } else {
        notification.warning({
          top: 92,
@@ -791,19 +796,35 @@
    })
  }
  getexceldata = (data, btn, errors) => {
    if (errors && errors.length > 0) {
      notification.warning({
        top: 92,
        message: errors.join(',') + '表头设置错误!',
        duration: 10
      })
  getexceldata = (data, btn, errors, primaryId) => {
    if (errors) {
      if (errors === 'notexit') {
        notification.warning({
          top: 92,
          message: '工作表《' + btn.verify.sheet + '》不存在!',
          duration: 10
        })
      } else if (errors === 'empty') {
        notification.warning({
          top: 92,
          message: '工作表《' + btn.verify.sheet + '》为空!',
          duration: 10
        })
      } else if (errors === 'headerError') {
        notification.warning({
          top: 92,
          message: '工作表《' + btn.verify.sheet + '》表头设置错误!',
          duration: 10
        })
      }
      return
    }
    if (!data || data.length === 0) {
      notification.warning({
        top: 92,
        message: '未获取到excel数据!',
        message: '未获取到工作表《' + btn.verify.sheet + '》数据!',
        duration: 10
      })
      return
@@ -820,7 +841,8 @@
    }
    let param = {
      BID: this.props.BID
      BID: this.props.BID,
      ID: primaryId
    }
    param.LText = Utils.formatOptions(result.sql)
src/tabviews/tableshare/excelin/index.jsx
@@ -13,13 +13,15 @@
  state = {
    excelbtn: null,
    primaryId: '', // 行Id
    excelId: Utils.getuuid()
  }
  exceltrigger = (item) => {
  exceltrigger = (item, primaryId) => {
    const { excelId } = this.state
    this.setState({
      excelbtn: item
      excelbtn: item,
      primaryId: primaryId
    })
    let _excelInput = document.getElementById(excelId + this.props.MenuID)
@@ -29,7 +31,7 @@
    }
  }
  onImportExcel = file => {
    const { excelbtn } = this.state
    const { excelbtn, primaryId } = this.state
    let columns = excelbtn.verify.columns.map(option => option.Column)
    let range = excelbtn.verify.range || 0
@@ -44,42 +46,40 @@
        // 以二进制流方式读取得到整份excel表格对象
        const workbook = XLSX.read(result, { type: 'binary' })
        let errors = []
        if (range === 1) {
          workbook.SheetNames.forEach(sheetname => {
            if (workbook.Sheets.hasOwnProperty(sheetname)) {
              let header = XLSX.utils.sheet_to_json(workbook.Sheets[sheetname], {header: columns})[0]
              if (!header) {
                errors.push(sheetname)
              } else {
                let iserror = false
                excelbtn.verify.columns.forEach(op => {
                  if (header[op.Column] !== op.Text) {
                    iserror = true
                  }
                })
        let errors = null
                if (iserror) {
                  errors.push(sheetname)
                }
        if (!workbook.Sheets.hasOwnProperty(excelbtn.verify.sheet)) {
          errors = 'notexit'
        } else if (range === 1) {
          let header = XLSX.utils.sheet_to_json(workbook.Sheets[excelbtn.verify.sheet], {header: columns})[0]
          if (!header) {
            errors = 'empty'
          } else {
            let iserror = false
            excelbtn.verify.columns.forEach(op => {
              if (header[op.Column] !== op.Text) {
                iserror = true
              }
            })
            if (iserror) {
              errors = 'headerError'
            }
          })
          }
        }
        let data = []
        workbook.SheetNames.forEach(sheetname => {
          if (workbook.Sheets.hasOwnProperty(sheetname)) {
            data = data.concat(XLSX.utils.sheet_to_json(workbook.Sheets[sheetname], {header: columns, range: (range)}))
          }
        })
        if (!errors) {
          data = XLSX.utils.sheet_to_json(workbook.Sheets[excelbtn.verify.sheet], {header: columns, range: (range)})
        }
        // 最终获取到并且格式化后的 json 数据
        this.props.returndata(data, excelbtn, errors)
        this.props.returndata(data, excelbtn, errors, primaryId)
        this.setState({
          excelId: ''
          excelId: '',
          primaryId: ''
        }, () => {
          this.setState({
            excelId: Utils.getuuid()
src/templates/comtableconfig/actionform/index.jsx
@@ -108,9 +108,9 @@
      }
    } else if (_opentype === 'excelIn') {    // 导入导出
      if (_intertype === 'outer') {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError']
        _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
      } else {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError']
        _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
      }
    } else {
      if (_intertype === 'outer') {
@@ -131,7 +131,7 @@
        } else if (item.key === 'Ot') {
          if (_opentype === 'innerpage' || _position === 'grid') {
            item.options = this.state.reqOptionSgl
          } else if (['outerpage', 'blank', 'tab', 'popview'].includes(_opentype)) {
          } else if (['outerpage', 'blank', 'tab', 'popview', 'excelIn'].includes(_opentype)) {
            item.options = this.state.reqOptions
          } else {
            item.options = this.state.reqOptionsMutil
@@ -198,9 +198,9 @@
        }
      } else if (value === 'excelIn') {
        if (this.state.interType === 'outer') {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError']
          _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
        } else {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError']
          _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
        }
      } else {
        if (this.state.interType === 'inner') {
@@ -226,6 +226,9 @@
          } else if (['outerpage', 'blank', 'tab', 'popview'].includes(value)) {
            item.options = this.state.reqOptions
            _fieldval.Ot = 'requiredSgl'
          } else if (value === 'excelIn') {
            item.options = this.state.reqOptions
            _fieldval.Ot = 'notRequired'
          } else {
            item.options = this.state.reqOptionsMutil
          }
@@ -306,9 +309,9 @@
        }
      } else if (openType === 'excelIn') {
        if (value === 'outer') {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError']
          _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
        } else {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError']
          _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
        }
      } else {
        if (value === 'inner') {
@@ -512,7 +515,6 @@
          if (values.OpenType === 'excelIn') {
            values.position = 'toolbar'
            values.Ot = 'notRequired'
          } else if (values.OpenType === 'excelOut') {
            values.position = 'toolbar'
            values.Ot = 'notRequired'
src/templates/comtableconfig/index.jsx
@@ -1303,9 +1303,10 @@
  verifySubmit = () => {
    const { card } = this.state
    let config = JSON.parse(JSON.stringify(this.state.config))
    let _verify = this.verifyRef.state.verify
    if (card.OpenType !== 'excelIn') {
      let _verify = this.verifyRef.state.verify
      if (_verify.default === 'false' && _verify.scripts.length === 0) {
        notification.warning({
          top: 92,
@@ -1314,57 +1315,38 @@
        })
        return
      }
    } else if (card.OpenType === 'excelIn') {
      let cols = _verify.columns.map(col => col.Column)
      cols = Array.from(new Set(cols))
      if (!_verify.sheet) {
        notification.warning({
          top: 92,
          message: '请设置导入表名!',
          duration: 10
        })
        return
      } else if (_verify.columns.length === 0) {
        notification.warning({
          top: 92,
          message: '请设置Excel列字段!',
          duration: 10
        })
        return
      } else if (_verify.columns.length > cols.length) {
        notification.warning({
          top: 92,
          message: 'Excel列字段名,不可重复!',
          duration: 10
        })
        return
      } else if (_verify.range === 1) {
        let tEmptys = _verify.columns.filter(op => !op.Text)
        if (tEmptys.length > 0) {
          notification.warning({
            top: 92,
            message: '忽略首行时,会使用Text值校验Excel首行内容,Text值与Excel表首行内容相同,且均不可为空!',
            duration: 10
          })
          return
      config.action = config.action.map(item => {
        if (item.uuid === card.uuid) {
          item.verify = _verify
        }
      }
        return item
      })
      this.setState({
        profileVisible: false,
        config: config,
        card: '',
      })
    } else if (card.OpenType === 'excelIn') {
      this.verifyRef.handleConfirm().then(res => {
        config.action = config.action.map(item => {
          if (item.uuid === card.uuid) {
            item.verify = res
          }
          return item
        })
        this.setState({
          profileVisible: false,
          config: config,
          card: '',
        })
      })
    }
    config.action = config.action.map(item => {
      if (item.uuid === card.uuid) {
        item.verify = _verify
      }
      return item
    })
    this.setState({
      profileVisible: false,
      config: config,
      card: '',
    })
  }
  /**
src/templates/subtableconfig/actionform/index.jsx
@@ -24,6 +24,13 @@
      value: 'requiredSgl',
      text: this.props.dict['header.form.requiredSgl']
    }],
    reqOptions: [{
      value: 'notRequired',
      text: this.props.dict['header.form.notRequired']
    }, {
      value: 'requiredSgl',
      text: this.props.dict['header.form.requiredSgl']
    }],
    reqOptionsMutil: [{
      value: 'notRequired',
      text: this.props.dict['header.form.notRequired']
@@ -95,9 +102,9 @@
      }
    } else if (_opentype === 'excelIn') {
      if (_intertype === 'outer') {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError']
        _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
      } else {
        _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError']
        _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
      }
    } else {
      if (_intertype === 'outer') {
@@ -116,7 +123,11 @@
        } else if (item.key === 'icon') {
          item.options = btnIcons
        } else if (item.key === 'Ot') {
          item.options = this.state.reqOptionsMutil
          if (_opentype === 'excelIn') {
            item.options = this.state.reqOptions
          } else {
            item.options = this.state.reqOptionsMutil
          }
        } else if (item.key === 'sqlType') {
          if (['prompt', 'exec'].includes(_opentype)) {
            item.options = this.state.deleteOptions
@@ -191,9 +202,9 @@
        }
      } else if (value === 'excelIn') {
        if (this.state.interType === 'outer') {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError']
          _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
        } else {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError']
          _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
        }
      } else {
        if (this.state.interType === 'inner') {
@@ -216,6 +227,9 @@
            if (this.state.position === 'grid') {
              item.options = this.state.reqOptionSgl
              item.initVal = 'requiredSgl'
            } else if (value === 'excelIn') {
              item.options = this.state.reqOptions
              item.initVal = 'notRequired'
            } else {
              item.options = this.state.reqOptionsMutil
            }
@@ -232,7 +246,7 @@
          return item
        })
      }, () => {
        if (['excelIn', 'excelOut'].includes(value)) return
        if (['excelOut'].includes(value)) return
        this.setState({
          formlist: this.state.formlist.map(item => {
@@ -317,9 +331,9 @@
        }
      } else if (openType === 'excelIn') {
        if (value === 'outer') {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError']
          _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
        } else {
          _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError']
          _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError']
        }
      } else {
        if (value === 'inner') {
@@ -513,7 +527,9 @@
          values.uuid = this.props.card.uuid
          values.verify = this.props.card.verify || null
          if (values.OpenType === 'excelIn' || values.OpenType === 'excelOut') {
          if (values.OpenType === 'excelIn') {
            values.position = 'toolbar'
          } else if (values.OpenType === 'excelOut') {
            values.position = 'toolbar'
            values.Ot = 'notRequired'
          } else if (values.OpenType === 'popview' && !values.linkTab) { // 没有关联标签(新建时),创建新标签Id
src/templates/subtableconfig/index.jsx
@@ -1123,9 +1123,10 @@
  verifySubmit = () => {
    const { card } = this.state
    let config = JSON.parse(JSON.stringify(this.state.config))
    let _verify = this.verifyRef.state.verify
    if (card.OpenType !== 'excelIn') {
      let _verify = this.verifyRef.state.verify
      if (_verify.default === 'false' && _verify.scripts.length === 0) {
        notification.warning({
          top: 92,
@@ -1134,57 +1135,38 @@
        })
        return
      }
    } else if (card.OpenType === 'excelIn') {
      let cols = _verify.columns.map(col => col.Column)
      cols = Array.from(new Set(cols))
      if (!_verify.sheet) {
        notification.warning({
          top: 92,
          message: '请设置导入表名!',
          duration: 10
        })
        return
      } else if (_verify.columns.length === 0) {
        notification.warning({
          top: 92,
          message: '请设置Excel列字段!',
          duration: 10
        })
        return
      } else if (_verify.columns.length > cols.length) {
        notification.warning({
          top: 92,
          message: 'Excel列字段名,不可重复!',
          duration: 10
        })
        return
      } else if (_verify.range === 1) {
        let tEmptys = _verify.columns.filter(op => !op.Text)
        if (tEmptys.length > 0) {
          notification.warning({
            top: 92,
            message: '忽略首行时,会使用Text值校验Excel首行内容,Text值与Excel表首行内容相同,且均不可为空!',
            duration: 10
          })
          return
      config.action = config.action.map(item => {
        if (item.uuid === card.uuid) {
          item.verify = _verify
        }
      }
    }
        return item
      })
      this.setState({
        profileVisible: false,
        config: config,
        card: ''
      })
    } else if (card.OpenType === 'excelIn') {
      this.verifyRef.handleConfirm().then(res => {
        config.action = config.action.map(item => {
          if (item.uuid === card.uuid) {
            item.verify = res
          }
    
    config.action = config.action.map(item => {
      if (item.uuid === card.uuid) {
        item.verify = _verify
      }
      return item
    })
    this.setState({
      profileVisible: false,
      config: config,
      card: ''
    })
          return item
        })
        this.setState({
          profileVisible: false,
          config: config,
          card: ''
        })
      })
    }
  }
  /**
src/templates/tableshare/dragelement/card.jsx
@@ -75,6 +75,15 @@
    }
  }
  let hasProfile = false
  if (type === 'action') {
    if (['pop', 'prompt', 'exec'].includes(card.OpenType) && card.intertype === 'inner' && !card.innerFunc) {
      hasProfile = true
    } else if (card.OpenType === 'excelIn') {
      hasProfile = true
    }
  }
  return (
    <div className="page-card" style={type === 'columns' ? { flex: card.Width, opacity: opacity} : { opacity: opacity}}>
      <div ref={node => drag(drop(node))}>
@@ -134,12 +143,6 @@
            {showfield ?
              <div className="ant-table-column-fields">
                <span className="ant-table-column-title">{card.type === 'colspan' ? card.subfield : card.field}</span>
                {/* <span className="ant-table-column-title">
                  {card.type === 'colspan' ?
                    <Paragraph copyable>{card.subfield}</Paragraph> :
                    <Paragraph copyable>{card.field}</Paragraph>
                  }
                </span> */}
              </div> : null
            }
          </span> : null
@@ -148,9 +151,7 @@
      <Icon className="edit" title="编辑" type="edit" onClick={edit} />
      <Icon className="edit close" title="删除" type="close" onClick={del} />
      {type === 'action' ? <Icon className="edit copy" title="复制" type="copy" onClick={copy} /> : null}
      {type === 'action' && ['pop', 'prompt', 'exec', 'excelIn'].includes(card.OpenType) && card.intertype === 'inner' && !card.innerFunc ?
        <Icon className="edit profile" title="校验规则" type="profile" onClick={profile} /> : null
      }
      {hasProfile ? <Icon className="edit profile" title="校验规则" type="profile" onClick={profile} /> : null}
    </div>
  )
}
src/templates/tableshare/formconfig.js
@@ -488,6 +488,13 @@
    },
    {
      type: 'text',
      key: 'sheet',
      label: Formdict['header.form.tablename'],
      initVal: card.sheet || config.setting.tableName || '',
      required: true
    },
    {
      type: 'text',
      key: 'sql',
      label: Formdict['header.form.tablename'],
      initVal: card.sql || config.setting.tableName || '',
src/templates/tableshare/verifycard/index.jsx
@@ -1133,7 +1133,7 @@
                </Col>
                <Col span={8}>
                  <Form.Item label={'停留时间'}>
                    <InputNumber defaultValue={2} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'stime')}} />
                    <InputNumber defaultValue={verify.stime || 2} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'stime')}} />
                  </Form.Item>
                </Col>
              </Row>
@@ -1156,7 +1156,7 @@
                </Col>
                <Col span={8}>
                  <Form.Item label={'停留时间'}>
                    <InputNumber defaultValue={15} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ntime')}} />
                    <InputNumber defaultValue={verify.ntime || 15} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ntime')}} />
                  </Form.Item>
                </Col>
              </Row>
@@ -1171,7 +1171,7 @@
                </Col>
                <Col span={8}>
                  <Form.Item label={'停留时间'}>
                    <InputNumber defaultValue={15} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ftime')}} />
                    <InputNumber defaultValue={verify.ftime || 15} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ftime')}} />
                  </Form.Item>
                </Col>
              </Row>
src/templates/tableshare/verifycardexcelin/index.jsx
@@ -1,7 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Tabs, Row, Col, Input, Button, Table, Popconfirm, Icon, notification, Modal, message, InputNumber } from 'antd'
import { formRule } from '@/utils/option.js'
import Utils from '@/utils/utils.js'
@@ -133,7 +132,7 @@
    this.setState({
      verify: {
        ..._verify,
        sheet: _verify.sheet || '',
        sheet: _verify.sheet || 'Sheet1',
        range: _verify.range || 0,
        columns: _verify.columns || [],
        scripts: _verify.scripts || []
@@ -272,38 +271,53 @@
    })
  }
  sheetChange = (e) => {
  handleConfirm = () => {
    const { verify } = this.state
    // 表单提交时检查输入值是否正确
    return new Promise((resolve, reject) => {
      this.props.form.validateFieldsAndScroll((err, values) => {
        if (!err) {
          let _verify = {...verify, ...values}
    this.setState({}, () => {
      this.props.form.validateFields(['sheet'], (errors, values) => {
        if (!errors) {
          this.setState({
            verify: {
              ...verify,
              ...values
          let cols = _verify.columns.map(col => col.Column)
          cols = Array.from(new Set(cols))
          if (_verify.columns.length === 0) {
            notification.warning({
              top: 92,
              message: '请设置Excel列字段!',
              duration: 10
            })
            return
          } else if (_verify.columns.length > cols.length) {
            notification.warning({
              top: 92,
              message: 'Excel列字段名,不可重复!',
              duration: 10
            })
            return
          } else if (_verify.range === 1) {
            let tEmptys = _verify.columns.filter(op => !op.Text)
            if (tEmptys.length > 0) {
              notification.warning({
                top: 92,
                message: '忽略首行时,会使用Text值校验Excel首行内容,Text值与Excel表首行内容相同,且均不可为空!',
                duration: 10
              })
              return
            }
          })
          }
          console.log(_verify)
          resolve(_verify)
        } else {
          this.setState({
            verify: {
              ...verify,
              sheet: ''
            }
          notification.warning({
            top: 92,
            message: '请设置Excel表名!',
            duration: 10
          })
        }
      })
    })
  }
  rangeChange = (value) => {
    const { verify } = this.state
    this.setState({
      verify: {
        ...verify,
        range: value || 0
      }
    })
  }
@@ -365,28 +379,23 @@
            <Form {...formItemLayout}>
              <Row gutter={24}>
                <Col span={8}>
                  <Form.Item label={this.props.dict['header.form.tablename']}>
                  <Form.Item label={'Excel表名'}>
                    {getFieldDecorator('sheet', {
                      initialValue: verify.sheet || '',
                      rules: [
                        {
                          required: true,
                          message: this.props.dict['form.required.input'] + this.props.dict['header.form.tablename'] + '!'
                        },
                        {
                          pattern: formRule.table.pattern,
                          message: formRule.table.message
                        }, {
                          max: formRule.table.max,
                          message: formRule.table.maxMessage
                        }
                      ]
                    })(<Input placeholder="" autoComplete="off" onChange={this.sheetChange} />)}
                    })(<Input placeholder="" autoComplete="off" />)}
                  </Form.Item>
                </Col>
                <Col span={8}>
                  <Form.Item label={'忽略行'}>
                    <InputNumber min={0} max={100} precision={0} defaultValue={0} onChange={this.rangeChange} />
                    {getFieldDecorator('range', {
                      initialValue: verify.range || 0
                    })(<InputNumber min={0} max={100} precision={0} />)}
                  </Form.Item>
                </Col>
              </Row>
@@ -437,7 +446,7 @@
                </Col>
                <Col span={8}>
                  <Form.Item label={'停留时间'}>
                    <InputNumber defaultValue={2} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'stime')}} />
                    <InputNumber defaultValue={verify.stime || 2} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'stime')}} />
                  </Form.Item>
                </Col>
              </Row>
@@ -460,7 +469,7 @@
                </Col>
                <Col span={8}>
                  <Form.Item label={'停留时间'}>
                    <InputNumber defaultValue={15} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ntime')}} />
                    <InputNumber defaultValue={verify.ntime || 15} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ntime')}} />
                  </Form.Item>
                </Col>
              </Row>
@@ -475,7 +484,7 @@
                </Col>
                <Col span={8}>
                  <Form.Item label={'停留时间'}>
                    <InputNumber defaultValue={15} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ftime')}} />
                    <InputNumber defaultValue={verify.ftime || 15} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ftime')}} />
                  </Form.Item>
                </Col>
              </Row>
src/utils/utils.js
@@ -451,6 +451,7 @@
    let errors = []
    let _topline = btn.range || 0
    let upId = this.getuuid()
    let _Ltext = data.map((item, lindex) => {
      let vals = btn.columns.map((col, cindex) => {
        let val = item[col.Column] !== undefined ? item[col.Column] : ''
@@ -520,7 +521,7 @@
      let _lineIndex = '0000' + (lindex + 1) + '0'
      _lineIndex = _lineIndex.substring(_lineIndex.length - 6)
      vals.push(`@upid+'${_lineIndex}' as jskey`)
      vals.push(`'${upId + _lineIndex}' as jskey`)
      return `Select ${vals.join(',')}`
    })
@@ -540,22 +541,20 @@
      fields = fields.join(',')
      _sql = `declare @${btn.sheet} table (${declarefields.join(',')},jskey nvarchar(50) )
      Declare @UserName nvarchar(50),@FullName nvarchar(50) ,@upid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000)
      _sql = `declare @${item.sheet} table (${declarefields.join(',')},jskey nvarchar(50) )
      Declare @UserName nvarchar(50),@FullName nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000)
      Select  @ErrorCode='', @retmsg=''
      
      select @UserName=UserName,@FullName=FullName from SUsers where UID=@UserID@
      
      set @upid='${this.getuuid()}'
      Insert into  @${btn.sheet} (${fields},jskey)
      Insert into  @${item.sheet} (${fields},jskey)
      ${_Ltext}
      Insert into ${btn.sheet} (${fields},createuserid,createuser,createstaff,bid,upid)
      Select ${fields},@userid@,@username,@fullname,@BID@,@upid From @${btn.sheet}
      Insert into ${item.sheet} (${fields},createuserid,createuser,createstaff,bid)
      Select ${fields},@userid@,@username,@fullname,@BID@ From @${item.sheet}
      Delete @${btn.sheet}
      Delete @${item.sheet}
      aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg`
@@ -1288,24 +1287,22 @@
    fields = fields.join(',')
    let _sql = `declare @${_verify.sheet} table (${declarefields.join(',')},jskey nvarchar(50) )
      Declare @UserName nvarchar(50),@FullName nvarchar(50),@upid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000)
    let _sql = `declare @${btn.sheet} table (${declarefields.join(',')},jskey nvarchar(50) )
      Declare @UserName nvarchar(50),@FullName nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000)
      
      Select @ErrorCode='',@retmsg=''
      select @UserName=UserName,@FullName=FullName from SUsers where UID=@UserID@
      
      set @upid='时间戳'
      Insert into @${_verify.sheet} (${fields},jskey)
      Insert into @${btn.sheet} (${fields},jskey)
      exec s_KeyWords_Replace 
      @LText=@LText, @BID=@BID,@LoginUID=@LoginUID,@SessionUid=@SessionUid,@UserID=@UserID,@ID=@ID
      Insert into ${_verify.sheet} (${fields},createuserid,createuser,createstaff,bid,upid)
      Select ${fields},@userid@,@username,@fullname,@BID@,@upid From @${_verify.sheet}
      Insert into ${btn.sheet} (${fields},createuserid,createuser,createstaff,bid)
      Select ${fields},@userid@,@username,@fullname,@BID@ From @${btn.sheet}
      Delete @${_verify.sheet}
      Delete @${btn.sheet}
      
      aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg`