king
2021-01-21 0647a7a6251c05466c2ea5c64878959da4b1b625
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -40,7 +40,8 @@
    confirmLoading: false,
    btnconfig: null,
    loading: false,
    loadingNumber: ''
    loadingNumber: '',
    checkParam: null
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -211,6 +212,7 @@
        let param = { // 系统存储过程
          func: 'sPC_TableData_InUpDe'
        }
        let check_param = null
        if (this.props.BID) {
          param.BID = this.props.BID
@@ -244,6 +246,16 @@
            param.exec_type = 'y' // 后台解码
            param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
            param.secretkey = Utils.encrypt('', param.timestamp)
            if (/\$check@|@check\$/ig.test(param.LText)) {
              check_param = fromJS(param).toJS()
              check_param.LText = check_param.LText.replace(/\$check@/ig, '/*')
              check_param.LText = check_param.LText.replace(/@check\$/ig, '*/')
              check_param.LText = Utils.formatOptions(check_param.LText)
              param.LText = param.LText.replace(/\$check@|@check\$/ig, '')
            }
            param.LText = Utils.formatOptions(param.LText)
          }
        } else if (btn.OpenType === 'pop') { // 表单
@@ -281,6 +293,16 @@
            param.exec_type = 'y' // 后台解码
            param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
            param.secretkey = Utils.encrypt('', param.timestamp)
            if (/\$check@|@check\$/ig.test(param.LText)) {
              check_param = fromJS(param).toJS()
              check_param.LText = check_param.LText.replace(/\$check@/ig, '/*')
              check_param.LText = check_param.LText.replace(/@check\$/ig, '*/')
              check_param.LText = Utils.formatOptions(check_param.LText)
              param.LText = param.LText.replace(/\$check@|@check\$/ig, '')
            }
            param.LText = Utils.formatOptions(param.LText)
          } else if (btn.sql) {
            param.ID = primaryId
@@ -296,12 +318,25 @@
            param.exec_type = 'y' // 后台解码
            param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
            param.secretkey = Utils.encrypt('', param.timestamp)
            if (/\$check@|@check\$/ig.test(param.LText)) {
              check_param = fromJS(param).toJS()
              check_param.LText = check_param.LText.replace(/\$check@/ig, '/*')
              check_param.LText = check_param.LText.replace(/@check\$/ig, '*/')
              check_param.LText = Utils.formatOptions(check_param.LText)
              param.LText = param.LText.replace(/\$check@|@check\$/ig, '')
            }
            param.LText = Utils.formatOptions(param.LText)
          }
        }
        if (this.props.menuType === 'HS' && param.timestamp) { // 函数 sPC_TableData_InUpDe 云端验证
          param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
          if (check_param) {
            check_param.open_key = Utils.encryptOpenKey(check_param.secretkey, check_param.timestamp)
          }
        } else if (this.props.menuType === 'HS' && param.func === 's_sDataDictb_TBBack' && param.LTextOut) { // 函数 s_sDataDictb_TBBack 云端验证
          param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
          param.secretkey = Utils.encrypt(param.LTextOut, param.timestamp)
@@ -310,6 +345,12 @@
        if (param.func === 'sPC_TableData_InUpDe') {
          param.menuname = btn.logLabel
          if (check_param) {
            check_param.menuname = btn.logLabel
          }
        }
        if (check_param) {
          this.setState({checkParam: check_param})
        }
        Api.genericInterface(param).then((res) => {
@@ -360,6 +401,7 @@
              } else {
                param.LText = param.LText.replace(/@\$|\$@/ig, '')
              }
              param.LText = param.LText.replace(/\$check@|@check\$/ig, '')
              param.exec_type = 'y' // 后台解码
              param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
@@ -396,6 +438,7 @@
              } else {
                param.LText = param.LText.replace(/@\$|\$@/ig, '')
              }
              param.LText = param.LText.replace(/\$check@|@check\$/ig, '')
              param.exec_type = 'y' // 后台解码
              param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
@@ -411,6 +454,7 @@
              } else {
                param.LText = param.LText.replace(/@\$|\$@/ig, '')
              }
              param.LText = param.LText.replace(/\$check@|@check\$/ig, '')
              param.exec_type = 'y' // 后台解码
              param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
@@ -872,11 +916,52 @@
    } else if (res.ErrCode === 'NM') {
      message.error(res.message || res.ErrMesg)
    }
    this.setState({
      loading: false
    })
    if (res.ErrCode === 'C') {
      const _this = this
      if (this.state.checkParam) {
        let param = this.state.checkParam
        confirm({
          title: res.message || res.ErrMesg,
          onOk() {
            return new Promise(resolve => {
              Api.genericInterface(param).then((result) => {
                if (result.status) {
                  _this.execSuccess(result)
                } else {
                  _this.execError(result)
                }
                resolve()
              }, () => {
                _this.setState({
                  visible: false
                })
                resolve()
              })
            })
          },
          onCancel() {
            _this.setState({
              visible: false
            })
            if (btn.execError !== 'never') {
              MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execError, btn)
            }
          }
        })
        this.setState({checkParam: null})
        return
      } else {
        Modal.error({
          title: res.message || res.ErrMesg,
        })
      }
    }
    if (btn.execError !== 'never') {
      MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execError, btn)
    }