king
2022-01-21 46f79b491173d284a4900d19e7aecf7509481438
src/utils/utils-datamanage.js
@@ -146,18 +146,23 @@
    let _search = ''
    
    if (setting.queryType === 'statistics' && _dataresource) { // 统计数据源,内容替换
    if (_dataresource) {
      if (setting.queryType === 'statistics') { // 统计数据源,内容替换
      regoptions.forEach(item => {
        _dataresource = _dataresource.replace(item.reg, item.value)
      })
    } else if (_dataresource && !id) {
        if (id) {
          _dataresource = _dataresource + ` where ${setting.primaryKey || 'ID'}='${id}'`
        }
      } else if (!id) {
      _search = Utils.joinMainSearchkey(search)
      if (_search) {
        _search = 'where ' + _search
      }
    } else if (_dataresource && id) {
      } else if (id) {
      _search = Utils.joinMainSearchkey(search)
      _search = `where ${_search ? _search + ' AND ' : ''} ${setting.primaryKey || 'ID'}='${id}'`
      }
    }
    if (_customScript) {
@@ -207,6 +212,25 @@
    param.custom_script = Utils.formatOptions(_customScript)
    param.LText = Utils.formatOptions(LText)
    param.DateCount = Utils.formatOptions(DateCount)
    // 多层结构数据
    // LText = `SELECT a.id as bid,a.ID,a.workerCode,a.workerName,a.jobName,a.Initials,case when isnull(m.friend_id ,'') ='' then ''
    // when isnull(m.status,0)=10 then '已添加' else '待通过' end as friend_text
    // ,case when images='' then  'http://epc.mk9h.cn/Content/images/upload/img/kane.jpg'  else images end as icon FROM
    // (select friend_id,status from oa_mail_list where userid='sso202004100959326131C0805998B6745F886F9' and  Initials=case when right('0',1)='0' then Initials else '0'  end
    // and status=10  and deleted=0) m
    //  inner join  (select * from BD_workers where
    //  Initials=case when right('0',1)='0' then Initials else '0' end and deleted=0 ) a
    //  on a.id=m.friend_id `
    // param.custom_script = ''
    // param.LText = Utils.formatOptions(LText)
    // param.DateCount = ''
    // param.prm_field = 'workerCode'
    // param.arr_field = 'workerName,jobName'
    // param.tabid = 'ID'
    // param.parid = 'BID'
    // param.sub_name = 'sub_data'
    // param.sub_field = 'BID,friend_text,icon,Initials'
    // exec_type: 'y' 解码字段:LText、LText1、LText2、custom_script、DateCount
@@ -672,7 +696,7 @@
  // 测试系统打印查询语句
  if ((options.sysType === 'local' && !window.GLOB.systemType) || window.debugger === true) {
    _customScript && console.info(`${setting.$name ? `/*${setting.$name} 自定义脚本(同步查询)/\n` : ''}${_dataresource ? '' : '/*不执行默认sql*/\n'}${_customScript}`)
    _customScript && console.info(`${setting.$name ? `/*${setting.$name} 自定义脚本(同步查询)*/\n` : ''}${_dataresource ? '' : '/*不执行默认sql*/\n'}${_customScript}`)
    _dataresource && console.info(`${setting.$name ? `/*${setting.$name} 数据源(同步查询)*/\n` : ''}` + _dataresource)
  }