| | |
| | | static propTpyes = { |
| | | BID: PropTypes.string, // 主表ID |
| | | BData: PropTypes.any, // 主表数据 |
| | | selectedData: PropTypes.any, // 子表中选择数据 |
| | | btn: PropTypes.object, // 按钮 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | updateStatus: PropTypes.func, // 按钮状态更新 |
| | |
| | | * @description 获取用户自定义存储过程传参 |
| | | */ |
| | | getExcelCustomParam = (orderBy, search, pagination = false, pageIndex = 1, pageSize = 100) => { |
| | | const { btn, selectedData } = this.props |
| | | let _search = Utils.formatCustomMainSearch(search) |
| | | |
| | | let param = { |
| | |
| | | // 数据管理权限 |
| | | if (sessionStorage.getItem('dataM') === 'true') { |
| | | param.dataM = 'Y' |
| | | } |
| | | |
| | | if (btn.Ot === 'requiredOnce' && selectedData && selectedData.length > 0) { |
| | | let primaryId = selectedData.map(d => d.$$uuid || '').filter(Boolean).join(',') |
| | | if (primaryId) { |
| | | param.ID = primaryId |
| | | } |
| | | } |
| | | |
| | | if (this.props.BID) { |
| | |
| | | * @description 获取默认存储过程请求参数 |
| | | */ |
| | | getExcelDefaultParam = (arr_field, orderBy, search, pagination = false, pageIndex = 1, pageSize = 100) => { |
| | | const { setting, btn } = this.props |
| | | const { setting, btn, selectedData, BID } = this.props |
| | | |
| | | let defaultSql = setting.execute || setting.default || 'true' |
| | | let customScript = setting.customScript || '' |
| | | let _dataresource = setting.dataresource || '' |
| | | let queryType = setting.queryType |
| | | let primaryKey = setting.primaryKey || 'ID' |
| | | |
| | | if (btn.verify.dataType === 'custom') { |
| | | defaultSql = btn.verify.defaultSql || 'true' |
| | | _dataresource = btn.verify.dataresource || '' |
| | | queryType = btn.verify.queryType |
| | | primaryKey = btn.verify.primaryKey || 'ID' |
| | | |
| | | if (/\s/.test(_dataresource)) { |
| | | _dataresource = '(' + _dataresource + ') tb' |
| | |
| | | param.dataM = 'Y' |
| | | } |
| | | |
| | | if (this.props.BID) { |
| | | param.BID = this.props.BID |
| | | if (BID) { |
| | | param.BID = BID |
| | | } |
| | | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | |
| | | _search = '' |
| | | } |
| | | |
| | | let primaryId = '' |
| | | if (btn.Ot === 'requiredOnce' && selectedData && selectedData.length > 0) { |
| | | primaryId = selectedData.map(d => d.$$uuid || '').filter(Boolean).join(',') |
| | | if (_search && primaryId) { |
| | | _search += ` and ${primaryKey} in (select ID from dbo.SplitComma('${primaryId}'))` |
| | | } else if (primaryId) { |
| | | _search = `where ${primaryKey} in (select ID from dbo.SplitComma('${primaryId}'))` |
| | | } |
| | | } |
| | | |
| | | let LText = '' |
| | | |
| | | if (defaultSql !== 'false' && !pagination) { |
| | |
| | | ` |
| | | } |
| | | |
| | | LText = LText.replace(/@ID@/ig, `'${primaryId || ''}'`) |
| | | param.custom_script = param.custom_script.replace(/@ID@/ig, `'${primaryId || ''}'`) |
| | | LText = LText.replace(/@BID@/ig, `'${BID}'`) |
| | | param.custom_script = param.custom_script.replace(/@BID@/ig, `'${BID}'`) |
| | | LText = LText.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`) |
| | | param.custom_script = param.custom_script.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`) |
| | | LText = LText.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) |
| | | param.custom_script = param.custom_script.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) |
| | | LText = LText.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) |
| | | param.custom_script = param.custom_script.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) |
| | | LText = LText.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) |
| | | param.custom_script = param.custom_script.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) |
| | | LText = LText.replace(/@typename@/ig, `'admin'`) |
| | | param.custom_script = param.custom_script.replace(/@typename@/ig, `'admin'`) |
| | | |
| | | // 测试系统打印查询语句 |
| | | if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) { |
| | | param.custom_script && console.info(`${LText ? '' : '/*不执行默认sql*/\n'}${param.custom_script}`) |