123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 |
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="renderer" content="webkit|ie-comp|ie-stand">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
- <meta http-equiv="Cache-Control" content="no-siteapp" />
- <!--[if lt IE 9]>
- <script type="text/javascript" src="${ctx}/assets/lib/html5.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/respond.min.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/PIE_IE678.js"></script>
- <![endif]-->
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui/css/H-ui.min.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/css/H-ui.admin.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/Hui-iconfont/1.0.7/iconfont.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/icheck/icheck.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/skin/default/skin.css" id="skin" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/static/h-ui.admin/css/style.css" />
- <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" >
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/easyui/themes/gray/easyui.css" />
- <link rel="stylesheet" type="text/css" href="${ctx}/assets/lib/easyui/themes/icon.css" />
- <script type="text/ecmascript" src="${ctx}/assets/lib/jquery/1.9.1/jquery.js"></script>
- <script type="text/javascript" src="${ctx}/assets/static/h-ui/js/H-ui.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/layer/3.0.3/layer.js"></script>
- <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqueryui/jquery-ui.css" />
- <link rel="stylesheet" type="text/css" media="screen" href="${ctx}/assets/lib/jqgrid/css/ui.jqgrid.css" />
- <script type="text/ecmascript" src="${ctx}/assets/lib/jqueryui/jquery-ui.js"></script>
- <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/i18n/grid.locale-cn.js"></script>
- <script type="text/ecmascript" src="${ctx}/assets/lib/jqgrid/js/jquery.jqGrid.min.js"></script>
- <script type="text/ecmascript" src="${ctx}/assets/lib/easyui/jquery.easyui.min.js"></script>
- <script type="text/ecmascript" src="${ctx}/assets/lib/easyui/locale/easyui-lang-zh_CN.js"></script>
- <script type="text/javascript" src="${ctx}/assets/js/base.js"></script>
- <script type="text/javascript" src="${ctx}/assets/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
- <!--[if IE 6]>
- <script type="text/javascript" src="${ctx}/assets/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
- <script>DD_belatedPNG.fix('*');</script>
- <![endif]-->
- <title>角色管理</title>
- </head>
- <body>
- <div id="table" class="easyui-tabs" style="width: 100%; height: 400px;">
- <div title="菜单权限" style="padding:5px;display:none;">
- <ul id="tree_menu" class="ztree"></ul>
- </div>
-
- <div title="站点权限" style="padding:5px;display:none;">
- <ul id="tree_site" class="ztree"></ul>
- </div>
-
- <div title="栏目权限" style="padding:5px;display:none;">
- 选择站点:<select id="permSite"><option>请选择站点</option></select>
- <ul id="tree_column" class="ztree"></ul>
- </div>
-
- <div title="机构权限" style="padding:5px;display:none;">
- <ul id="tree_org" class="ztree"></ul>
- </div>
-
- </div>
- </body>
- </html>
- <script type="text/javascript">
- //菜单权限
- $(function(){
- function zTreeMenu(event, treeId, treeNode) {
- $.post("${ctx}/myconsole/perm/saveMenuPerm",{"roleid":"${RoleID}","permid":treeNode.id,"checked":treeNode.checked},function(data){
- //alert(data);
- layer.msg(data);
- })
- };
-
- var zNodes = [],menuPerm = [];
- var menuTree = JSON.parse('${Menu}');
-
- var perms=eval(menuTree.Perm);
- perms.forEach(function(item,index){
- menuPerm.push(item.permid);
- });
-
- var menus=eval(menuTree.Menu);
- //console.log(menus);
- menus.forEach(function(item,index)
- {
- zNodes.push({id:item.keyid,pId:item.parentid,name:item.menuname,open:true,checked:menuPerm.includes(item.keyid)});
- })
-
- var setting_menu = {
- check: {
- enable: true,
- chkboxType: { "Y" : "p", "N" : "s" },//勾选时关联父,取消勾选时关联子
- autoCheckTrigger: true
- },
- data: {
- simpleData: {
- idKey:"id",
- pIdKey:"pId",
- enable:true,
- rootPId:"0"
- }
- },
- callback: {
- onCheck: zTreeMenu
- }
- };
-
- $.fn.zTree.init($("#tree_menu"), setting_menu, zNodes);
- })
- </script>
-
-
- <script type="text/javascript">
-
- //站点权限
- $(function(){
- function zTreeSite(event, treeId, treeNode) {
- $.post("${ctx}/myconsole/perm/saveSitePerm",{"roleid":"${RoleID}","permid":treeNode.id,"checked":treeNode.checked},function(data){
- //alert(data);
- layer.msg(data);
- })
- };
-
- var zNodesite = [],sitePerm = [];
- var siteTree = JSON.parse('${Site}');
-
- var perms=eval(siteTree.Perm);
- perms.forEach(function(item,index){
- sitePerm.push(item.permid);
- });
-
- var sites=eval(siteTree.Site);
- //myconsole.log(sites);
- sites.forEach(function(item,index)
- {
- zNodesite.push({id:item.siteid,pId:item.parentid,name:item.sitename,open:true,checked:sitePerm.includes(item.siteid)});
- })
-
- var setting_site = {
- check: {
- enable: true,
- chkboxType: { "Y" : "", "N" : "" },
- autoCheckTrigger: true
- },
- data: {
- simpleData: {
- idKey:"id",
- pIdKey:"pId",
- enable:true,
- rootPId:"0"
- }
- },
- callback: {
- onCheck: zTreeSite
- }
- };
-
- $.fn.zTree.init($("#tree_site"), setting_site, zNodesite);
- })
- </script>
-
-
- <script type="text/javascript">
-
- //栏目权限
- $(function(){
- $('#table').tabs({
- onSelect: function(title){
- if(title=="栏目权限"){
- $.post("${ctx}/myconsole/perm/getPermSite",{"roleid":"${RoleID}"},function(data){
- //console.log(data);
- var siteData = JSON.parse(data);
- var sites=siteData.Site;
- sites.forEach(function(item,index){
- $("#permSite").append("<option value='"+item.siteid+"'>"+item.sitename+"</option>");
- })
- })
- }
- }
- });
- function zTreecolumn(event, treeId, treeNode) {
- $.post("${ctx}/myconsole/perm/saveColumnPerm",{"roleid":"${RoleID}","permid":treeNode.id,"siteid":treeNode.siteid,"checked":treeNode.checked},function(data){
- //alert(data);
- layer.msg(data);
- })
- };
- $("#permSite").change(function(){
- $.post("${ctx}/myconsole/perm/getPermColumn",{"roleid":"${RoleID}","siteID":$(this).val()},function(data){
- //console.log(data);
- var zNodecolumn = [],columnPerm = [];
- var columnTree = JSON.parse(data);
-
- var perms=eval(columnTree.Perm);
- perms.forEach(function(item,index){
- columnPerm.push(item.siteid+":"+item.permid);
- });
- //console.log(columnPerm);
-
- var columns=eval(columnTree.Column);
- //myconsole.log(sites);
- columns.forEach(function(item,index){
- if(item.parentid==0){
- zNodecolumn.push({id:item.columnid,pId:item.siteid,name:item.columnname,open:true,checked:columnPerm.includes(item.siteid+":"+item.columnid),chkDisabled:false,siteid:item.siteid});
- }else{
- zNodecolumn.push({id:item.columnid,pId:item.parentid,name:item.columnname,open:true,checked:columnPerm.includes(item.siteid+":"+item.columnid),chkDisabled:false,siteid:item.siteid});
- }
- })
-
- var setting_column = {
- check: {
- enable: true,
- chkboxType: { "Y" : "ps", "N" : "ps" },
- autoCheckTrigger: true
- },
- data: {
- simpleData: {
- idKey:"id",
- pIdKey:"pId",
- enable:true,
- rootPId:"0"
- }
- },
- callback: {
- onCheck: zTreecolumn
- }
- };
-
- $.fn.zTree.init($("#tree_column"), setting_column, zNodecolumn);
- })
- })
-
-
- })
- </script>
-
- <script type="text/javascript">
- //机构权限
- $(function(){
- function zTreeOrg(event, treeId, treeNode) {
- $.post("${ctx}/myconsole/perm/saveOrgPerm",{"roleid":"${RoleID}","permid":treeNode.id,"checked":treeNode.checked},function(data){
- //alert(data);
- layer.msg(data);
- })
- };
-
- var zNodesorg = [],orgPerm = [];
- var orgTree = JSON.parse('${Org}');
-
-
- var perms=eval(orgTree.Perm);
- perms.forEach(function(item,index){
- orgPerm.push(item.permid);
- });
-
- var orgs=eval(orgTree.Org);
- //myconsole.log(orgs);
- orgs.forEach(function(item,index)
- {
- zNodesorg.push({id:item.orgid,pId:item.parentid,name:item.orgname,open:true,checked:orgPerm.includes(item.orgid)});
- })
-
-
-
- var setting_org = {
- check: {
- chkboxType: { "Y" : "", "N" : "" },
- enable: true,
- autoCheckTrigger: true
- },
- data: {
- simpleData: {
- idKey:"id",
- pIdKey:"pId",
- enable:true,
- rootPId:"0"
- }
- },
- callback: {
- onCheck: zTreeOrg
- }
- };
-
- $.fn.zTree.init($("#tree_org"), setting_org, zNodesorg);
- })
- </script>
|