From 66bdbc1df92e8ec4a5108a4e0323e25a7b9ff8f8 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 21 五月 2024 16:37:16 +0800 Subject: [PATCH] Merge branch 'develop' --- src/tabviews/custom/index.jsx | 41 ++++++++++++++++++++++------------------- 1 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index be36ae9..b56749d 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -77,7 +77,7 @@ * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅 */ async loadconfig () { - const { MenuID, MenuName } = this.props + const { MenuID, MenuName, param } = this.props let _param = { func: 'sPC_Get_LongParam', @@ -205,9 +205,18 @@ let roleId = sessionStorage.getItem('role_id') || '' // 瑙掕壊ID let balMap = new Map() let skip = config.permission === 'false' || window.GLOB.mkHS - let param = this.props.param || {} // url鍙傛暟 + let urlparam = {} // url鍙傛暟 + if (param) { + Object.keys(param).forEach(key => { + if (/^\$/.test(key)) { + urlparam[key] = param[key] + } else { + urlparam[key.toLowerCase()] = param[key] + } + }) + } - window.GLOB.CacheData.set(MenuID, param) + window.GLOB.CacheData.set(MenuID, urlparam) let userName = sessionStorage.getItem('User_Name') || '' let fullName = sessionStorage.getItem('Full_Name') || '' @@ -225,7 +234,7 @@ } if (config.urlFields) { config.urlFields.forEach(field => { - let val = `'${param[field] || ''}'` + let val = `'${urlparam[field.toLowerCase()] || ''}'` regs.push({ reg: new RegExp('@' + field + '@', 'ig'), value: val @@ -252,10 +261,10 @@ let initInters = [] config.interfaces = this.formatInterSetting(config.interfaces, regs, MenuID, initInters, config.MenuName) - config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, config.$cache, config.$time, config.MenuName, MenuID, MenuID, config.process === 'true') + config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, urlparam, MenuID, config.interfaces, config.$cache, config.$time, config.MenuName, MenuID, MenuID, config.process === 'true') let params = [] - let BID = param.$BID || '' + let BID = urlparam.$BID || '' let inherit = {} if (config.cacheUseful === 'true') { // 缂撳瓨缁ф壙 @@ -451,12 +460,7 @@ if (item.setting.supModule === 'preview') { item.setting.supModule = '' - let val = '' - Object.keys(urlparam).forEach(key => { - if (key.toLowerCase() === item.setting.controlField) { - val = urlparam[key] - } - }) + let val = urlparam[item.setting.controlField] || '' item.subtabs = item.subtabs.filter(tab => { if (tab.$pass) return true @@ -469,12 +473,7 @@ if (item.setting.selectField) { item.setting.selectField = item.setting.selectField.toLowerCase() - let val = '' - Object.keys(urlparam).forEach(key => { - if (key.toLowerCase() === item.setting.selectField) { - val = urlparam[key] - } - }) + let val = urlparam[item.setting.selectField] || '' let activeKey = '' @@ -633,7 +632,10 @@ col.type = 'custom' } - if (col.type === 'number') { + if (col.type === 'index') { + col.field = '$Index' + col.type = 'text' + } else if (col.type === 'number') { if (typeof(col.decimal) === 'number') { col.round = Math.pow(10, col.decimal) if (col.format === 'percent') { @@ -691,6 +693,7 @@ if (item.hasExtend) { item.setting.hasExtend = true + item.setting.tableMode = 'compatible' item.setting.extendTime = moment().format('YYYY-MM-DD HH:mm:ss') item.colsCtrls = null } -- Gitblit v1.8.0