From 1a176e4bdba485301385caac1a29102e598d25cc Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 13 五月 2025 11:32:02 +0800 Subject: [PATCH] 2025-05-13 --- src/tabviews/basetable/index.jsx | 102 ++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 76 insertions(+), 26 deletions(-) diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx index b02c94b..2c95369 100644 --- a/src/tabviews/basetable/index.jsx +++ b/src/tabviews/basetable/index.jsx @@ -2,6 +2,7 @@ import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' import { notification, Spin, Row, Col } from 'antd' +import md5 from 'md5' import Api from '@/api' import Utils from '@/utils/utils.js' @@ -16,6 +17,7 @@ const FlowFloat = asyncComponent(() => import('@/tabviews/zshare/flowFloat')) const SettingComponent = asyncComponent(() => import('@/tabviews/zshare/settingcomponent')) const TableNodes = asyncComponent(() => import('@/tabviews/zshare/tablenodes')) +const DeepSeek = asyncComponent(() => import('@/tabviews/zshare/deepseek')) const AutoMatic = asyncComponent(() => import('@/tabviews/zshare/automatic')) const DebugTable = asyncComponent(() => import('@/tabviews/debugtable')) @@ -38,7 +40,8 @@ userConfig: null, // 鐢ㄦ埛鑷畾涔夎缃� visible: false, // 鏍囩椤垫帶鍒� shortcuts: null, // 蹇嵎閿� - autoMatic: null + autoMatic: null, + noParam: false } /** @@ -46,10 +49,15 @@ */ async loadconfig () { const { MenuID, MenuName, param } = this.props + const { noParam } = this.state let _param = { func: 'sPC_Get_LongParam', MenuID: MenuID + } + + if (window.GLOB.mkHS) { + _param.lang = 'zh-CN' } let result = await Api.getCacheConfig(_param) @@ -163,16 +171,44 @@ let skip = window.GLOB.mkHS let urlparam = {} // url鍙傛暟 if (param) { - Object.keys(param).forEach(key => { - if (/^\$/.test(key)) { - urlparam[key] = param[key] - } else { - urlparam[key.toLowerCase()] = param[key] - } + if (!noParam) { + Object.keys(param).forEach(key => { + if (/^\$/.test(key)) { + urlparam[key] = param[key] + } else { + urlparam[key.toLowerCase()] = param[key] + } + }) + } else { + urlparam.$BID = param.$BID + } + } + + 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) + config.allSqls.forEach(item => { + item.id = md5(window.GLOB.appkey + item.v_id) + if (['datasource', 'interface', 'excelOut'].includes(item.type)) { + item.urlkeys = keys + item.urlparam = urlparam + if (config.flow_code) { + item.works_flow_code = config.flow_code + } + } + window.GLOB.CacheData.set('sql_' + item.uuid, item) + }) + } let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' @@ -190,7 +226,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 @@ -356,8 +392,9 @@ Utils.initSearchVal(item) if (urlparam.$searchkey) { + let reg = new RegExp('(^|,)' + urlparam.$searchkey + '($|,)', 'ig') item.search.forEach(cell => { - if (urlparam.$searchkey === cell.field.toLowerCase() && ['text', 'select', 'link', 'checkcard'].includes(cell.type)) { + if (reg.test(cell.field) && ['text', 'select', 'link', 'checkcard'].includes(cell.type)) { cell.initval = urlparam.$searchval } }) @@ -504,19 +541,13 @@ if (cell.OpenType === 'excelOut') { // 瀵煎嚭 cell.$menuName = item.$menuname - - if (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0) { - cell.errorType = 'error1' - } else if (cell.intertype === 'system' && cell.verify.dataType !== 'custom' && item.setting.interType !== 'system') { - cell.errorType = 'error2' - } + } else if (cell.OpenType === 'pop' && cell.modal) { + cell.modal.uuid = cell.uuid + '_pop' } if (cell.verify) { if (cell.verify.invalid === 'true') { - if (item.wrap && (item.wrap.datatype === 'static' || item.wrap.datatype === 'public')) { - cell.verify.invalid = 'false' - } else if (item.setting && item.setting.maxScript && item.setting.maxScript >= 300) { + if (item.setting && item.setting.maxScript && item.setting.maxScript >= 300) { cell.verify.invalid = 'false' } else if (cell.intertype !== 'system' && cell.procMode !== 'system') { cell.verify.invalid = 'false' @@ -544,12 +575,20 @@ } if (/#position-inner/.test(script)) { cell.$innerScript = script + + if (window.backend && window.GLOB.CacheData.has('sql_' + cell.uuid) && !/\$backend/.test(script)) { + window.GLOB.CacheData.delete('sql_' + cell.uuid) + } } if (/#position-outer/.test(script)) { cell.$outerScript = script } if (/#position-callback/.test(script)) { cell.$callbackScript = script + + if (window.backend && window.GLOB.CacheData.has('sql_back_' + cell.uuid) && !/\$backend/.test(script)) { + window.GLOB.CacheData.delete('sql_back_' + cell.uuid) + } } } } @@ -562,6 +601,7 @@ } } else if (cell.syncComponentId === 'multiComponent') { let ids = cell.syncComponents.map(m => { + if (Array.isArray(m)) return m.pop() || '' return m.syncComId.pop() || '' }) @@ -632,6 +672,8 @@ return component } + component.setting.uuid = component.uuid + let _customScript = '' let _tailScript = '' component.scripts && component.scripts.forEach(script => { @@ -654,9 +696,6 @@ if (!component.setting.execute) { component.setting.dataresource = '' } - if (/\s/.test(component.setting.dataresource)) { - component.setting.dataresource = '(' + component.setting.dataresource + ') tb' - } if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺 component.setting.dataresource = component.setting.dataresource.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'') @@ -676,26 +715,35 @@ component.setting.customScript = _customScript // 鏁寸悊鍚庤嚜瀹氫箟鑴氭湰 component.setting.tailScript = _tailScript // 鍚庣疆鑷畾涔夎剼鏈� + component.setting.custompage = false - component.setting.custompage = /@pageSize@|@orderBy@/i.test(component.setting.dataresource + component.setting.customScript) + if (/order\s+by\s+sort_id\s*$/i.test(component.setting.dataresource)) { + component.setting.custompage = true + } else if (/@pageSize@|@orderBy@|@mk_total/i.test(component.setting.dataresource + component.setting.customScript)) { + component.setting.custompage = true + } + + if (/\s/.test(component.setting.dataresource)) { + component.setting.dataresource = '(' + component.setting.dataresource + ') tb' + } if (!component.setting.execute || component.setting.custompage) { component.forbidLine = true } - component.setting.delay = delay + component.setting.delay = delay + (component.setting.delay || 0) delay += 20 return component }) } - reloadMenuView = (menuId) => { + reloadMenuView = (menuId, clear) => { const { MenuID } = this.props if (MenuID !== menuId) return - this.reloadview() + this.reloadview(clear) } resetActiveMenu = (menuId) => { @@ -757,7 +805,7 @@ }) } - reloadview = () => { + reloadview = (clear) => { window.GLOB.CacheData.delete(this.props.MenuID) if (this.state.config) { this.deleteCache(this.state.config.components) @@ -769,6 +817,7 @@ viewlost: false, // 椤甸潰涓㈠け锛�1銆佹湭鑾峰彇鍒伴厤缃�-椤甸潰涓㈠け锛�2銆侀〉闈㈡湭鍚敤 config: null, // 椤甸潰閰嶇疆淇℃伅锛屽寘鎷粍浠剁瓑 shortcuts: null, + noParam: clear === true }, () => { this.loadconfig() }) @@ -820,6 +869,7 @@ {config.process === 'true' ? <FlowFloat config={config}/> : null} <SettingComponent config={config} shortcuts={shortcuts || []}/> <TableNodes config={config} /> + <DeepSeek/> </div> </div> ) -- Gitblit v1.8.0