king
2024-02-23 7e5200a09b2c6282382ec8725220f5561de139f6
src/tabviews/zshare/actionList/excelInbutton/index.jsx
@@ -199,9 +199,15 @@
      if (btn.syncComponentId === 'multiComponent') {
        btn.syncComponentIds.forEach((id, i) => {
          setTimeout(() => {
            MKEmitter.emit('reloadData', id)
            if (/\$focus/.test(id)) {
              MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1])
            } else {
              MKEmitter.emit('reloadData', id)
            }
          }, 20 * i)
        })
      } else if (/\$focus/.test(btn.syncComponentId)) {
        MKEmitter.emit('reloadData', btn.syncComponentId.split('$')[0], btn.syncComponentId.split('$')[1])
      } else {
        MKEmitter.emit('reloadData', btn.syncComponentId)
      }
@@ -270,43 +276,21 @@
  /**
   * @description Excel 导入
   */
  getexceldata = (data, errors, sheetName, errDetail) => {
  getexceldata = (data, error) => {
    const { btn, BID } = this.props
    if (errors) {
      if (errors === 'notexit') {
        notification.warning({
          top: 92,
          message: '工作表《' + sheetName + '》不存在!',
          duration: 5
        })
      } else if (errors === 'empty') {
        notification.warning({
          top: 92,
          message: '工作表《' + sheetName + '》为空!',
          duration: 5
        })
      } else if (errors === 'headerError') {
        notification.warning({
          top: 92,
          message: `工作表《${sheetName}》表头错误,${errDetail}`,
          duration: 5
        })
      }
    if (error) {
      notification.warning({
        top: 92,
        message: error,
        duration: 5
      })
      this.setState({ loading: false })
      return
    }
    if (!data || data.length === 0) {
      notification.warning({
        top: 92,
        message: '未获取到工作表《' + sheetName + '》数据!',
        duration: 5
      })
      this.setState({ loading: false })
      return
    } else if (data.length * btn.verify.columns.length > 30000) {
    if (data.length * btn.verify.columns.length > 30000) {
      notification.warning({
        top: 92,
        message: '当前导入数据量过大,如遇错误提示,请分批导入!',
@@ -341,7 +325,7 @@
      delete param.excel_in
      // param.excel_in_type = 'true'
      param.exec_type = 'y'
      param.exec_type = window.GLOB.execType || 'y'
      param.LText = result.sql
      param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
@@ -352,7 +336,7 @@
        param.LText = param.LText.replace(/\$check@|@check\$/ig, '')
      }
      param.LText = Utils.formatOptions(param.LText)
      param.LText = Utils.formatOptions(param.LText, param.exec_type)
      param.secretkey = Utils.encrypt('', param.timestamp)
      if (window.GLOB.mkHS) { // 云端验证
        param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
@@ -366,7 +350,7 @@
      if (unCheckParam) {
        unCheckParam.LText = unCheckParam.LText.replace(/\$check@/ig, '/*').replace(/@check\$/ig, '*/')
        unCheckParam.LText = Utils.formatOptions(unCheckParam.LText)
        unCheckParam.LText = Utils.formatOptions(unCheckParam.LText, unCheckParam.exec_type)
        unCheckParam.secretkey = Utils.encrypt('', unCheckParam.timestamp)
        unCheckParam.menuname = btn.logLabel
@@ -576,6 +560,7 @@
    return <>
      <Button
        type={type}
        id={'button' + btn.uuid}
        title={disabled ? (btn.reason || '') : (btn.show === 'icon' ? btn.label : '')}
        loading={loading}
        disabled={disabled}