king
2022-11-29 8b6f9a84e5eb704b25c105cce31904381bd81107
src/tabviews/zshare/actionList/excelInbutton/index.jsx
@@ -14,6 +14,8 @@
import MkIcon from '@/components/mk-icon'
// import './index.scss'
const { confirm } = Modal
class ExcelInButton extends Component {
  static propTpyes = {
    BID: PropTypes.string,            // 主表ID
@@ -337,29 +339,86 @@
      
      param.excel_in_type = 'true'
      param.LText1 = Utils.formatOptions(result.insert)
      param.LText2 = Utils.formatOptions(result.bottom)
      param.LText = Utils.formatOptions(result.sql)
      param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      param.LText2 = result.bottom
      param.LText = result.sql
      let unCheckParam = null
      if (/\$check@|@check\$/ig.test(param.LText2) || /\$check@|@check\$/ig.test(param.LText)) {
        unCheckParam = fromJS(param).toJS()
        param.LText = param.LText.replace(/\$check@|@check\$/ig, '')
        param.LText2 = param.LText2.replace(/\$check@|@check\$/ig, '')
      }
      param.LText2 = Utils.formatOptions(param.LText2)
      param.LText = Utils.formatOptions(param.LText)
      param.secretkey = Utils.encrypt(param.LText, param.timestamp)
      if (window.GLOB.mkHS && param.timestamp) { // 云端验证
        param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
      }
      param.menuname = btn.logLabel
      if (window.GLOB.probation) {
        param.s_debug_type = 'Y'
      }
      Api.genericInterface(param).then((res) => {
        if (res.status) {
          this.execSuccess(res)
        } else {
          this.execError(res)
      if (unCheckParam) {
        unCheckParam.LText = unCheckParam.LText.replace(/\$check@/ig, '/*').replace(/@check\$/ig, '*/')
        unCheckParam.LText = Utils.formatOptions(unCheckParam.LText)
        unCheckParam.LText2 = unCheckParam.LText2.replace(/\$check@/ig, '/*').replace(/@check\$/ig, '*/')
        unCheckParam.LText2 = Utils.formatOptions(unCheckParam.LText2)
        unCheckParam.secretkey = Utils.encrypt(unCheckParam.LText, unCheckParam.timestamp)
        unCheckParam.menuname = btn.logLabel
        if (window.GLOB.probation) {
          unCheckParam.s_debug_type = 'Y'
        }
      }, () => {
        this.execError({})
      })
        Api.genericInterface(param).then(res => {
          if (res.status) {
            this.execSuccess(res)
          } else if (res.ErrCode === 'C') {
            const _this = this
            confirm({
              title: '继续执行?',
              content: res.message,
              onOk() {
                return new Promise(resolve => {
                  Api.genericInterface(unCheckParam).then(result => {
                    if (result.status) {
                      _this.execSuccess(result)
                    } else {
                      _this.execError(result)
                    }
                    resolve()
                  })
                })
              },
              onCancel() {
                _this.execError(res)
              }
            })
          } else {
            this.execError(res)
          }
        }, () => {
          this.execError({})
        })
      } else {
        Api.genericInterface(param).then((res) => {
          if (res.status) {
            this.execSuccess(res)
          } else {
            this.execError(res)
          }
        }, () => {
          this.execError({})
        })
      }
    } else if (btn.intertype === 'inner' && btn.innerFunc) { // 自定义存储过程
      param.func = btn.innerFunc