| | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: dict['sup_key_req'] || '需要上级主键值!', |
| | | message: setting.supModTip || dict['sup_key_req'] || '需要上级主键值!', |
| | | duration: 5 |
| | | }) |
| | | return false |
| | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: window.GLOB.dict['sup_key_req'] || '需要上级主键值!', |
| | | message: setting.supModTip || window.GLOB.dict['sup_key_req'] || '需要上级主键值!', |
| | | duration: 5 |
| | | }) |
| | | _resolve() |
| | |
| | | record.mk_api_key = res.mk_api_key || '' |
| | | |
| | | if (res.status) { |
| | | if (res.mk_ex_invoke + '' === 'false' && params.length === 0) { |
| | | this.execSuccess(res) |
| | | _resolve() |
| | | } else if (res.mk_ex_invoke + '' === 'false' && params.length > 0) { |
| | | this.customLoopRequest(params, _resolve) |
| | | res.mk_ex_invoke = res.mk_ex_invoke + '' |
| | | |
| | | if (res.mk_ex_invoke === 'false') { |
| | | if (params.length === 0) { |
| | | this.execSuccess(res) |
| | | _resolve() |
| | | } else { |
| | | this.customLoopRequest(params, _resolve) |
| | | } |
| | | } else if (res.mk_ex_invoke === 'true_inside') { |
| | | let data = res.mk_in_api && typeof(res.mk_in_api) === 'object' ? res.mk_in_api : {} |
| | | |
| | | if (!data.hasOwnProperty('mk_api_key')) { |
| | | data.mk_api_key = record.mk_api_key |
| | | } |
| | | |
| | | this.customCallbackRequest(params, data, record, _resolve) |
| | | } else { |
| | | if (res.mk_ex_data) { // 数据分批执行 |
| | | if (Array.isArray(res.mk_ex_data) && res.mk_ex_data.length > 0) { |
| | |
| | | url = btn.interface |
| | | } |
| | | |
| | | url = url.replace(/@mydomain@/ig, window.GLOB.location) |
| | | |
| | | let param = {} |
| | | |
| | |
| | | * @description 外部请求循环执行 |
| | | */ |
| | | outerLoopRequest = (params, _resolve) => { |
| | | const { setting, btn } = this.props |
| | | const { setting, btn, BID } = this.props |
| | | |
| | | let param = params.shift() |
| | | |
| | |
| | | |
| | | Api.genericInterface(param, btn.$innerScript, 'inner').then(res => { |
| | | if (res.status) { |
| | | if ((res.mk_ex_invoke === 'false' || res.mk_ex_invoke === false) && params.length === 0) { |
| | | this.execSuccess(res) |
| | | _resolve() |
| | | } else if ((res.mk_ex_invoke === 'false' || res.mk_ex_invoke === false) && params.length > 0) { |
| | | this.outerLoopRequest(params, _resolve) |
| | | res.mk_ex_invoke = res.mk_ex_invoke + '' |
| | | |
| | | if (res.mk_ex_invoke === 'false') { |
| | | if (params.length === 0) { |
| | | this.execSuccess(res) |
| | | _resolve() |
| | | } else { |
| | | this.outerLoopRequest(params, _resolve) |
| | | } |
| | | } else if (res.mk_ex_invoke === 'true_inside') { |
| | | let data = res.mk_in_api && typeof(res.mk_in_api) === 'object' ? res.mk_in_api : {} |
| | | |
| | | if (!data.hasOwnProperty('mk_api_key')) { |
| | | data.mk_api_key = res.mk_api_key || '' |
| | | } |
| | | |
| | | // 使用处理后的数据调用外部接口 |
| | | let keys = Object.keys(data) // 提交外部接口前,添加BID |
| | | if (BID && keys.filter(key => key.toLowerCase() === 'bid').length === 0) { |
| | | data.BID = BID |
| | | } |
| | | |
| | | this.outerCallbackRequest(params, data, record, {}, _resolve) |
| | | } else { |
| | | delete res.mk_ex_invoke |
| | | delete res.ErrCode |
| | |
| | | |
| | | // 使用处理后的数据调用外部接口 |
| | | let keys = Object.keys(res) // 提交外部接口前,添加BID |
| | | if (this.props.BID && keys.filter(key => key.toLowerCase() === 'bid').length === 0) { |
| | | res.BID = this.props.BID |
| | | if (BID && keys.filter(key => key.toLowerCase() === 'bid').length === 0) { |
| | | res.BID = BID |
| | | } |
| | | |
| | | if (res.mk_api_key) { |
| | |
| | | tabId = btn.refreshTab[btn.refreshTab.length - 1] |
| | | } |
| | | |
| | | if (window.backend && btn.outerFunc && ['bd_workers_create_user_sso', 's_susers_del', 's_susers_add', 's_susers_update', 's_susers_start', 's_susers_admin'].includes(btn.outerFunc)) { |
| | | this.clearBackSqlCache() |
| | | if (window.backend && btn.outerFunc && ['bd_workers_create_user_sso', 's_susers_del', 's_susers_add', 's_susers_update', 's_susers_start', 's_susers_admin'].includes(btn.outerFunc.toLowerCase())) { |
| | | setTimeout(() => { |
| | | this.clearBackSqlCache() |
| | | }, 300) |
| | | } |
| | | |
| | | if (btn.openmenu && Array.isArray(btn.openmenu) && btn.openmenu.length > 0 && sign !== '@no_target_menu@') { |
| | |
| | | |
| | | if (btn.syncComponentId) { |
| | | if (btn.syncComponentId === 'multiComponent') { |
| | | btn.syncComponentIds.forEach((id, i) => { |
| | | setTimeout(() => { |
| | | if (/\$focus/.test(id)) { |
| | | MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', id) |
| | | } |
| | | }, 20 * i) |
| | | }) |
| | | if (btn.syncDelay) { |
| | | this.delayTimer && clearTimeout(this.delayTimer) |
| | | this.delayTimer = setTimeout(() => { |
| | | btn.syncComponentIds.forEach((id, i) => { |
| | | setTimeout(() => { |
| | | if (/\$focus/.test(id)) { |
| | | MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', id) |
| | | } |
| | | }, 20 * i) |
| | | }) |
| | | }, btn.syncDelay) |
| | | } else { |
| | | btn.syncComponentIds.forEach((id, i) => { |
| | | setTimeout(() => { |
| | | if (/\$focus/.test(id)) { |
| | | MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', id) |
| | | } |
| | | }, 20 * i) |
| | | }) |
| | | } |
| | | } else if (/\$focus/.test(btn.syncComponentId)) { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId.split('$')[0], btn.syncComponentId.split('$')[1]) |
| | | } else { |
| | |
| | | const { btn } = this.props |
| | | |
| | | if (!btn.verify) return |
| | | if (btn.verify.noteEnable !== 'true' && btn.verify.wxNote !== 'true' && btn.verify.printEnable !== 'true' && btn.verify.emailEnable !== 'true') return |
| | | if (btn.verify.noteEnable !== 'true' && btn.verify.wxNote !== 'true' && btn.verify.printEnable !== 'true' && btn.verify.emailEnable !== 'true' && btn.verify.DeepSeekable !== 'true') return |
| | | |
| | | let id = '' |
| | | if (btn.output) { |
| | |
| | | } |
| | | if (btn.verify.emailEnable === 'true') { |
| | | this.sendEmail(btn.verify, id) |
| | | } |
| | | if (btn.verify.DeepSeekable === 'true') { |
| | | this.openDeepSeek(id) |
| | | } |
| | | if (btn.verify.wxNote === 'true') { |
| | | if (btn.verify.wxTemplateId === 'mk_category_temp') { |
| | |
| | | }) |
| | | } |
| | | |
| | | openDeepSeek = (id) => { |
| | | let param = { |
| | | func: 's_get_deepseek_local', |
| | | upid: id |
| | | } |
| | | |
| | | param.LText = Utils.getuuid() |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | if (res.deepseek_text) { |
| | | sessionStorage.setItem('deepseek_sql', res.deepseek_text) |
| | | |
| | | window.open('#/ai') |
| | | |
| | | setTimeout(() => { |
| | | sessionStorage.removeItem('deepseek_sql') |
| | | }, 0) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 操作失败后处理 |
| | | * 1、状态码为 E、N、F、NM 时,显示相应提示信息 |
| | |
| | | loadingTotal: '', |
| | | }) |
| | | |
| | | if (btnconfig && btnconfig.setting && btnconfig.setting.errFocus) { |
| | | if (window.CACHE.errFocusId && (btnconfig || btn.OpenType === 'formSubmit')) { |
| | | MKEmitter.emit('mkFC', 'focus', window.CACHE.errFocusId) |
| | | |
| | | window.CACHE.errFocusId = '' |
| | | } else if (btnconfig && btnconfig.setting && btnconfig.setting.errFocus) { |
| | | MKEmitter.emit('mkFC', 'focus', btnconfig.setting.errFocus) |
| | | } |
| | | |
| | |
| | | |
| | | if (btn.syncComponentId) { |
| | | if (btn.syncComponentId === 'multiComponent') { |
| | | btn.syncComponentIds.forEach((id, i) => { |
| | | setTimeout(() => { |
| | | if (/\$focus/.test(id)) { |
| | | MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', id) |
| | | } |
| | | }, 20 * i) |
| | | }) |
| | | if (btn.syncDelay) { |
| | | this.delayTimer && clearTimeout(this.delayTimer) |
| | | this.delayTimer = setTimeout(() => { |
| | | btn.syncComponentIds.forEach((id, i) => { |
| | | setTimeout(() => { |
| | | if (/\$focus/.test(id)) { |
| | | MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', id) |
| | | } |
| | | }, 20 * i) |
| | | }) |
| | | }, btn.syncDelay) |
| | | } else { |
| | | btn.syncComponentIds.forEach((id, i) => { |
| | | setTimeout(() => { |
| | | if (/\$focus/.test(id)) { |
| | | MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', id) |
| | | } |
| | | }, 20 * i) |
| | | }) |
| | | } |
| | | } else if (/\$focus/.test(btn.syncComponentId)) { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId.split('$')[0], btn.syncComponentId.split('$')[1]) |
| | | } else { |
| | |
| | | _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') |
| | | } |
| | | } |
| | | if (_item.type === 'text' && /@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 特殊字段替换 |
| | | _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (BID || '')) |
| | | if (_item.type === 'text') { |
| | | if (/@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 特殊字段替换 |
| | | _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (BID || '')) |
| | | } |
| | | if (/@currentYear@/ig.test(_item.value)) { // 系统变量替换 |
| | | _item.value = _item.value.replace(/@currentYear@/ig, moment().format('YYYY')) |
| | | } |
| | | } |
| | | if (_item.type === 'text' && item.lenControl && item.lenControl !== 'limit') { |
| | | if (item.lenControl === 'left') { |