From 4eb6fb4b827c8ac5ed45dfe00e87ccbb3d55682e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 11 九月 2024 16:00:49 +0800 Subject: [PATCH] 2024-09-11 --- src/index.js | 6 ++ src/api/index.js | 23 +++++++++++ src/views/billprint/index.jsx | 40 +++++++++++++++---- src/tabviews/zshare/actionList/normalbutton/index.jsx | 34 +++++++++++++++++ src/tabviews/zshare/actionList/printbutton/index.jsx | 2 5 files changed, 94 insertions(+), 11 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 48de454..4a1a60d 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1050,6 +1050,29 @@ } /** + * @description 娓呯┖鍚庣缂撳瓨 + */ + cacheInterface (param) { + param.userid = sessionStorage.getItem('UserID') || '' + param.LoginUID = sessionStorage.getItem('LoginUID') || '' + param.appkey = window.GLOB.appkey || '' + + let url = '/webapi/excache' + if (param.rduri && !window.GLOB.transfer) { + url = param.rduri + delete param.rduri + } + + param = this.encryptParam(param) + + return axios({ + url: url, + method: 'post', + data: JSON.stringify(param), + }) + } + + /** * @description 涓婁紶base64 * @param {String} base64 base64鍥剧墖缂栫爜 */ diff --git a/src/index.js b/src/index.js index 1fac703..78cea1c 100644 --- a/src/index.js +++ b/src/index.js @@ -159,7 +159,6 @@ } if (/#\/hs$/.test(window.location.href)) { // hs涓嬩笉鎵撳嵃鑴氭湰 - config.systemRun = '' // hs 涓嶄娇鐢ㄥ悗绔浛鎹� GLOB.debugger = false if (GLOB.mainSystemApi) { @@ -169,6 +168,11 @@ if (GLOB.cloudServiceApi) { GLOB.mainSystemApi = GLOB.cloudServiceApi } + + if (config.systemRun === 'backend') { + config.systemRun = '' // hs 涓嶄娇鐢ㄥ悗绔浛鎹� + GLOB.backend = true + } } if (process.env.NODE_ENV === 'production') { // 鐢ㄤ簬鏍¢獙鏄惁瀛樺湪寮�鍙戞潈闄� diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 7eb4679..913ab6b 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -1582,6 +1582,13 @@ _resolve() }) } else if (params.length <= 20 && btn.execType !== 'single') { + if (window.backend && params[0].$backend && (!btn.verify || (btn.verify.printEnable !== 'true' && !btn.output))) { + params = [{ + $backend: true, + data: params.map(item => item.data[0]) + }] + } + let deffers = params.map((param, i) => { return new Promise(resolve => { setTimeout(() => { @@ -2709,6 +2716,7 @@ _resolve() } else { if (params.length === 0) { + this.clearBackCache() this.execSuccess(res) _resolve() } else { @@ -2730,6 +2738,7 @@ _resolve() } else { if (params.length === 0) { + this.clearBackCache() this.execSuccess(res) _resolve() } else { @@ -2746,6 +2755,7 @@ _resolve() } else { if (params.length === 0) { + this.clearBackCache() this.execSuccess(re) _resolve() } else { @@ -2756,6 +2766,30 @@ } } + clearBackCache = () => { + if (!window.GLOB.backend) return + + Api.cacheInterface({}).then(res => { + if (!res.status) { + notification.warning({ + top: 92, + message: res.message || '缂撳瓨娓呯┖澶辫触锛�', + duration: 5 + }) + } else if (window.GLOB.mainSystemApi) { + Api.cacheInterface({rduri: window.GLOB.mainSystemApi.replace('dostars', 'excache')}).then(result => { + if (!result.status) { + notification.warning({ + top: 92, + message: result.message || '缂撳瓨娓呯┖澶辫触锛�', + duration: 5 + }) + } + }) + } + }) + } + /** * @description 鎿嶄綔鎴愬姛鍚庡鐞� * 1銆乪xcel瀵煎嚭锛屾垚鍔熷悗鍙栨秷瀵煎嚭鎸夐挳鍔犺浇涓姸鎬� diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index 768d2f9..27c3a94 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -923,7 +923,7 @@ Promise.all(deffers).then(result => { let errorMsg = '' result.forEach(res => { - if (!res.status) { + if (!res.status && !errorMsg) { errorMsg = res } }) diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx index f708040..0ea001b 100644 --- a/src/views/billprint/index.jsx +++ b/src/views/billprint/index.jsx @@ -558,11 +558,11 @@ } else if (_tailScript) { component.setting.sync = 'false' } + component.dataName = 'mk' + component.uuid.slice(-18) // floor 缁勪欢鐨勫眰绾� // pageable 鏄惁鍒嗛〉锛岀粍浠跺睘鎬э紝涓嶅垎椤电殑缁勪欢鎵嶅彲浠ョ粺涓�鏌ヨ if (component.setting.sync === 'true') { - component.dataName = 'mk' + component.uuid.slice(-18) let param = this.getDefaultParam(component) _pars.push(param) } else if (component.subtype !== 'dualdatacard') { @@ -580,8 +580,28 @@ _pars = this.getFormatParam(_pars, config.MenuName) if (_pars) { - _pars.componentId = 'union' + _pars.componentId = '' params.unshift(_pars) + } else if (window.backend && config.allSqls && params.length > 0) { + let data = [] + params = params.filter(item => { + if (!item.$backend || item.public) return true + + item.data[0].exps.forEach(cell => { + if (cell.key === 'mk_obj_name') { + cell.value = 'mk' + item.componentId.slice(-18) + } + }) + data.push(item.data[0]) + return false + }) + if (data.length > 0) { + params.push({ + $backend: true, + componentId: '', + data + }) + } } if (config.everyPCount && !config.printPage) { // 鍏煎 @@ -904,11 +924,13 @@ return new Promise(resolve => { Api.genericInterface(item).then(res => { if (!res.status) { - notification.warning({ - top: 92, - message: res.message, - duration: 5 - }) + if (res.ErrCode !== '-2') { + notification.warning({ + top: 92, + message: res.message, + duration: 5 + }) + } resolve() } else { let _data = { $$empty: true } @@ -950,7 +972,7 @@ } if (res.ErrCode === 'version_up') { this.reloadTabs() - } else { + } else if (res.ErrCode !== '-2') { notification.warning({ top: 92, message: res.message, @@ -990,7 +1012,7 @@ _results.forEach(res => { if ((res.componentId === item.uuid || res.componentId === item.componentId) && res.data) { item.dataArray = fromJS(res.data).toJS() - } else if (res.componentId === 'union' && res[item.dataName]) { + } else if (res[item.dataName]) { let data = res[item.dataName] if (!Array.isArray(data)) { data = [data] -- Gitblit v1.8.0