瀏覽代碼

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

zhuth 6 年之前
父節點
當前提交
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) => {