king
2020-02-17 0594fe8d97286a535177f8ba05972d0305fc7dee
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)