<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="fn" uri="/WEB-INF/fn.tld"%>
<%@ include file="../common/common.jsp" %>
<title>运营管理系统</title>
<script type="text/javascript" src="${staticPath}js/system/role.js"></script>
</head>
<body>
<%@ include file="../common/head.jsp" %>
<div class="screen main">
	<%@ include file="../common/left.jsp" %>
		<div class="main-content relative">
			<div class="main-title">修改角色</div>
			<div class="open-content open-pad">
			<form id="modfiyRoleForm">
			<input type="hidden" name="roleId" id="roleId" value="${role.roleId}">
			<ul class="ulFrm">
				<li>
					<span class="label labelW80 labelRight">角色名称：</span>
					<input type="text" class="text" name="name" id="name" size="40" value="${role.name }" />
				</li>
				<li>
					<span class="label labelW80 labelRight">角色编码：</span>
					<input type="text" class="text" name="code" id="code" size="40" value="${role.code }" />
				</li>
				<li>
					<span class="label labelW80 labelRight alignTop">角色描述：</span>
					<textarea rows="5"  class="textarea" name="info" id="info" cols="42" >${role.info}</textarea>
				</li>
				<li>
					<span class="label labelW80 labelRight alignTop">菜单权限：</span>
					<ul class="auth ulFrm inline">
						<c:forEach var="first" items="${permissionList}">
							<li>
								<input type="checkbox" name="permissionId" value="${first.permissionId }" class="parent checkbox {click:subAll}" <c:if test="${fn:contains(rolePerms,','.concat(first.permissionId).concat(','))}">checked</c:if> /><label>${first.name}</label>
								<div class="sub_auth">
									<c:forEach var="second" items="${first.subPerms}">
										<input type="checkbox" name="permissionId" value="${second.permissionId }" class="checkbox {click:subchildren} " <c:if test="${fn:contains(rolePerms,','.concat(second.permissionId).concat(','))}">checked</c:if> ><label>${second.name}</label>
									</c:forEach>
								</div>
							</li>	
						</c:forEach>
					</ul>
				</li>
				<li>
					<span class="label labelW80 labelRight alignTop">功能权限：</span>
				    <ul class="auth inline">
					<c:forEach var="func" items="${funcList}">
				    	<li>
							<input type="checkbox" class="parent checkbox {click:subAll}" name="permissionId" value="" /><label>${func.name}</label>
							<div class="sub_auth">
								<c:forEach var="second" items="${func.subPerms}">
									<input type="checkbox" name="permissionId" value="${second.permissionId }" class="checkbox {click:subchildren} " <c:if test="${fn:contains(rolePerms,','.concat(second.permissionId).concat(','))}">checked</c:if> /> <label>${second.name}</label>
								</c:forEach>
							</div>
						</li>	
					</c:forEach>
					</ul>
				</li>
			</ul>
			</form>
			</div>
			<div class="btn-position">
				<div class="rFloat buttons">
					<div class="search-btn" onclick="checkRoleModfiy();">提交</div>
				</div>
			</div>
		</div>
	</div>
<%@ include file="../common/footer.jsp" %>
<script type="text/javascript">
$(function(){
	$.resetText();
	$.checkbox();
});
</script>
</body>
</html>