From ae170a9d58b4f91a225eada1dc83ed4a116b8d50 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 25 八月 2024 00:57:37 +0800 Subject: [PATCH] 2024-08-25 --- src/tabviews/zshare/actionList/normalbutton/index.jsx | 102 ++++++++++++++------------------------------------ 1 files changed, 29 insertions(+), 73 deletions(-) diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 1315430..47e76c9 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -48,7 +48,6 @@ dict: window.GLOB.dict } - moduleParams = null preCallback = null UNSAFE_componentWillMount () { @@ -225,7 +224,7 @@ this.setState({autoMatic: type === 'autoMatic'}) - let _this = this + let that = this let data = record || selectedData || [] let valid = this.checkBtnData(data) @@ -248,11 +247,11 @@ cancelText: dict['cancel'] || '鍙栨秷', onOk() { return new Promise(resolve => { - _this.execSubmit(data, resolve) + that.execSubmit(data, resolve) }) }, onCancel() { - _this.setState({loading: false}) + that.setState({loading: false}) } }) } else if (btn.OpenType === 'exec') { @@ -332,7 +331,7 @@ return } - let _this = this + let that = this let data = selectedData || [] let valid = this.checkBtnData(data) @@ -360,12 +359,12 @@ cancelText: dict['cancel'] || '鍙栨秷', onOk() { return new Promise(resolve => { - _this.execSubmit(data, resolve) + that.execSubmit(data, resolve) }) }, onCancel() { callback() - _this.setState({loading: false}) + that.setState({loading: false}) } }) } else if (btn.OpenType === 'exec') { @@ -469,11 +468,11 @@ param.ID = primaryId if (retmsg) { - const { sql, callbacksql } = getSysDefaultSql(btn, setting, '', param, data[0], columns, retmsg, this.moduleParams) // 鏁版嵁婧� + const { sql, callbacksql } = getSysDefaultSql(btn, setting, '', param, data[0], columns, retmsg) // 鏁版嵁婧� param.LText = sql param.$callbacksql = callbacksql } else { - param.LText = getSysDefaultSql(btn, setting, '', param, data[0], columns, false, this.moduleParams) // 鏁版嵁婧� + param.LText = getSysDefaultSql(btn, setting, '', param, data[0], columns, false) // 鏁版嵁婧� if (btn.output) { param.key_back_type = 'Y' } @@ -505,11 +504,11 @@ param.ID = primaryId || Utils.getguid() if (retmsg) { - const { sql, callbacksql } = getSysDefaultSql(btn, setting, formdata, param, data[0], columns, retmsg, this.moduleParams) // 鏁版嵁婧� + const { sql, callbacksql } = getSysDefaultSql(btn, setting, formdata, param, data[0], columns, retmsg) // 鏁版嵁婧� param.LText = sql param.$callbacksql = callbacksql } else { - param.LText = getSysDefaultSql(btn, setting, formdata, param, data[0], columns, false, this.moduleParams) // 鏁版嵁婧� + param.LText = getSysDefaultSql(btn, setting, formdata, param, data[0], columns, false) // 鏁版嵁婧� if (btn.output) { param.key_back_type = 'Y' } @@ -531,11 +530,11 @@ param.ID = primaryId if (retmsg) { - const { sql, callbacksql } = getSysDefaultSql(btn, setting, formdata, param, data[0], columns, retmsg, this.moduleParams) // 鏁版嵁婧� + const { sql, callbacksql } = getSysDefaultSql(btn, setting, formdata, param, data[0], columns, retmsg) // 鏁版嵁婧� param.LText = sql param.$callbacksql = callbacksql } else { - param.LText = getSysDefaultSql(btn, setting, formdata, param, data[0], columns, false, this.moduleParams) // 鏁版嵁婧� + param.LText = getSysDefaultSql(btn, setting, formdata, param, data[0], columns, false) // 鏁版嵁婧� if (btn.output) { param.key_back_type = 'Y' } @@ -597,11 +596,11 @@ param.ID = primaryId if (retmsg) { - const { sql, callbacksql } = getSysDefaultSql(btn, setting, '', param, cell, columns, retmsg, this.moduleParams) // 鏁版嵁婧� + const { sql, callbacksql } = getSysDefaultSql(btn, setting, '', param, cell, columns, retmsg) // 鏁版嵁婧� param.LText = sql param.$callbacksql = callbacksql } else { - param.LText = getSysDefaultSql(btn, setting, '', param, cell, columns, false, this.moduleParams) // 鏁版嵁婧� + param.LText = getSysDefaultSql(btn, setting, '', param, cell, columns, false) // 鏁版嵁婧� if (btn.output) { param.key_back_type = 'Y' } @@ -637,11 +636,11 @@ param.ID = Utils.getguid() if (retmsg) { - const { sql, callbacksql } = getSysDefaultSql(btn, setting, formdata, param, cell, columns, retmsg, this.moduleParams) // 鏁版嵁婧� + const { sql, callbacksql } = getSysDefaultSql(btn, setting, formdata, param, cell, columns, retmsg) // 鏁版嵁婧� param.LText = sql param.$callbacksql = callbacksql } else { - param.LText = getSysDefaultSql(btn, setting, formdata, param, cell, columns, false, this.moduleParams) // 鏁版嵁婧� + param.LText = getSysDefaultSql(btn, setting, formdata, param, cell, columns, false) // 鏁版嵁婧� if (btn.output) { param.key_back_type = 'Y' } @@ -663,11 +662,11 @@ param.ID = primaryId if (retmsg) { - const { sql, callbacksql } = getSysDefaultSql(btn, setting, formdata, param, cell, columns, retmsg, this.moduleParams) // 鏁版嵁婧� + const { sql, callbacksql } = getSysDefaultSql(btn, setting, formdata, param, cell, columns, retmsg) // 鏁版嵁婧� param.LText = sql param.$callbacksql = callbacksql } else { - param.LText = getSysDefaultSql(btn, setting, formdata, param, cell, columns, false, this.moduleParams) // 鏁版嵁婧� + param.LText = getSysDefaultSql(btn, setting, formdata, param, cell, columns, false) // 鏁版嵁婧� if (btn.output) { param.key_back_type = 'Y' } @@ -1006,53 +1005,10 @@ * @description 鎸夐挳鎻愪氦鎵ц */ execSubmit = (data, _resolve, formdata, force) => { - const { setting, btn } = this.props - this.moduleParams = null + const { btn } = this.props if (btn.preButton && !force) { this.trigger(btn.preButton, data, _resolve, formdata, 0) - } else if (btn.verify && btn.verify.invalid === 'true' && setting.dataresource) { - MKEmitter.emit('queryModuleParam', btn.$menuId, (param) => { - let datasource = setting.dataresource - let customScript = setting.customScript || '' - let allSearch = Utils.getAllSearchOptions(param.search) - - let regoptions = allSearch.map(item => { - return { - reg: new RegExp('@' + item.key + '@', 'ig'), - value: `'${item.value}'` - } - }) - - regoptions.push({ - reg: new RegExp('@userName@', 'ig'), - value: `'${sessionStorage.getItem('User_Name') || ''}'` - }, { - reg: new RegExp('@fullName@', 'ig'), - value: `'${sessionStorage.getItem('Full_Name') || ''}'` - }, { - reg: new RegExp('@orderBy@', 'ig'), - value: setting.order - }, { - reg: new RegExp('@pageSize@', 'ig'), - value: 10 - }, { - reg: new RegExp('@pageIndex@', 'ig'), - value: 1 - }) - - regoptions.forEach(item => { - datasource = datasource.replace(item.reg, item.value) - customScript = customScript.replace(item.reg, item.value) - }) - - this.moduleParams = { - datasource, - customScript - } - - this.execRealSubmit(data, _resolve, formdata) - }) } else { this.execRealSubmit(data, _resolve, formdata) } @@ -1833,7 +1789,7 @@ msg = msg.replace(/\n|\r/ig, '<br/>') msg = <span dangerouslySetInnerHTML={{__html: msg}}></span> } - const _this = this + const that = this confirm({ title: window.GLOB.dict['exec_sure'] || '璇风‘璁�', content: msg, @@ -1843,16 +1799,16 @@ return new Promise(resolve => { Api.genericInterface(unCheckParam).then(result => { if (result.status) { - _this.triggerNote(result, param.ID) // 娑堟伅 + that.triggerNote(result, param.ID) // 娑堟伅 if (params.length === 0) { - _this.execSuccess(result) + that.execSuccess(result) _resolve() } else { - _this.checkLoopRequest(params, _resolve) + that.checkLoopRequest(params, _resolve) } } else { - _this.execError(result) + that.execError(result) _resolve() } resolve() @@ -1860,7 +1816,7 @@ }) }, onCancel() { - _this.execError(res) + that.execError(res) _resolve() } }) @@ -3301,7 +3257,7 @@ modelconfirm = () => { const { BID } = this.props const { btnconfig, selines, dict } = this.state - let _this = this + let that = this let result = [] let _data = {} @@ -3449,12 +3405,12 @@ cancelText: dict['cancel'] || '鍙栨秷', onOk() { return new Promise(resolve => { - _this.execSubmit(selines, resolve, result) + that.execSubmit(selines, resolve, result) }) }, onCancel() { - _this.preCallback && _this.preCallback() - _this.setState({ loading: false }) + that.preCallback && that.preCallback() + that.setState({ loading: false }) } }) } -- Gitblit v1.8.0