From e32da8209870f65c79a8ab61e570082e5732dea8 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 04 三月 2025 10:15:13 +0800 Subject: [PATCH] 2025-03-04 --- src/tabviews/basetable/index.jsx | 22 +++++------ src/tabviews/custom/index.jsx | 22 +++++------ src/views/billprint/index.jsx | 38 +++++++++++------- 3 files changed, 43 insertions(+), 39 deletions(-) diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx index d53e693..17ca612 100644 --- a/src/tabviews/basetable/index.jsx +++ b/src/tabviews/basetable/index.jsx @@ -180,21 +180,19 @@ } } + if (config.urlFields && config.urlFields.length) { + config.urlFields.forEach(field => { + let key = field.toLowerCase() + if (urlparam[key] !== undefined) return + + urlparam[key] = '' + }) + } + window.GLOB.CacheData.set(MenuID, urlparam) if (window.backend && config.allSqls) { let keys = Object.keys(urlparam) - - if (config.urlFields && config.urlFields.length) { - config.urlFields.forEach(field => { - let key = field.toLowerCase() - if (keys.includes(key)) return - - keys.push(key) - urlparam[key] = '' - }) - } - config.allSqls.forEach(item => { item.id = md5(window.GLOB.appkey + item.v_id) if (['datasource', 'interface', 'excelOut'].includes(item.type)) { @@ -224,7 +222,7 @@ } if (config.urlFields) { config.urlFields.forEach(field => { - let val = `'${urlparam[field.toLowerCase()] || ''}'` + let val = `'${urlparam[field.toLowerCase()]}'` regs.push({ reg: new RegExp('@' + field + '@', 'ig'), value: val diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 075b3ad..746f9c8 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -225,21 +225,19 @@ } } + if (config.urlFields && config.urlFields.length) { + config.urlFields.forEach(field => { + let key = field.toLowerCase() + if (urlparam[key] !== undefined) return + + urlparam[key] = '' + }) + } + window.GLOB.CacheData.set(MenuID, urlparam) if (window.backend && config.allSqls) { let keys = Object.keys(urlparam) - - if (config.urlFields && config.urlFields.length) { - config.urlFields.forEach(field => { - let key = field.toLowerCase() - if (keys.includes(key)) return - - keys.push(key) - urlparam[key] = '' - }) - } - config.allSqls.forEach(item => { item.id = md5(window.GLOB.appkey + item.v_id) if (['datasource', 'interface', 'excelOut'].includes(item.type)) { @@ -269,7 +267,7 @@ } if (config.urlFields) { config.urlFields.forEach(field => { - let val = `'${urlparam[field.toLowerCase()] || ''}'` + let val = `'${urlparam[field.toLowerCase()]}'` regs.push({ reg: new RegExp('@' + field + '@', 'ig'), value: val diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx index 5dadc6f..a202327 100644 --- a/src/views/billprint/index.jsx +++ b/src/views/billprint/index.jsx @@ -66,11 +66,22 @@ let param = JSON.parse(window.decodeURIComponent(window.atob(params.param))) sessionStorage.setItem('dataM', param.dataM || '') + let urlParam = {...param} + + delete urlParam.tempId + delete urlParam.pageId + delete urlParam.dataM + + Object.keys(urlParam).forEach(key => { + if (key === key.toLowerCase()) return + urlParam[key.toLowerCase()] = urlParam[key] + delete urlParam[key] + }) this.setState({ BID: param.id || '', tempId: param.tempId, - urlParam: param, + urlParam: urlParam, pageId: param.pageId || '' }, () => { setTimeout(() => { @@ -321,20 +332,17 @@ config.components = config.components.filter(item => !['tabs', 'search'].includes(item.type)) - if (window.backend && config.allSqls) { - let urlparam = urlParam || {} - let keys = Object.keys(urlparam) + let urlparam = urlParam ? {...urlParam} : {} + if (config.urlFields && config.urlFields.length) { + config.urlFields.forEach(field => { + let key = field.toLowerCase() + if (urlparam[key] !== undefined) return + urlparam[key] = '' + }) + } - if (config.urlFields && config.urlFields.length) { - config.urlFields.forEach(field => { - let key = field.toLowerCase() - if (keys.includes(key)) return - - keys.push(key) - urlparam[key] = '' - }) - } - + if (window.backend && config.allSqls) { + let keys = Object.keys(urlparam) config.allSqls.forEach(item => { item.id = md5(window.GLOB.appkey + item.v_id) if (['datasource', 'interface', 'excelOut'].includes(item.type)) { @@ -365,7 +373,7 @@ if (config.urlFields) { config.urlFields.forEach(field => { - let val = `'${urlParam ? (urlParam[field] || '') : ''}'` + let val = `'${urlparam[field.toLowerCase()]}'` regs.push({ reg: new RegExp('@' + field + '@', 'ig'), value: val -- Gitblit v1.8.0