Просмотр исходного кода

【BUG】报表设置分组显示了非menu节点

zhuth 6 лет назад
Родитель
Сommit
572b7582dd
1 измененных файлов с 10 добавлено и 6 удалено
  1. 10 6
      src/components/dashboardDesigner/configSider.jsx

+ 10 - 6
src/components/dashboardDesigner/configSider.jsx

@@ -81,15 +81,19 @@ class ConfigSider extends React.Component {
     }
 
     generateMenuOptions = (menuTree) => {
-        return menuTree.map(t => {
+        let menuList = [];
+        menuTree.forEach(t => {
             t.children = t.children instanceof Array ? t.children : [];
-            return {
-                key: t.code,
-                value: t.code,
-                label: t.name,
-                children: this.generateMenuOptions(t.children)
+            if(t.type === 'menu') {
+                menuList.push({
+                    key: t.code,
+                    value: t.code,
+                    label: t.name,
+                    children: this.generateMenuOptions(t.children)
+                });
             }
         })
+        return menuList;
     }
 
     getParens = (menu) => {