king
2020-11-13 dfb7b774d9934f4f5b3edf1a39bf73be9c90c55d
src/utils/utils-datamanage.js
@@ -86,7 +86,7 @@
      arr_field: arrFields,
      default_sql: setting.execute ? 'true' : 'false'
    }
    let _dataresource = setting.dataresource
    let _customScript = ''
    
@@ -99,6 +99,13 @@
    let regoptions = null
    if (setting.queryType === 'statistics' || _customScript) {
      let allSearch = Utils.getAllSearchOptions(search)
      let userName = sessionStorage.getItem('User_Name') || ''
      let fullName = sessionStorage.getItem('Full_Name') || ''
      if (sessionStorage.getItem('isEditState') === 'true') {
        userName = sessionStorage.getItem('CloudUserName') || ''
        fullName = sessionStorage.getItem('CloudFullName') || ''
      }
      regoptions = allSearch.map(item => {
        return {
@@ -107,6 +114,12 @@
        }
      })
      regoptions.push({
        reg: new RegExp('@userName@', 'ig'),
        value: userName
      }, {
        reg: new RegExp('@fullName@', 'ig'),
        value: fullName
      }, {
        reg: new RegExp('@orderBy@', 'ig'),
        value: orderBy
      }, {
@@ -187,7 +200,7 @@
  /**
   * @description 获取系统存储过程 sPC_Get_TableData 合计值的参数
   */
  static getStatQueryDataParams (setting, statFields, search, orderBy, pageIndex, pageSize, menuType, dataManager) {
  static getStatQueryDataParams (setting, statFields, search, orderBy, BID, menuType, dataManager) {
    let param = {
      func: 'sPC_Get_TableData',
      obj_name: 'data',
@@ -207,6 +220,13 @@
    let regoptions = null
    if (setting.queryType === 'statistics' || _customScript) {
      let allSearch = Utils.getAllSearchOptions(search)
      let userName = sessionStorage.getItem('User_Name') || ''
      let fullName = sessionStorage.getItem('Full_Name') || ''
      if (sessionStorage.getItem('isEditState') === 'true') {
        userName = sessionStorage.getItem('CloudUserName') || ''
        fullName = sessionStorage.getItem('CloudFullName') || ''
      }
      regoptions = allSearch.map(item => {
        return {
@@ -215,6 +235,12 @@
        }
      })
      regoptions.push({
        reg: new RegExp('@userName@', 'ig'),
        value: userName
      }, {
        reg: new RegExp('@fullName@', 'ig'),
        value: fullName
      }, {
        reg: new RegExp('@orderBy@', 'ig'),
        value: orderBy
      }, {
@@ -243,7 +269,7 @@
      })
    }
    let LText = ` select ${statFields.map(col => `sum(${col.field}) as ${col.field}`).join(',')} from ${_dataresource} ${_search} `
    let LText = ` select ${statFields.map(col => `isnull(sum(${col.field}),0) as ${col.field}`).join(',')} from ${_dataresource} ${_search} `
    if (_customScript) {
      LText = `${LText}
@@ -269,6 +295,10 @@
      param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
    }
    if (BID) {
      param.BID = BID
    }
    // 数据管理权限
    if (dataManager) {
      param.dataM = 'Y'