| | |
| | | /** |
| | | * @description 数据源名称,用于统一查询 |
| | | * @param {Object} setting 数据源设置 |
| | | * @param {String} customScript 自定义脚本 |
| | | * @param {String} arrFields 查询字段 |
| | | * @param {Array} search 搜索条件 |
| | | * @param {String} orderBy 排序方式 |
| | |
| | | * @param {Boolean} dataManager 数据权限 |
| | | * @return {Object} param |
| | | */ |
| | | static getQueryDataParams (setting, customScript, arrFields, search = [], orderBy = '', pageIndex = 1, pageSize = 10, BID, menuType, dataManager) { |
| | | static getQueryDataParams (setting, arrFields, search = [], orderBy = '', pageIndex = 1, pageSize = 10, BID, menuType, dataManager) { |
| | | let param = null |
| | | |
| | | if (setting.interType === 'system' || (setting.interType === 'inner' && !setting.innerFunc)) { |
| | | param = this.getDefaultQueryParam(setting, customScript, arrFields, search, orderBy, pageIndex, pageSize, menuType) |
| | | param = this.getDefaultQueryParam(setting, arrFields, search, orderBy, pageIndex, pageSize, menuType) |
| | | } else { |
| | | param = this.getCustomQueryParam(setting, search, orderBy, pageIndex, pageSize, menuType) |
| | | } |
| | |
| | | /** |
| | | * @description 获取系统存储过程 sPC_Get_TableData 的参数 |
| | | */ |
| | | static getDefaultQueryParam (setting, customScript, arrFields, search, orderBy, pageIndex, pageSize, menuType) { |
| | | static getDefaultQueryParam (setting, arrFields, search, orderBy, pageIndex, pageSize, menuType) { |
| | | let param = { |
| | | func: 'sPC_Get_TableData', |
| | | obj_name: 'data', |
| | |
| | | } |
| | | |
| | | let _dataresource = setting.dataresource |
| | | let _customScript = customScript |
| | | let _customScript = '' |
| | | |
| | | if (setting.customScript) { |
| | | _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000) select @ErrorCode='',@retmsg ='' |
| | | ${setting.customScript} |
| | | ` |
| | | } |
| | | |
| | | let regoptions = null |
| | | if (setting.queryType === 'statistics' || _customScript) { |
| | |
| | | |
| | | param.custom_script = Utils.formatOptions(_customScript) |
| | | param.LText = Utils.formatOptions(LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.DateCount = Utils.formatOptions(DateCount) |
| | | |
| | | if (menuType === 'HS') { // 云端数据验证 |
| | | param.open_key = Utils.encrypt(param.secretkey, param.timestamp, true) |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) |
| | | } |
| | | |
| | | return param |