<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ include file="../language.jsp" %>

<script src="../scripts/itsm/security/role.js?random=<%=new java.util.Date().getTime()%>"></script>

<div style="padding:10px;color:#555555" id="roleMain_loading"><img src="../images/icons/loading.gif" /></div>


<div style="padding:3px;display:none" id="roleMain_content">


<!-- 数据列表 -->
<div>
    <div style="overflow:hidden;padding:0px;" >
    <table id="roleGrid"></table>
    <div id="rolePager"></div>
    <div id="roleTopMenu" style="background-color:#EEEEEE; height:28px;display: none;">
    
    <sec:authorize url="/pages/role!save.action">
	<a class="easyui-linkbutton"  plain="true" icon="icon-add" id="link_role_add" onclick="itsm.security.role.addWin()" ><fmt:message key="common.add" /></a> 
	</sec:authorize>
	
	<sec:authorize url="/pages/role!edit.action">
	<a class="easyui-linkbutton"  plain="true" icon="icon-edit"  id="link_role_edit" onclick="" ><fmt:message key="common.edit" /></a> 
	</sec:authorize>
	
	<sec:authorize url="/pages/role!delete.action">
	<a class="easyui-linkbutton"  plain="true" icon="icon-cancel"  id="link_role_delete"><fmt:message key="common.delete" /></a> 
	</sec:authorize>
	
	<sec:authorize url="/pages/role!find.action">
	<a class="easyui-linkbutton"  plain="true" icon="icon-search"  id="link_role_search"><fmt:message key="common.search" /></a> 
	</sec:authorize>
	
	<sec:authorize url="/pages/role!setResourceByRoleIds.action">
	<a class="easyui-linkbutton"  plain="true" icon="icon-assign"  id="link_role_assign"><fmt:message key="label.role.permissionAssign" /></a> 
	</sec:authorize>

	
	&nbsp;&nbsp; | <fmt:message key="label.dc.export"/>/<fmt:message key="label.dc.import"/>：
	
	<select onchange="itsm.security.role.importExportRoleData(this.value)" id="exportRoleDataDc">
	<option value="chooseExportType">--<fmt:message key="label.dc.chooseExportStyle"/>--</option>
	<option value="view"><fmt:message key="label.dc.exportCurrentView"/></option>
	<option value="chooseImportType">----------------------</option>
	<option value="chooseImportType">--<fmt:message key="label.dc.chooseImportStyle"/>--</option>
	<option value="excel"><fmt:message key="label.dc.importFromExcel"/></option>
	</select>

    </div> 
</div>
 <div id="roleGridAct" style="background-color:#EEEEEE; height:28px;display: none;"><sec:authorize url="/pages/role!setResourceByRoleIds.action"><a href="javascript:itsm.security.role.open_func({id},true)"  title="<fmt:message key="label.role.permissionAssign" />"><img src="../images/icons/user_female.gif" border="0"/></a></sec:authorize>&nbsp;&nbsp;<sec:authorize url="/pages/role!edit.action"><a href="javascript:itsm.security.role.editRole({id})" title="<fmt:message key="common.edit" />"><img src="../images/icons/edit.gif" border="0"/></a></sec:authorize>&nbsp;&nbsp;<sec:authorize url="/pages/role!delete.action"><a href="javascript:itsm.security.role.delRole({id})" title="<fmt:message key="common.delete" />"><img src="../images/icons/delete.gif" border="0"/></a></sec:authorize></div>


<!-- 添加角色-->
<div id="addRole" class="easyui-window" closed="true" collapsible="false" minimizable="false" maximizable="false" modal="true" title="<fmt:message key="common.add" />/<fmt:message key="common.edit" />" style="width:420px;height:auto">

		<div class="lineTableBgDiv">
		<form id="addOrEditRoleForm">
		<table style="width:100%" class="lineTable" cellspacing="1">
			<tr>
				<td><fmt:message key="label.role.roleName" /></td>
				<td><input name="roleDto.roleName" id="roleName" class="easyui-validatebox input" required="true"  /></td>
			</tr>
			<tr>
				<td><fmt:message key="label.role.roleCode" /></td>
				<td><input name="roleDto.roleCode" id="roleCode" class="easyui-validatebox input" required="true"/></td>
			</tr>
			<tr>
				<td><fmt:message key="label.role.roleState" /></td>
				<td>
					<input type="radio" name="roleDto.roleState" id="roleState" value="true" checked="checked" /><fmt:message key="common.enable" />
					<input type="radio" name="roleDto.roleState" id="roleState1" value="false" /><fmt:message key="common.disable" />
				</td>
			</tr>
			<tr>
				<td><fmt:message key="label.role.roleDescription" /></td>
				<td>
					<textarea class="input" style="height:45px" name="roleDto.description" id="description"></textarea>
				</td>
			</tr>
			<tr>
				<td><fmt:message key="label.role.roleMark" /></td>
				<td>
					<textarea class="input" style="height:45px" name="roleDto.remark" id="remark"></textarea>
				</td>
			</tr>
			<tr>
			<td colspan="2">
				<input id="back_roleName"  type="hidden"/>
				<input id="back_roleCode"  type="hidden"/>
				<input type="hidden" name="roleDto.roleId" value="0" id="roleId" />
				<a class="easyui-linkbutton"  icon="icon-save" id="link_role_add_role" onclick="itsm.security.role.addRole()" ><fmt:message key="common.save" /></a>
			</td>
			</tr>
		</table>
	</form>
