| | |
| | | }, function() {}); |
| | | } |
| | | }); |
| | | var xml = ''; |
| | | function getchiled(data, mainId) { |
| | | if (data) { |
| | | var list = data.filter(item => item.ParentId == mainId); |
| | | if (list) { |
| | | for (var i = 0; i < list.length; i++) { |
| | | var id = list[i].Id; |
| | | //查询有无子菜单 |
| | | var count = data.filter(item => item.ParentId == id).length; |
| | | if (count > 0) { |
| | | xml = xml + '<dd>' + '<a href="javascript:;">' + list[i].Name + '</a>' + '<dl class="layui-nav-child">'; |
| | | getchiled(data, id); |
| | | xml = xml + '</dl></dd>'; |
| | | } |
| | | else { |
| | | xml = xml + '<dd>' + '<a lay-href="' + list[i].Url + '">' + list[i].Name + '</a>' + '</dd>'; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | sendData(IP + "/basis/GetRoleRightList", {}, 'get', function (res) { |
| | | $(function () { |
| | | $("#approvalBtn").hide(); |
| | | }); |
| | | $(function () { |
| | | $(".approvalBtndel").hide(); |
| | | }); |
| | | $(function () { |
| | | $(".approvalBtnupt").hide(); |
| | | }); |
| | | if (res.code == 0) //成功 |
| | | { |
| | | var list = res.data.filter(item => item.Layer == 0); |
| | | if (list) { |
| | | for (var i = 0; i < list.length; i++) { |
| | | xml = xml + '<li class="layui-nav-item">' + '<a href="javascript:;" lay-tips=' + list[i].Icon + ' lay-direction="2">' + '<span class="iconfont ' + list[i].Icon + '"></span>' + '<cite>' + list[i].MenuName + '</cite>' + '</a>'; |
| | | var id = list[i].Id; |
| | | //查询有无子菜单 |
| | | var count = res.data.filter(item => item.ParentId == id).length; |
| | | if (count > 0) { |
| | | xml = xml + '<dl class="layui-nav-child">'; |
| | | getchiled(res.data, id); |
| | | xml = xml + '</dl>'; |
| | | } |
| | | xml = xml + '</li>' |
| | | } |
| | | } |
| | | for (var k = 0; k < res.data.length; k++) { |
| | | if (res.data[k].MenuName == "添加用户") { |
| | | $(function () { |
| | | $("#approvalBtn").show(); |
| | | }); |
| | | } |
| | | if (res.data[k].MenuName == "删除用户") { |
| | | $(function () { |
| | | $(".approvalBtndel").show(); |
| | | }); |
| | | } |
| | | if (res.data[k].MenuName == "编辑用户") { |
| | | $(function () { |
| | | $(".approvalBtnupt").show(); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | else //不成功 |
| | | { |
| | | layer.msg('获取信息失败', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | //回调 |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | var xml = ''; |
| | | function getchiled(data, mainId) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | sendData(IP + "/basis/GetRoleRightList", {}, 'get', function(res) { |
| | | $(function() { |
| | | $("#approvalBtn").hide(); |
| | |
| | | }); |
| | | } |
| | | }) |
| | | |
| | | var infoOptions = { |
| | | elem: '#LAY-app-content-list', |
| | | height: h1, |