From 50821207863ae07b0ab36a604fcbad200a055af9 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 23 六月 2023 00:11:38 +0800
Subject: [PATCH] 2023-06-23

---
 src/tabviews/custom/index.jsx |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx
index 3c6b9b3..aa1aab3 100644
--- a/src/tabviews/custom/index.jsx
+++ b/src/tabviews/custom/index.jsx
@@ -52,7 +52,6 @@
     param: PropTypes.any,        // 鍏朵粬椤甸潰浼犻�掔殑鍙傛暟
     Tab: PropTypes.string,       // 寮圭獥鏍囩
     MenuID: PropTypes.string,    // 鑿滃崟Id
-    MenuNo: PropTypes.string,    // 鑿滃崟鍙傛暟
     MenuName: PropTypes.string,  // 鑿滃崟鍚嶇О
     changeTemp: PropTypes.func
   }
@@ -80,7 +79,7 @@
    * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅
    */
   async loadconfig () {
-    const { MenuID } = this.props
+    const { MenuID, MenuName } = this.props
 
     let _param = {
       func: 'sPC_Get_LongParam',
@@ -97,6 +96,7 @@
         config = config.replace(/@mywebsite@\//ig, window.GLOB.baseurl)
         config = JSON.parse(config)
         config.MenuID = MenuID
+        config.MenuName = MenuName || config.MenuName
       } catch (e) {
         console.warn('Parse Failure')
         config = ''
@@ -207,7 +207,7 @@
       let initInters = []
 
       config.interfaces = this.formatInterSetting(config.interfaces, regs, MenuID, initInters)
-      config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, popview, config.$cache)
+      config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, balMap, skip, param, MenuID, config.interfaces, popview, config.$cache, config.MenuName)
       
       // 鑾峰彇涓绘悳绱㈡潯浠�
       let mainSearch = []
@@ -336,7 +336,7 @@
     }
   }
 
-  filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache) => {
+  filterComponent = (components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, MenuName) => {
     return components.filter(item => {
       item.$pageId = pageId
       item.$cache = cache
@@ -348,7 +348,7 @@
         delete item.style.shadowColor
       }
 
-      item.$menuname = (this.props.MenuName || '') + '-' + (item.name || '')
+      item.$menuname = (MenuName || '') + '-' + (item.name || '')
 
       if (item.type === 'tabs') {
         if (
@@ -423,7 +423,7 @@
         item.subtabs = item.subtabs.map(tab => {
           tab.$pageId = pageId
 
-          tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache)
+          tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, MenuName)
           return tab
         })
 
@@ -436,7 +436,7 @@
           return false
         }
 
-        item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache)
+        item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, MenuName)
 
         return true
       } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) {

--
Gitblit v1.8.0