Browse Source

修改菜单树

peiguo 4 years ago
parent
commit
247917f2bb
2 changed files with 43 additions and 0 deletions
  1. 21 0
      admin-ui/app/whepi/index.js
  2. 22 0
      admin-ui/app/whepi/mock/menu3.json

+ 21 - 0
admin-ui/app/whepi/index.js

@@ -71,6 +71,27 @@ $(function () {
         onLoadSuccess: function (node, data) {
         }
       });
+    } else if (userRole == "3") {
+      $('#menutree').tree({
+        url: '/app/whepi/mock/menu3.json', // 人力资源账户
+        onDblClick: function (node) {
+          var $this = $(this);
+          if (!$this.tree('isLeaf', node.target)) {
+            $this.tree(node.state === 'closed' ? 'expand' : 'collapse', node.target);
+          }
+        },
+        onSelect: function () {
+          return false;
+        },
+        onClick: function (node) {
+          var href = node.href;
+          if ($.trim(href)) {
+            App.addTab({title: node.text, url: node.href, id: node.id, iconCls: node.iconCls});
+          }
+        },
+        onLoadSuccess: function (node, data) {
+        }
+      });
     } else if (userRole == "5") {//指挥部登录
       $('#menutree').tree({
         url: '/app/whepi/mock/menu5.json',

+ 22 - 0
admin-ui/app/whepi/mock/menu3.json

@@ -0,0 +1,22 @@
+{
+  "success": true,
+  "msg": "",
+  "data": [
+    {
+      "id": "ENT101007",
+      "text": "在职人员管理",
+      "href": "/app/whepi/lingyun/lingyunUserOnJob.js",
+      "iconCls": "icon-blank fa fa-align-justify",
+      "state": "close",
+      "children": []
+    },
+    {
+      "id": "ENT101008",
+      "text": "不在职人员管理",
+      "href": "/app/whepi/lingyun/lingyunUserNotOnJob.js",
+      "iconCls": "icon-blank fa fa-align-justify",
+      "state": "close",
+      "children": []
+    }
+  ]
+}