|
@@ -1,3 +1,4 @@
|
|
|
+var userRole = 0;
|
|
|
$(function () {
|
|
|
//隐藏角色上的提示红点
|
|
|
$('#role-name-num').hide();
|
|
@@ -25,26 +26,51 @@ $(function () {
|
|
|
}]
|
|
|
});
|
|
|
$('.easyui-menubutton').menubutton();
|
|
|
- $('#menutree').tree({
|
|
|
- url: '/app/whepi/mock/menu.json', //api('/menu_tree'),
|
|
|
- onDblClick: function (node) {
|
|
|
- var $this = $(this);
|
|
|
- if (!$this.tree('isLeaf', node.target)) {
|
|
|
- $this.tree(node.state === 'closed' ? 'expand' : 'collapse', node.target);
|
|
|
+ // 根据userRole读取不同的菜单
|
|
|
+ if (userRole == "1") {
|
|
|
+ $('#menutree').tree({
|
|
|
+ url: '/app/whepi/mock/menu.json', //api('/menu_tree'),
|
|
|
+ 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) {
|
|
|
}
|
|
|
- },
|
|
|
- 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});
|
|
|
+ });
|
|
|
+ } else if (userRole == "2") {
|
|
|
+ $('#menutree').tree({
|
|
|
+ url: '/app/whepi/mock/menu2.json', //api('/menu_tree'),
|
|
|
+ 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) {
|
|
|
}
|
|
|
- },
|
|
|
- onLoadSuccess: function (node, data) {
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
$('#mm').menu({
|
|
|
onClick: function (item) {
|
|
@@ -90,6 +116,8 @@ var App = {
|
|
|
method: 'get',
|
|
|
loadingMask: false,
|
|
|
success: function (data) {
|
|
|
+ userRole = data.data.user.userType;
|
|
|
+ console.log(data.data.user.userType);
|
|
|
if (!$.trim(data.data.userId)) {
|
|
|
top.window.location.href = jumpApi(YJYDLOGINURL);
|
|
|
return;
|