king
2021-01-22 c7df5603e14b98d6f80da425fab31d30574ca417
src/utils/utils.js
@@ -48,6 +48,7 @@
    for (let i = 0; i < 6; i++) {
      name.push(_options.substr(Math.floor(Math.random() * 26), 1))
    }
    name.splice(3, 0, new Date().getTime())
    return name.join('')
  }
@@ -168,7 +169,7 @@
    value = value.replace(/%/ig, ' mpercent ')
    // 外联数据库替换
    if (window.GLOB.externalDatabase !== null) {
      value = value.replace(/@db@/ig, `[${window.GLOB.externalDatabase}]..`)
      value = value.replace(/@db@/ig, window.GLOB.externalDatabase)
    }
    // encode编码(中文字符超出base64加密范围)
    value = window.btoa(window.encodeURIComponent(value))
@@ -239,7 +240,7 @@
    value = value.replace(/%/ig, ' mpercent ')
    // 外联数据库替换
    if (window.GLOB.externalDatabase !== null) {
      value = value.replace(/@db@/ig, `[${window.GLOB.externalDatabase}]..`)
      value = value.replace(/@db@/ig, window.GLOB.externalDatabase)
    }
    let encodesql = (val) => {
@@ -1054,7 +1055,7 @@
   * @return {String} type   执行类型
   * @return {String} table  表名
   */
  static getSysDefaultSql (btn, setting, formdata, param, data, columns, tab) {
  static getSysDefaultSql (btn, setting, formdata, param, data, columns, tab, retmsg) {
    let primaryId = param.ID
    let BID = param.BID
    let verify = btn.verify || {}
@@ -1688,8 +1689,14 @@
      _sql += _backCustomScript
    }
    _sql += `
        aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg`
    if (retmsg) {
      _sql += `
          aaa: if @ErrorCode!=''
          insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@`
    } else {
      _sql += `
          aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg`
    }
    if ((window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') || window.debugger === true) {
      _sql = _sql.replace(/\n\s{8}/ig, '\n')