| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <%@ page contentType="text/html;charset=GBK"%>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <HEAD>
- <TITLE>角色授权</TITLE>
- <script type=text/javascript src="/shares/js/jquery-1.6.4.min.js"></script>
- <link href="main.css" rel="stylesheet" type="text/css"></link>
- <script type="text/javascript" src="js/lr-page.js"></script>
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <script type="text/javascript" src="/shares/js/yw/eu/roleAuthor.js"></script>
- <link href="./liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css"></link>
- <script src="./liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
- <script src="./liger/lib/ligerUI/js/plugins/ligerTab.js" type="text/javascript"></script>
- <script src="./liger/lib/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
- <script src="./liger/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
- <script src="./liger/lib/ligerUI/js/plugins/ligerTree.js" type="text/javascript"></script>
-
- <script type="text/javascript">
- var dialog;
- $(function (){
- $("#layout1").ligerLayout({ leftWidth: 250,height:'99%'});
- var height = $(".l-layout-center").height();
- $("#navtab1").ligerTab({height:height-25});
- tabitem = $("#navtab1").ligerGetTabManager();
- replaceItem();
- checkAll();
- $("#leftTree").height(height-50);
- managerTree = roleAutorTree("loadUnitRole.do","unitTree",clickRoleEvent,onSuccess);
- });
-
- function replaceItem(){
- tabitem.addTabItem({tabid:'temp_1',text: "",content:"",isMove:false});
- tabitem.selectTabItem("tabitem1");
- tabitem.removeTabItem('temp_1');
- }
-
- function loadTree(){
- $("#unitTree").empty();
- if($(".l-dialog-close").length>0)$(".l-dialog-close").click();
- managerTree = roleAutorTree("loadUnitRole.do","unitTree",clickRoleEvent,onSuccess);
- }
-
- function onSuccess(){
- managerTree.expandAll();
- var roleId = $("input[name='role']").val();
- if(roleId!=''&&roleId!=undefined){
- $("input[name='author']").each(function(){
- $(this).attr("checked",false);
- });
- var param = {'id':roleId};
- managerTree.selectNode(roleId);
- sendAsyncAjax(param,'findRoleAuthor.do','json',process);
- }
- }
-
- function checkAll(){
- var checkIds = $("[name='checkedIds']").val();
- var checkIdCol = checkIds.split(",");
- $("[name='role']").each(function(){
- var roleId = $(this).val();
- if(isExist(roleId,checkIdCol)){
- $(this).parent().click();
- }
- });
- }
- function addRole(){
- var selectUnit = $("input[name='unit']").val();
- if(selectUnit==undefined||selectUnit=="")addError("请选择角色所属单位!");
- else dialog = $.ligerDialog.open({ height: 350,width:480,url: 'BuildRole.do?unit='+selectUnit});
- }
-
- function editRole(){
- var selectRole = $("input[name='role']").val();
- if(selectRole==undefined||selectRole=="")addError("请选择需要修改的角色!");
- else dialog = $.ligerDialog.open({ height: 350,width:480,url: 'EditRole.do?id='+selectRole});
- }
-
- function delRole(){
- var selectRole = $("input[name='role']").val();
- if(selectRole==undefined||selectRole==""){
- addError("请选择需要删除的角色!");
- return;
- }
- selectRole = -parseInt(selectRole,10);
- if (window.confirm("确定删除当前选中的角色?")){
- var url = "delRole.do?id="+selectRole;
- $("form[name='roleAuthorForm']").attr("action", url);
- $("form[name='roleAuthorForm']").submit();
- }
- }
- </script>
- <style type="text/css">
- body{ padding:5px; margin:0;}
- #layout1{width:100%;margin:0; padding:0; }
- .author-list{
- width:100px;
- float:left;
- height:25px;
- padding-top:3px;
- overflow-x:hidden;
- white-space:nowrap;text-overflow:ellipsis;
- }
- .roleTree{
- height:20px;
- padding-top:3px;
- }
- .l-button{margin-left:1px;}
- #deptBtn{
- width: 100%;
- background: #e5ecf9;
- text-align:center;
- height:25px;
- padding-top:3px
- }
- </style>
- </HEAD>
- <BODY>
- <%@ include file="/include/button.jsp"%>
- <%@ include file="/include/message.jsp"%>
- <form name="roleAuthorForm" action="addRoleAuthor.do" method="post">
- <div id="layout1">
- <div position="left" title="角色列表" id="accordion1">
- <div id="deptBtn">
- <input type="button" value="新增" class="l-button" onclick="addRole()">
- <input type="button" value="修改" class="l-button" onclick="editRole()">
- <input type="button" value="删除" id="delRoleEvent" class="l-button" onclick="delRole()" />
- </div>
-
- <input type="hidden" name="checkedIds" value="${checkedIds}" />
- <input type="hidden" name="role" value="${role}"/>
- <input type="hidden" name="unit" value=""/>
- <%-- <c:forEach items="${roleList}" var="role">
- <DIV class="dTreeNode roleTree">
-
- <input type="radio" value="${role.roleId}" name="role"/>
- <span title="${role.roleName}">${role.roleName}</span>
- </DIV>
- </c:forEach> --%>
- <div id="leftTree" style="overflow:auto;position:relative;">
- <ul id="unitTree" class="tree" style="margin-top: 3px;">
- </div>
- </div>
- <div position="center" title="权限">
- <div id="navtab1" style="width: 99%;margin:0 auto;overflow:hidden;height:99%; border:1px solid #A3C0E8; ">
- <c:forEach items="${authorMap}" var="system" varStatus="i">
- <div title="${system.key}" ${i.index==0?"lselected='true'":""}>
- <div id="maingrid2" style="margin:5px;overflow:hidden">
- <c:forEach items="${system.value}" var="author">
- <div style="margin-top:3px">
- <div class="me">
- <span style="font-weight:bold"><input type="checkbox" name="checkAll" value=""/> ${author.text}</span>
- </div>
- <div class="node" style="padding-left:3px;float:left;text-align:left;border:1px solid #eee;width:98%">
- <c:forEach items="${author.children}" var="action">
- <div class="author-list">
- <input type="checkbox" value="${action.url} ${action.text}" name="author" id="${action.url}"/>
- <span title="${action.text}">${action.text}</span>
- </div>
- </c:forEach>
- </div>
- </div>
- </c:forEach>
- </div>
- </div>
- </c:forEach>
- </div>
- </div>
- </div>
- </form>
- </div>
- </BODY>
- </HTML>
|