</div>	


</div>

<!-- 搜索用户 -->
<div id="searchRole" class="easyui-window" icon="icon-search"  closed="true" collapsible="false" minimizable="false" maximizable="false" modal="false" title="<fmt:message key="title.role.searchRole" />" 
style="width:400px;height:250px; padding:10px; line-height:20px;">
	<form>
		<table width="100%">
			<tr>
				<td><fmt:message key="label.role.roleName" /></td>
				<td><input name="roleQueryDto.roleName" /></td>
			</tr>
			<tr>
				<td><fmt:message key="label.role.roleCode" /></td>
				<td><input name="roleQueryDto.roleCode" /></td>
			</tr>
			<tr>
				<td><fmt:message key="label.role.roleDescription" /></td>
				<td><input name="roleQueryDto.description" /></td>
			</tr>
			<tr>
				<td><fmt:message key="label.role.roleMark" /></td>
				<td><input name="roleQueryDto.remark" /></td>
			</tr>
			<tr>
				<td colspan="2">
					<a class="easyui-linkbutton"  icon="icon-search" id="link_role_mysearch" onclick="itsm.security.role.search()" ><fmt:message key="common.search" /></a>
				</td>
			</tr>
		</table>
	</form>
</div>	


<!-- 分配角色 -->
<div id="assignFunc" title="<fmt:message key="label.role.permissionAssign" />" class="easyui-window" closed="true" collapsible="false" minimizable="false" maximizable="false" modal="true"  style="width:620px;height:450px;padding:3px">
    
    <div class="easyui-layout" style="width:100%; height:360px">
    
		<div region="west" split="true" title="<fmt:message key="title.role.functionList" />" style="width:280px;">
			<div id="functionTree"></div>
		</div>
		
		<div region="center" title="<fmt:message key="title.role.operationList" />">
			<div id="operationOptions"></div>
		</div>
	</div>	
    
    <div style="padding-top:10px; padding-bottom:10px">
         <a class="easyui-linkbutton" icon="icon-ok" id="link_func_ok" onclick="itsm.security.role.save_func()"><fmt:message key="common.save" /></a>
	</div> 
</div>


<!-- 导入数据 -->
<div id="importRoleDataWindow"  class="easyui-window" closed="true" collapsible="false" minimizable="false" maximizable="false" modal="true" title="<fmt:message key="label.dc.import"/>" style="width:400px;height:auto">
	<form>
   <div class="lineTableBgDiv" >
    <table  class="lineTable"  width="100%" cellspacing="1"> 
        <tr>
            <td width="100px">
            <fmt:message key="label.dc.filePath"/>
        
            </td>
            <td>
           	<input type="file" class="easyui-validatebox input" required="true" name="roleQueryDto.importFile" id="importRoleFile" onchange="checkFileType(this,'xls')"/>
            </td>
        </tr>

        <tr>
            <td colspan="2">
                <div style="padding-top:8px;">
                	<a id="searchRoleBtn" class="easyui-linkbutton" onclick="itsm.security.role.importRoleExcel()" icon="icon-ok"><fmt:message key="label.dc.import"/></a>
                </div>
        </td>
        </tr>
    </table>
    </div>
    </form>
</div>


    <div style="display: none;" id="exportRoleWindow">
	   <form action="role!exportRole.action" method="post">
	     <table>
	     <tr>
			<td>		
				<input id="exportRole_roleName" name="roleQueryDto.roleName" class="input">
				<input id="exportRole_roleCode" name="roleQueryDto.roleCode" class="input">
				<input id="exportRole_description" name="roleQueryDto.description" class="input">
				<input id="exportRole_remark" name="roleQueryDto.remark" class="input">
				
				<input id="exportRole_sidx" name="sidx" class="input">
				<input id="exportRole_sord" name="sord" class="input">
				<input id="exportRole_page" name="page" class="input">
				<input id="exportRole_rows" name="rows" class="input">
			</td>
		</tr>
	     </table>
	   </form>
    </div>

</div>
</div>