king
2021-06-02 e543372cc70a19ff2630c79d8421c2c593e54e5f
src/utils/utils-datamanage.js
@@ -108,6 +108,13 @@
      `
    }
    _dataresource = _dataresource.replace(/@select\$|\$select@/ig, '')
    _customScript = _customScript.replace(/@select\$|\$select@/ig, '')
    _dataresource = _dataresource.replace(/\$sum@/ig, '/*')
    _dataresource = _dataresource.replace(/@sum\$/ig, '*/')
    _customScript = _customScript.replace(/\$sum@/ig, '/*')
    _customScript = _customScript.replace(/@sum\$/ig, '*/')
    let regoptions = null
    if (setting.queryType === 'statistics' || _customScript) {
      let allSearch = Utils.getAllSearchOptions(search)
@@ -118,15 +125,6 @@
        }
      })
      regoptions.push({
        reg: new RegExp('@login_city@', 'ig'),
        value: `'${city}'`
      }, {
        reg: new RegExp('@userName@', 'ig'),
        value: `'${userName}'`
      }, {
        reg: new RegExp('@fullName@', 'ig'),
        value: `'${fullName}'`
      }, {
        reg: new RegExp('@orderBy@', 'ig'),
        value: orderBy
      }, {
@@ -190,8 +188,8 @@
    // 测试系统打印查询语句
    if ((options.sysType === 'local' && !window.GLOB.systemType) || window.debugger === true) {
      _customScript &&  console.info(`${LText ? '' : '/*不执行默认sql*/\n'}${_customScript}`)
      LText &&  console.info(LText)
      _customScript &&  console.info(`${setting.$name ? `/*组件-${setting.$name} 自定义脚本*/\n` : ''}${LText ? '' : '/*不执行默认sql*/\n'}${_customScript}`)
      LText &&  console.info(`${setting.$name ? `/*组件-${setting.$name} 数据源*/\n` : ''}` + LText)
    }
    param.custom_script = Utils.formatOptions(_customScript)
@@ -240,6 +238,13 @@
      `
    }
    _dataresource = _dataresource.replace(/@sum\$|\$sum@/ig, '')
    _customScript = _customScript.replace(/@sum\$|\$sum@/ig, '')
    _dataresource = _dataresource.replace(/\$select@/ig, '/*')
    _dataresource = _dataresource.replace(/@select\$/ig, '*/')
    _customScript = _customScript.replace(/\$select@/ig, '/*')
    _customScript = _customScript.replace(/@select\$/ig, '*/')
    let regoptions = null
    if (setting.queryType === 'statistics' || _customScript) {
      let allSearch = Utils.getAllSearchOptions(search)
@@ -251,15 +256,6 @@
        }
      })
      regoptions.push({
        reg: new RegExp('@login_city@', 'ig'),
        value: `'${city}'`
      }, {
        reg: new RegExp('@userName@', 'ig'),
        value: `'${userName}'`
      }, {
        reg: new RegExp('@fullName@', 'ig'),
        value: `'${fullName}'`
      }, {
        reg: new RegExp('@orderBy@', 'ig'),
        value: orderBy
      }, {
@@ -280,6 +276,7 @@
      regoptions.forEach(item => {
        _dataresource = _dataresource.replace(item.reg, item.value)
      })
      _search = ''
    }
    if (_customScript) {
@@ -300,8 +297,8 @@
    // 测试系统打印查询语句
    if ((options.sysType === 'local' && !window.GLOB.systemType) || window.debugger === true) {
      _customScript &&  console.info(`${LText ? '' : '/*不执行默认sql*/\n'}${_customScript}`)
      LText &&  console.info(LText)
      _customScript &&  console.info(`${setting.$name ? `/*组件-${setting.$name} 自定义脚本 统计查询*/\n` : ''}${LText ? '' : '/*不执行默认sql*/\n'}${_customScript}`)
      LText &&  console.info(`${setting.$name ? `/*组件-${setting.$name} 数据源 统计查询*/\n` : ''}` + LText)
    }
    
    param.custom_script = Utils.formatOptions(_customScript)
@@ -357,7 +354,7 @@
  }
  /**
   * @description 获取系统存储过程 sPC_Get_TableData 的参数
   * @description 获取系统前置脚本
   */
  static getDefaultPrevQueryParam (setting, search, menuType) {
    let param = {
@@ -441,7 +438,7 @@
  }
  /**
   * @description 获取系统存储过程 sPC_Get_TableData 的参数
   * @description 获取系统回调脚本
   */
  static getCallBackQueryParams (setting, sql, errSql) {
    let param = {
@@ -540,6 +537,9 @@
            subObjs.push(val)
          }
        } else {
          if (typeof(val) === 'string') {
            val = val.replace(/'/ig, '"')
          }
          keys.push(key)
          vals.push(`'${val}'`)
        }