| | |
| | | param.rduri = setting.interface |
| | | } |
| | | } else { |
| | | if (setting.sysInterface === 'true' && window.GLOB.mainSystemApi) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } else if (setting.sysInterface !== 'true') { |
| | | if (setting.sysInterface === 'true') { |
| | | if (window.GLOB.mainSystemApi) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | } else if (setting.sysInterface === 'external') { |
| | | if (window.GLOB.systemType === 'production') { |
| | | param.$token = setting.exProInterface || '' |
| | | } else { |
| | | param.$token = setting.exInterface || '' |
| | | } |
| | | } else { |
| | | if (window.GLOB.systemType === 'production' && setting.proInterface) { |
| | | param.rduri = setting.proInterface |
| | | } else { |
| | |
| | | default_sql: setting.execute ? 'true' : 'false' |
| | | } |
| | | |
| | | if (setting.transaction === 'true') { |
| | | param.func = 'sPC_Get_TableData_try' |
| | | } |
| | | // if (setting.transaction === 'true') { |
| | | // param.func = 'sPC_Get_TableData_try' |
| | | // } |
| | | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | |
| | | _customScript = _customScript.replace(/\$sum@/ig, '/*') |
| | | _customScript = _customScript.replace(/@sum\$/ig, '*/') |
| | | |
| | | _dataresource = _dataresource.replace(/@ID@/ig, `''`) |
| | | _customScript = _customScript.replace(/@ID@/ig, `''`) |
| | | // _dataresource = _dataresource.replace(/@ID@/ig, `''`) |
| | | // _customScript = _customScript.replace(/@ID@/ig, `''`) |
| | | _dataresource = _dataresource.replace(/@BID@/ig, `'${BID || ''}'`) |
| | | _customScript = _customScript.replace(/@BID@/ig, `'${BID || ''}'`) |
| | | _dataresource = _dataresource.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`) |
| | |
| | | regoptions.forEach(item => { |
| | | _customScript = _customScript.replace(item.reg, item.value) |
| | | }) |
| | | if (window.GLOB.breakpoint) { |
| | | _customScript = _customScript.replace(/\$breakpoint_proc@/ig, window.GLOB.breakpoint) |
| | | param.func = 'sPC_Get_TableData_debug' |
| | | } |
| | | } |
| | | |
| | | let LText = '' |
| | | let DateCount = '' |
| | | |
| | | if (_dataresource && setting.laypage && orderBy && !id) { |
| | | LText = ` select top ${pageSize} ${arrFields} from (select ${arrFields} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows ` |
| | | DateCount = `select count(1) as total from ${_dataresource} ${_search}` |
| | | LText = `/*system_query*/select top ${pageSize} ${arrFields} from (select ${arrFields} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows ` |
| | | DateCount = `/*system_query*/select count(1) as total from ${_dataresource} ${_search}` |
| | | } else if (_dataresource && orderBy) { |
| | | LText = ` select ${arrFields} from (select ${arrFields} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows ` |
| | | LText = `/*system_query*/select ${arrFields} from (select ${arrFields} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows ` |
| | | } else if (_dataresource) { |
| | | LText = ` select ${arrFields} from ${_dataresource} ${_search} ` |
| | | LText = `/*system_query*/select ${arrFields} from ${_dataresource} ${_search} ` |
| | | } |
| | | |
| | | if (_customScript) { |
| | |
| | | // param.sub_name = 'sub_data' |
| | | // param.sub_field = 'BID,friend_text,icon,Initials' |
| | | |
| | | if (setting.sub_field) { |
| | | param.sub_name = setting.subdata |
| | | param.tabid = setting.primaryKey || '' |
| | | param.parid = setting.subBID || '' |
| | | param.sub_field = setting.sub_field |
| | | } |
| | | |
| | | // exec_type: 'y' 解码字段:LText、LText1、LText2、custom_script、DateCount |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | if (window.GLOB.probation) { |
| | | param.s_debug_type = 'Y' |
| | | } |
| | | |
| | | if (window.GLOB.mkHS) { // 云端数据验证 |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) |
| | |
| | | default_sql: setting.execute ? 'true' : 'false' |
| | | } |
| | | |
| | | if (setting.transaction === 'true') { |
| | | param.func = 'sPC_Get_TableData_try' |
| | | } |
| | | // if (setting.transaction === 'true') { |
| | | // param.func = 'sPC_Get_TableData_try' |
| | | // } |
| | | |
| | | let _dataresource = setting.dataresource |
| | | let _customScript = '' |
| | |
| | | _customScript = _customScript.replace(/\$select@/ig, '/*') |
| | | _customScript = _customScript.replace(/@select\$/ig, '*/') |
| | | |
| | | _dataresource = _dataresource.replace(/@ID@/ig, `''`) |
| | | _customScript = _customScript.replace(/@ID@/ig, `''`) |
| | | // _dataresource = _dataresource.replace(/@ID@/ig, `''`) |
| | | // _customScript = _customScript.replace(/@ID@/ig, `''`) |
| | | _dataresource = _dataresource.replace(/@BID@/ig, `'${BID || ''}'`) |
| | | _customScript = _customScript.replace(/@BID@/ig, `'${BID || ''}'`) |
| | | _dataresource = _dataresource.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`) |
| | |
| | | }) |
| | | } |
| | | |
| | | let LText = ` select ${statFields.map(col => `isnull(sum(${col.field}),0) as ${col.field}`).join(',')} from ${_dataresource} ${_search} ` |
| | | let LText = ` /*system_query*/select ${statFields.map(col => `isnull(sum(${col.field}),0) as ${col.field}`).join(',')} from ${_dataresource} ${_search} ` |
| | | |
| | | if (_customScript) { |
| | | LText = `${LText} |
| | |
| | | */ |
| | | static getPrevQueryParams (setting, search = [], BID) { |
| | | let param = null |
| | | |
| | | if (setting.procMode !== 'inner') { |
| | | param = this.getDefaultPrevQueryParam(setting, search, BID) |
| | | } else { |
| | |
| | | * @description 生成单个组件sPC_Get_structured_data请求参数 |
| | | */ |
| | | export function getStructDefaultParam (component, searchlist, first) { |
| | | const { columns, setting, dataName, format } = component |
| | | const { columns, setting, dataName, format, uuid } = component |
| | | |
| | | let arr_field = columns.map(col => col.field) |
| | | let _dataresource = setting.dataresource |
| | |
| | | } |
| | | |
| | | return { |
| | | uuid: uuid, |
| | | name: dataName, |
| | | $name: setting.$name, |
| | | columns: columns, |
| | |
| | | foreign_key: '', |
| | | sql: _dataresource, |
| | | script: _customScript, |
| | | transaction: setting.transaction === 'true' |
| | | // transaction: setting.transaction === 'true' |
| | | } |
| | | } |
| | | |
| | |
| | | export function getStructuredParams (params, config, BID) { |
| | | let LText_field = [] |
| | | let diffUser = false |
| | | let transaction = false |
| | | // let transaction = false |
| | | let loginId = `'${sessionStorage.getItem('LoginUID') || ''}'` |
| | | let sessionId = `'${localStorage.getItem('SessionUid') || ''}'` |
| | | let userId = `'${sessionStorage.getItem('UserID') || ''}'` |
| | |
| | | if (!diffUser && (/@userid@/ig.test(item.sql) || /@userid@/ig.test(_script))) { |
| | | diffUser = true |
| | | } |
| | | if (item.transaction) { |
| | | transaction = true |
| | | } |
| | | // if (item.transaction) { |
| | | // transaction = true |
| | | // } |
| | | |
| | | _sql = _sql.replace(/@ID@/ig, `''`) |
| | | _script = _script.replace(/@ID@/ig, `''`) |
| | |
| | | BID: BID |
| | | } |
| | | |
| | | if (transaction) { |
| | | param.func = 'sPC_Get_structured_data_try' |
| | | if (config.MenuName) { |
| | | param.menuname = config.MenuName |
| | | } |
| | | // if (transaction) { |
| | | // param.func = 'sPC_Get_structured_data_try' |
| | | // } |
| | | |
| | | let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText) |
| | | |