From 21d92eff0e23974d76e3e5a79ba50e3fc1c0b879 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 15 四月 2022 01:08:15 +0800
Subject: [PATCH] 2022-04-15

---
 src/views/pcdesign/index.jsx |   38 +++++++++++++++++++++++++++++++++-----
 1 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx
index 2c4121e..9628aa8 100644
--- a/src/views/pcdesign/index.jsx
+++ b/src/views/pcdesign/index.jsx
@@ -854,11 +854,12 @@
 
   getMenuMessage = () => {
     const { config } = this.state
-    let nodes = {type: 'view', key: config.uuid, title: config.MenuName, children: []}
+    let nodes = {type: 'view', version: '1.0', key: config.uuid, title: config.MenuName, children: []}
     let popviews = []
 
     let traversal = (components) => {
-      let list = components.map(item => {
+      let list = []
+      components.forEach(item => {
         let m = {
           key: item.uuid,
           title: item.name,
@@ -868,6 +869,7 @@
           return null
         } else if (item.type === 'tabs') {
           let tabs = []
+          let mm = []
           item.subtabs.forEach(tab => {
             let s = traversal(tab.components)
 
@@ -878,13 +880,35 @@
               title: tab.label,
               children: s
             })
+
+            mm.push(...s)
           })
 
           if (tabs.length > 0) {
             m.children = tabs
           }
+
+          if (item.setting.permission === 'true') {
+            list.push(m)
+          } else if (mm.length) {
+            list.push(...mm)
+          }
+          
+          return null
         } else if (item.type === 'group') {
           m.children = traversal(item.components)
+
+          if (item.setting.permission === 'true') {
+            list.push(m)
+          } else if (m.children.length) {
+            list.push(...m.children)
+          }
+          
+          return null
+        } if (item.plot && item.plot.permission !== 'true') {
+          return null
+        } if (item.wrap && item.wrap.permission !== 'true') {
+          return null
         } else if (item.type === 'card' || (item.type === 'table' && item.subtype === 'tablecard')) {
           item.action && item.action.forEach(btn => {
             this.checkBtn(btn)
@@ -990,10 +1014,8 @@
           })
         }
 
-        return m
+        list.push(m)
       })
-
-      list = list.filter(Boolean)
 
       return list
     }
@@ -1005,6 +1027,11 @@
 
     if (config.components.findIndex(item => item.type === 'login') > -1) {
       nodes.login = true
+      nodes.children = []
+    }
+    if (config.permission !== 'true') {
+      nodes.pass = true
+      nodes.children = []
     }
 
     return nodes
@@ -1112,6 +1139,7 @@
 
               let roles = {
                 type: 'navbar',
+                version: '1.0',
                 key: item.uuid,
                 title: item.name,
                 children: []

--
Gitblit v1.8.0