From 567cea64c520654876e8c1a7f4ca2baf2c1c773f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 25 十一月 2022 11:16:39 +0800 Subject: [PATCH] 2022-11-25 --- src/tabviews/custom/popview/index.jsx | 14 ---- src/tabviews/zshare/mutilform/index.jsx | 27 ++++++++- src/api/index.js | 15 +++-- src/tabviews/custom/index.jsx | 14 ---- src/tabviews/zshare/topSearch/index.jsx | 11 +-- src/tabviews/zshare/actionList/normalbutton/index.jsx | 13 ---- src/utils/utils.js | 4 - src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 10 +-- src/tabviews/zshare/actionList/printbutton/index.jsx | 13 ---- 9 files changed, 46 insertions(+), 75 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 5179db8..c64be2d 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -797,12 +797,15 @@ delete param.rduri } - let _param = JSON.parse(JSON.stringify(param)) // 缂撳瓨鏍¢獙锛屽幓闄ゆ椂闂村拰鍔犲瘑瀛楃 - delete _param.timestamp - delete _param.secretkey - delete _param.open_key - _param = JSON.stringify(_param) - _param = md5(_param) + let _param = '' + if (cache) { + _param = JSON.parse(JSON.stringify(param)) // 缂撳瓨鏍¢獙锛屽幓闄ゆ椂闂村拰鍔犲瘑瀛楃 + delete _param.timestamp + delete _param.secretkey + delete _param.open_key + _param = JSON.stringify(_param) + _param = md5(_param) + } if (cache && window.GLOB.CacheMap.has(_param)) { return Promise.resolve(window.GLOB.CacheMap.get(_param)) diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index f9ece5a..19bf7e3 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -6,7 +6,6 @@ import moment from 'moment' import Api from '@/api' -import options from '@/store/options.js' import asyncComponent from '@/utils/asyncComponent' import Utils, { getEditTableSql, getMark } from '@/utils/utils.js' import MkIcon from '@/components/mk-icon' @@ -939,6 +938,10 @@ if (item.type === 'text' && item.editable === 'true' && item.editType === 'select' && item.resourceType === '1') { let _option = Utils.getSelectQueryOptions(item) + if (window.GLOB.debugger === true || window.debugger === true) { + console.info(_option.sql) + } + item.base_sql = window.btoa(window.encodeURIComponent(_option.sql)) item.arr_field = _option.field @@ -1108,11 +1111,6 @@ localItems.push(`select '${item.uuid}' as obj_name,'${item.arr_field}' as arr_field,'${item.base_sql}' as LText`) } }) - - if (options.sysType !== 'local') { - localItems = [...localItems, ...mainItems] - mainItems = [] - } // 鏈湴璇锋眰 let param = { diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 0a2277e..3a28d2d 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -725,24 +725,12 @@ group.subButton.syncComponentId = '' } - let _sql = `Declare @mk_organization nvarchar(512) select @mk_organization='${sessionStorage.getItem('organization') || ''}'\n` - let _sso = _sql - let _local = _sql - group.fields = group.fields.map(cell => { // 鏁版嵁婧恠ql璇彞锛岄澶勭悊锛屾潈闄愰粦鍚嶅崟瀛楁璁剧疆涓洪殣钘忚〃鍗� if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(cell.type) && cell.resourceType === '1') { let _option = Utils.getSelectQueryOptions(cell) - if (cell.database === 'sso') { - cell.data_sql = Utils.formatOptions(_sso + _option.sql) - _sso = '' - } else { - cell.data_sql = Utils.formatOptions(_local + _option.sql) - _local = '' - } - - cell.base_sql = window.btoa(window.encodeURIComponent(_sql + _option.sql)) + cell.base_sql = _option.sql cell.arr_field = _option.field } diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx index 309e384..1f5597a 100644 --- a/src/tabviews/custom/popview/index.jsx +++ b/src/tabviews/custom/popview/index.jsx @@ -551,24 +551,12 @@ group.subButton.syncComponentId = '' } - let _sql = `Declare @mk_organization nvarchar(512) select @mk_organization='${sessionStorage.getItem('organization') || ''}'\n` - let _sso = _sql - let _local = _sql - group.fields = group.fields.map(cell => { // 鏁版嵁婧恠ql璇彞锛岄澶勭悊锛屾潈闄愰粦鍚嶅崟瀛楁璁剧疆涓洪殣钘忚〃鍗� if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(cell.type) && cell.resourceType === '1') { let _option = Utils.getSelectQueryOptions(cell) - - if (cell.database === 'sso') { - cell.data_sql = Utils.formatOptions(_sso + _option.sql) - _sso = '' - } else { - cell.data_sql = Utils.formatOptions(_local + _option.sql) - _local = '' - } - cell.base_sql = window.btoa(window.encodeURIComponent(_sql + _option.sql)) + cell.base_sql = _option.sql cell.arr_field = _option.field } diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 68b4cdb..bdbd6f8 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -2308,23 +2308,12 @@ handleModelConfig = (config) => { let roleId = sessionStorage.getItem('role_id') || '' // 瑙掕壊ID - let _sql = `Declare @mk_organization nvarchar(512) select @mk_organization='${sessionStorage.getItem('organization') || ''}'\n` - let _sso = _sql - let _local = _sql config.fields = config.fields.map(cell => { // 鏁版嵁婧恠ql璇彞锛岄澶勭悊锛屾潈闄愰粦鍚嶅崟瀛楁璁剧疆涓洪殣钘忚〃鍗� if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(cell.type) && cell.resourceType === '1') { let _option = Utils.getSelectQueryOptions(cell) - if (cell.database === 'sso') { - cell.data_sql = Utils.formatOptions(_sso + _option.sql) - _sso = '' - } else { - cell.data_sql = Utils.formatOptions(_local + _option.sql) - _local = '' - } - - cell.base_sql = window.btoa(window.encodeURIComponent(_sql + _option.sql)) + cell.base_sql = _option.sql cell.arr_field = _option.field } diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index fc6b529..99b5db8 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -1459,23 +1459,12 @@ handleModelConfig = (config) => { let roleId = sessionStorage.getItem('role_id') || '' // 瑙掕壊ID - let _sql = `Declare @mk_organization nvarchar(512) select @mk_organization='${sessionStorage.getItem('organization') || ''}'\n` - let _sso = _sql - let _local = _sql config.fields = config.fields.map(cell => { // 鏁版嵁婧恠ql璇彞锛岄澶勭悊锛屾潈闄愰粦鍚嶅崟瀛楁璁剧疆涓洪殣钘忚〃鍗� if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(cell.type) && cell.resourceType === '1') { let _option = Utils.getSelectQueryOptions(cell) - if (cell.database === 'sso') { - cell.data_sql = Utils.formatOptions(_sso + _option.sql) - _sso = '' - } else { - cell.data_sql = Utils.formatOptions(_local + _option.sql) - _local = '' - } - - cell.base_sql = window.btoa(window.encodeURIComponent(_sql + _option.sql)) + cell.base_sql = _option.sql cell.arr_field = _option.field } diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index d60164b..31e52f0 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -532,12 +532,26 @@ let mainItems = [] // 浜戠鎴栧崟鐐规暟鎹� let localItems = [] // 鏈湴鏁版嵁 let cache = action.setting.cache !== 'false' + let debug = window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud') + + let _sql = `Declare @mk_organization nvarchar(512) select @mk_organization='${sessionStorage.getItem('organization') || ''}'\n` + let _sso = _sql deForms.forEach(item => { if (item.database === 'sso') { - mainItems.push(`select '${item.field}' as obj_name,'${item.arr_field}' as arr_field,'${item.base_sql}' as LText`) + let sql = _sso + item.base_sql + _sso = '' + if (debug) { + console.info(sql) + } + mainItems.push(`select '${item.field}' as obj_name,'${item.arr_field}' as arr_field,'${window.btoa(window.encodeURIComponent(sql))}' as LText`) } else { - localItems.push(`select '${item.field}' as obj_name,'${item.arr_field}' as arr_field,'${item.base_sql}' as LText`) + let sql = _sql + item.base_sql + _sql = '' + if (debug) { + console.info(sql) + } + localItems.push(`select '${item.field}' as obj_name,'${item.arr_field}' as arr_field,'${window.btoa(window.encodeURIComponent(sql))}' as LText`) } }) @@ -635,16 +649,23 @@ */ improveSimpleActionForm = (deForms) => { let cache = this.props.action.setting.cache !== 'false' + let debug = window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud') + let _sql = `Declare @mk_organization nvarchar(512) select @mk_organization='${sessionStorage.getItem('organization') || ''}'\n` let deffers = deForms.map((form, index) => { let param = { func: 'sPC_Get_SelectedList', - LText: form.data_sql, + LText: _sql + form.base_sql, obj_name: form.field, arr_field: form.arr_field, BID: this.props.BID || '' } + + if (debug) { + console.info(param.LText) + } + param.LText = Utils.formatOptions(param.LText) param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') param.secretkey = Utils.encrypt(param.LText, param.timestamp) diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx index 86f124f..47a2ae4 100644 --- a/src/tabviews/zshare/topSearch/index.jsx +++ b/src/tabviews/zshare/topSearch/index.jsx @@ -173,6 +173,10 @@ if (item.resourceType === '1' && item.dataSource) { let _option = Utils.getSelectQueryOptions(item) + if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) { + console.info(_option.sql) + } + // 娴嬭瘯绯荤粺鍗曚釜璇锋眰 if (!window.GLOB.mkHS && options.sysType === 'local' && !window.GLOB.systemType) { deForms.push({ @@ -230,7 +234,7 @@ }, () => { if (!window.GLOB.mkHS && options.sysType === 'local' && window.GLOB.systemType !== 'production') { this.improveSimpleSearch(deForms) - } else { + } else if (mainItems.length > 0 || localItems.length > 0) { this.improveSearch(mainItems, localItems) } }) @@ -240,11 +244,6 @@ improveSearch = (mainItems, localItems) => { const { BID } = this.props let deffers = [] - - if (!window.GLOB.mkHS && options.sysType !== 'local') { - localItems = [...localItems, ...mainItems] - mainItems = [] - } // 鏈湴璇锋眰 let param = { diff --git a/src/utils/utils.js b/src/utils/utils.js index 3b79df9..af68c88 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -828,10 +828,6 @@ sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) - if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) { - console.info(sql) - } - return { sql: sql, field: arrfield -- Gitblit v1.8.0