From 1d1ef9c117f162f5ee48237b67d69fbd015b10d1 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 23 七月 2023 10:32:40 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/tabviews/zshare/actionList/excelInbutton/index.jsx | 58 +++++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 41 insertions(+), 17 deletions(-) diff --git a/src/tabviews/zshare/actionList/excelInbutton/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/index.jsx index b632588..8227172 100644 --- a/src/tabviews/zshare/actionList/excelInbutton/index.jsx +++ b/src/tabviews/zshare/actionList/excelInbutton/index.jsx @@ -78,7 +78,7 @@ if (data.length > 0) { data.forEach(item => { let s = item[btn.controlField] !== undefined ? item[btn.controlField] + '' : '' - if (btn.controlVals.includes(s)) { + if (btn.controlVals.includes(s) || item.$lock) { disabled = true } }) @@ -199,12 +199,26 @@ MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execSuccess, btn, '', this.state.selines) } - btn.syncComponentId && MKEmitter.emit('reloadData', btn.syncComponentId) - + if (btn.syncComponentId) { + if (btn.syncComponentId === 'multiComponent') { + btn.syncComponentIds.forEach((id, i) => { + setTimeout(() => { + MKEmitter.emit('reloadData', id) + }, 20 * i) + }) + } else { + MKEmitter.emit('reloadData', btn.syncComponentId) + } + } + if (btn.switchTab && btn.switchTab.length > 0) { let id = btn.switchTab[btn.switchTab.length - 1] let node = document.getElementById('tab' + id) node && node.click() + } + + if (btn.execSuccess === 'popclose' && btn.$tabId) { // 鏍囩鍏抽棴鍒锋柊 + MKEmitter.emit('refreshPopButton', btn.$tabId) } } @@ -246,6 +260,10 @@ MKEmitter.emit('popclose') } else if (btn.execError !== 'never') { MKEmitter.emit('refreshByButtonResult', btn.$menuId, btn.execError, btn, '', this.state.selines) + } + + if (btn.execError === 'popclose' && btn.$tabId) { // 鏍囩鍏抽棴鍒锋柊 + MKEmitter.emit('refreshPopButton', btn.$tabId) } } @@ -296,7 +314,7 @@ }) } - let result = getExcelInSql(btn, data, this.state.dict, (this.props.BID || ''), this.state.primaryId) + let result = getExcelInSql(btn, data, (this.props.BID || ''), this.state.primaryId) if (result.errors) { notification.warning({ @@ -321,13 +339,11 @@ param.func = 'sPC_TableData_InUpDe' if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺 - result.sql = result.sql.replace(/\$@/ig, '/*') - result.sql = result.sql.replace(/@\$/ig, '*/') - result.bottom = result.bottom.replace(/\$@/ig, '/*') - result.bottom = result.bottom.replace(/@\$/ig, '*/') + result.sql = result.sql.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'') + result.bottom = result.bottom.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'') } else { - result.sql = result.sql.replace(/@\$|\$@/ig, '') - result.bottom = result.bottom.replace(/@\$|\$@/ig, '') + result.sql = result.sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'') + result.bottom = result.bottom.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'') } param.excel_in_type = 'true' @@ -398,7 +414,8 @@ } else { this.execError(res) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.execError({}) }) } else { @@ -408,7 +425,8 @@ } else { this.execError(res) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.execError({}) }) } @@ -421,11 +439,13 @@ } else { this.execError(res) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.execError({}) }) } else if (btn.intertype === 'outer') { // 澶栭儴鎺ュ彛 let _outParam = null + let ver_token = false new Promise(resolve => { // 鍐呴儴璇锋眰 @@ -449,7 +469,8 @@ this.execError(res) resolve(false) } - }, () => { + }, (error) => { + if (error && error.ErrCode === 'LoginError') return this.execError({}) }) } else { @@ -483,6 +504,7 @@ } else { param.$token = btn.exInterface || '' } + ver_token = true } else { if (window.GLOB.systemType === 'production' && btn.proInterface) { param.rduri = btn.proInterface @@ -509,9 +531,11 @@ return Api.genericInterface(res) }).then(response => { - if (!response) return + if (!response || response.ErrCode === 'LoginError') return // 鍥炶皟璇锋眰 - if (btn.callbackFunc) { + if (ver_token && response.ErrMesg === 'token_error') { + this.execError(response) + } else if (btn.callbackFunc ) { // 瀛樺湪鍥炶皟鍑芥暟鏃讹紝璋冪敤 delete response.message delete response.status @@ -528,7 +552,7 @@ } } }).then(res => { - if (!res) return + if (!res || res.ErrCode === 'LoginError') return if (res.status) { this.execSuccess(res) -- Gitblit v1.8.0