From b0c7a660750a8b29e7f8b3a648296d56c50fd2ca Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 29 十一月 2022 18:43:10 +0800 Subject: [PATCH] Merge branch 'develop' --- src/tabviews/zshare/actionList/normalbutton/index.jsx | 190 +++++++++++++++++++++++++++++----------------- 1 files changed, 119 insertions(+), 71 deletions(-) diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index bdbd6f8..7b6b06b 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -42,7 +42,6 @@ loadingTotal: '', disabled: false, hidden: false, - checkParam: null, autoMatic: false, check: false } @@ -402,7 +401,6 @@ let param = { // 绯荤粺瀛樺偍杩囩▼ func: 'sPC_TableData_InUpDe' } - let check_param = null if (this.props.BID) { param.BID = this.props.BID @@ -442,11 +440,9 @@ param.secretkey = Utils.encrypt('', param.timestamp) if (/\$check@|@check\$/ig.test(param.LText)) { - check_param = fromJS(param).toJS() - check_param.LText = check_param.LText.replace(/\$check@/ig, '/*') - check_param.LText = check_param.LText.replace(/@check\$/ig, '*/') - check_param.LText = Utils.formatOptions(check_param.LText) - + if (btn.intertype === 'system') { + param.$unCheckParam = fromJS(param).toJS() + } param.LText = param.LText.replace(/\$check@|@check\$/ig, '') } @@ -487,11 +483,9 @@ param.secretkey = Utils.encrypt('', param.timestamp) if (/\$check@|@check\$/ig.test(param.LText)) { - check_param = fromJS(param).toJS() - check_param.LText = check_param.LText.replace(/\$check@/ig, '/*') - check_param.LText = check_param.LText.replace(/@check\$/ig, '*/') - check_param.LText = Utils.formatOptions(check_param.LText) - + if (btn.intertype === 'system') { + param.$unCheckParam = fromJS(param).toJS() + } param.LText = param.LText.replace(/\$check@|@check\$/ig, '') } @@ -522,11 +516,9 @@ param.secretkey = Utils.encrypt('', param.timestamp) if (/\$check@|@check\$/ig.test(param.LText)) { - check_param = fromJS(param).toJS() - check_param.LText = check_param.LText.replace(/\$check@/ig, '/*') - check_param.LText = check_param.LText.replace(/@check\$/ig, '*/') - check_param.LText = Utils.formatOptions(check_param.LText) - + if (btn.intertype === 'system') { + param.$unCheckParam = fromJS(param).toJS() + } param.LText = param.LText.replace(/\$check@|@check\$/ig, '') } @@ -536,9 +528,6 @@ if (window.GLOB.mkHS) { // 鍑芥暟 sPC_TableData_InUpDe 浜戠楠岃瘉 param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) - if (check_param) { - check_param.open_key = Utils.encryptOpenKey(check_param.secretkey, check_param.timestamp) - } } param.menuname = btn.logLabel @@ -547,13 +536,18 @@ param.s_debug_type = 'Y' } - if (check_param) { - check_param.menuname = btn.logLabel - this.setState({checkParam: check_param}) - } - if (window.GLOB.breakpoint) { param.func = 'sPC_TableData_InUpDe_debug' + } + + if (param.$unCheckParam) { + param.$unCheckParam.LText = param.$unCheckParam.LText.replace(/\$check@/ig, '/*').replace(/@check\$/ig, '*/') + param.$unCheckParam.LText = Utils.formatOptions(param.$unCheckParam.LText) + param.$unCheckParam.menuname = btn.logLabel + + if (window.GLOB.probation) { + param.$unCheckParam.s_debug_type = 'Y' + } } _params.push(param) @@ -589,11 +583,18 @@ } else { param.LText = param.LText.replace(/@\$|\$@/ig, '') } - param.LText = param.LText.replace(/\$check@|@check\$/ig, '') param.exec_type = 'y' // 鍚庡彴瑙g爜 param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') param.secretkey = Utils.encrypt('', param.timestamp) + + if (/\$check@|@check\$/ig.test(param.LText)) { + if (btn.intertype === 'system') { + param.$unCheckParam = fromJS(param).toJS() + } + param.LText = param.LText.replace(/\$check@|@check\$/ig, '') + } + param.LText = Utils.formatOptions(param.LText) } else if (btn.OpenType === 'pop') { // 琛ㄥ崟 if (index !== 0) { @@ -629,11 +630,18 @@ } else { param.LText = param.LText.replace(/@\$|\$@/ig, '') } - param.LText = param.LText.replace(/\$check@|@check\$/ig, '') param.exec_type = 'y' // 鍚庡彴瑙g爜 param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') param.secretkey = Utils.encrypt('', param.timestamp) + + if (/\$check@|@check\$/ig.test(param.LText)) { + if (btn.intertype === 'system') { + param.$unCheckParam = fromJS(param).toJS() + } + param.LText = param.LText.replace(/\$check@|@check\$/ig, '') + } + param.LText = Utils.formatOptions(param.LText) } else { param.ID = primaryId @@ -655,11 +663,18 @@ } else { param.LText = param.LText.replace(/@\$|\$@/ig, '') } - param.LText = param.LText.replace(/\$check@|@check\$/ig, '') param.exec_type = 'y' // 鍚庡彴瑙g爜 param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') param.secretkey = Utils.encrypt('', param.timestamp) + + if (/\$check@|@check\$/ig.test(param.LText)) { + if (btn.intertype === 'system') { + param.$unCheckParam = fromJS(param).toJS() + } + param.LText = param.LText.replace(/\$check@|@check\$/ig, '') + } + param.LText = Utils.formatOptions(param.LText) } } @@ -675,6 +690,16 @@ if (window.GLOB.breakpoint) { param.func = 'sPC_TableData_InUpDe_debug' + } + + if (param.$unCheckParam) { + param.$unCheckParam.LText = param.$unCheckParam.LText.replace(/\$check@/ig, '/*').replace(/@check\$/ig, '*/') + param.$unCheckParam.LText = Utils.formatOptions(param.$unCheckParam.LText) + param.$unCheckParam.menuname = btn.logLabel + + if (window.GLOB.probation) { + param.$unCheckParam.s_debug_type = 'Y' + } } return param @@ -995,7 +1020,9 @@ params = this.getInnerParam(data, formdata) } - if (params.length <= 20) { + if (params[0].$unCheckParam) { + this.checkLoopRequest(params, btn, _resolve) + } else if (params.length <= 20) { let deffers = params.map((param, i) => { return new Promise(resolve => { setTimeout(() => { @@ -1529,6 +1556,69 @@ } else { this.innerLoopRequest(params, btn, _resolve) } + } else { + this.execError(res) + _resolve() + } + }, () => { + this.updateStatus() + _resolve() + }) + } + + /** + * @description 鏁版嵁妫�楠屽惊鐜墽琛� + */ + checkLoopRequest = (params, btn, _resolve) => { + let param = params.shift() + let unCheckParam = param.$unCheckParam + + delete param.$unCheckParam + + this.setState({ + loadingNumber: params.length + }) + + Api.genericInterface(param).then(res => { + if (res.status) { + this.triggerNote(res) // 娑堟伅 + + if (params.length === 0) { + this.execSuccess(res) + _resolve() + } else { + this.checkLoopRequest(params, btn, _resolve) + } + } else if (res.ErrCode === 'C') { + const _this = this + confirm({ + title: '缁х画鎵ц锛�', + content: res.message, + onOk() { + return new Promise(resolve => { + Api.genericInterface(unCheckParam).then(result => { + if (result.status) { + _this.triggerNote(result) // 娑堟伅 + + if (params.length === 0) { + _this.execSuccess(result) + _resolve() + } else { + _this.checkLoopRequest(params, btn, _resolve) + } + } else { + _this.execError(res) + _resolve() + } + resolve() + }) + }) + }, + onCancel() { + _this.execError(res) + _resolve() + } + }) } else { this.execError(res) _resolve() @@ -2245,48 +2335,6 @@ loadingNumber: '', loadingTotal: '', }) - - if (res.ErrCode === 'C') { - const _this = this - if (this.state.checkParam) { - let param = this.state.checkParam - confirm({ - title: res.message || res.ErrMesg, - content: '缁х画鎵ц锛�', - onOk() { - return new Promise(resolve => { - Api.genericInterface(param).then((result) => { - if (result.status) { - _this.execSuccess(result) - } else { - _this.execError(result) - } - resolve() - }, () => { - _this.setState({ - visible: false - }) - resolve() - }) - }) - }, - onCancel() { - _this.setState({ - visible: false - }) - if (btn.execError !== 'never') { - MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execError, btn, '', this.state.selines) - } - } - }) - this.setState({checkParam: null}) - return - } else { - Modal.error({ - title: res.message || res.ErrMesg, - }) - } - } if (btnconfig && btnconfig.setting && btnconfig.setting.errFocus) { MKEmitter.emit('mkFC', 'focus', btnconfig.setting.errFocus) -- Gitblit v1.8.0