From b69b5f6329ca5f87932436b7a6c1ddfc3377e10f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 16 五月 2024 10:56:41 +0800
Subject: [PATCH] 2024-05-16

---
 src/tabviews/custom/popview/index.jsx |   33 ++++++++++++++++-----------------
 1 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx
index f813ecc..4213bf9 100644
--- a/src/tabviews/custom/popview/index.jsx
+++ b/src/tabviews/custom/popview/index.jsx
@@ -62,7 +62,7 @@
    * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅
    */
   async loadconfig () {
-    const { Tab } = this.props
+    const { Tab, param } = this.props
 
     let config = Tab.config || ''
 
@@ -106,9 +106,18 @@
     // 鏉冮檺杩囨护
     let roleId = sessionStorage.getItem('role_id') || '' // 瑙掕壊ID
     let balMap = new Map()
-    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(Tab.uuid, param)
+    window.GLOB.CacheData.set(Tab.uuid, urlparam)
 
     let userName = sessionStorage.getItem('User_Name') || ''
     let fullName = sessionStorage.getItem('Full_Name') || ''
@@ -130,7 +139,7 @@
       regs.push({ reg: /@works_flow_code@/ig, value: `'${flow.flow_code || ''}'` })
     }
 
-    config.components = this.filterComponent(config.components, roleId, balMap, param, Tab, Tab.uuid, Tab.uuid)
+    config.components = this.filterComponent(config.components, roleId, balMap, urlparam, Tab, Tab.uuid, Tab.uuid)
     
     // 鑾峰彇涓绘悳绱㈡潯浠�
     config.components.forEach(component => {
@@ -144,7 +153,7 @@
     })
 
     let params = []
-    let BID = param.$BID || ''
+    let BID = urlparam.$BID || ''
 
     config.components = this.formatSetting(config.components, params, regs, balMap)
 
@@ -227,12 +236,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
@@ -245,12 +249,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 = ''
 

--
Gitblit v1.8.0