<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../common/common.jsp" %>
<title>运营管理系统</title>
<script type="text/javascript" src="${staticPath}js/system/permission.js"></script>
</head>
<body>
<div class="open-content open-pad">
	<form id="modfiyPermissionForm">
	<input type="hidden" name="permissionId" id="permissionId" value="${permission.permissionId }" />
	<ul class="ulFrm">
		<li>
			<span class="label labelW80 labelRight">权限类型：</span>
			<div class="select selectW120 {onchange:change, width:'120'}">
				<select name="type" id="type">
					<option value="menu" <c:if test="${permission.type=='menu' }">selected="selected"</c:if> >父权限</option>
					<option value="submenu" <c:if test="${permission.type=='submenu' }">selected="selected"</c:if>>子权限</option>
					<option value="func" <c:if test="${permission.type=='func' }">selected="selected"</c:if>>功能权限</option>
				</select>
			</div>
		</li>
		<li id="parentId">
			<span class="label labelW80 labelRight">父权限：</span>
			<div class="select selectW120 {width:'120'}">
				<select name="pid" id="pid">
					<option value="">请选择</option>
					<c:forEach var="item" items="${permissionList}">
						<option value="${item.permissionId}" <c:if test="${permission.pid==item.permissionId}">selected="selected"</c:if>>${item.name}</option>
					</c:forEach>
				</select>
			</div>
		</li>
		<li>
			<span class="label labelW80 labelRight">权限名称：</span>
			<input type="text" class="text" name="name" id="name" size="20" value="${permission.name }" />
			<span class="label labelW80 labelRight">权限编码：</span>
			<input type="text" class="text" name="code" id="code" size="20" value="${permission.code }" />
		</li>
		
		<li>
			<span class="label labelW80 labelRight">权限链接：</span>
			<input type="text" class="text" name="url" id="url" size="20" value="${permission.url }" />
			<span class="label labelW80 labelRight">权限优先级：</span>
			<input type="text" class="text" name="rank" id="rank" size="20" value="${permission.rank }" />
		</li>
		<li>
			<span class="label labelW80 labelRight">权限图标：</span>
			<input type="text" class="text" name="logo" id="logo" size="20" value="${permission.logo }" />
		</li>
	</ul>
	</form>
	<div class="open-fixed-buttons">
		<a onclick="javascript:checkPermissionModfiy();" class="btn-radius">提交</a>
		<a href="javascript:top.$.closeWindow();" class="btn-radius cancel">取消</a>
	</div>
</div>
<script type="text/javascript">
$(function(){
	var type=$('#type').val();
	if(type!=null && (type=='menu' || type=='func')){
		$('#parentId').css("display","none");
	}
	$.resetText();
	$(".select").uiSelect();
});
function change(o){
	var type=$('#type').val();
	if(type=='submenu' || type=='func' ){
		$('#parentId').removeAttr("style");
	}else{
		$('#pid').val('');
		$('#parentId').css("display","none");
	}
}
</script>
</body>
</html>