<?xml version="1.0" encoding="utf-8"?>
<template>
	<name>viewList</name>
	<filePath>WebContent/webpage/${lastPackageName}/${moduleName}/${subModuleName}</filePath>
	<fileName>${className}List.jsp</fileName>
	<content><![CDATA[
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>${functionNameSimple}管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
		<#list table.columnList as c>
		<#if c.isQuery?? && c.isQuery == "1">
		<#if c.showType == "dateselect" && c.queryType == "between">
	        laydate({
	            elem: '#begin${c.simpleJavaField?cap_first}', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
	            event: 'focus' //响应事件。如果没有传入event，则按照默认的click
	        });
	        laydate({
	            elem: '#end${c.simpleJavaField?cap_first}', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
	            event: 'focus' //响应事件。如果没有传入event，则按照默认的click
	        });
					
		
		<#elseif c.showType == "dateselect">
			laydate({
	            elem: '#${c.javaFieldId}', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
	            event: 'focus' //响应事件。如果没有传入event，则按照默认的click
	        });
		</#if>
		</#if>
		</#list>
		});
	</script>
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content">
	<div class="ibox">
	<div class="ibox-title">
		<h5>${functionNameSimple}列表 </h5>
		<div class="ibox-tools">
			<a class="collapse-link">
				<i class="fa fa-chevron-up"></i>
			</a>
			<a class="dropdown-toggle" data-toggle="dropdown" href="#">
				<i class="fa fa-wrench"></i>
			</a>
			<ul class="dropdown-menu dropdown-user">
				<li><a href="#">选项1</a>
				</li>
				<li><a href="#">选项2</a>
				</li>
			</ul>
			<a class="close-link">
				<i class="fa fa-times"></i>
			</a>
		</div>
	</div>
    
    <div class="ibox-content">
	<sys:message content="${r"${message}"}"/>
	
	<!--查询条件-->
	<div class="row">
	<div class="col-sm-12">
	<form:form id="searchForm" modelAttribute="${className}" action="${r"${ctx}"}/${urlPrefix}/" method="post" class="form-inline">
		<input id="pageNo" name="pageNo" type="hidden" value="${r"${page.pageNo}"}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${r"${page.pageSize}"}"/>
		<table:sortColumn id="orderBy" name="orderBy" value="${r"${page.orderBy}"}" callback="sortOrRefresh();"/><!-- 支持排序 -->
		<div class="form-group">
		<#list table.columnList as c>
			<#if c.isQuery?? && c.isQuery == "1">
			<span>${c.comments}：</span>
			<#if c.showType == "input" || c.showType == "textarea">
				<form:input path="${c.javaFieldId}" htmlEscape="false"<#if c.dataLength != "0"> maxlength="${c.dataLength}"</#if>  class=" form-control input-sm"/>
			<#elseif c.showType == "select">
				<form:select path="${c.javaFieldId}"  class="form-control m-b">
					<form:option value="" label=""/>
					<form:options items="${"$"}{fns:getDictList('${c.dictType}')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			<#elseif c.showType == "checkbox">
				<form:checkboxes class="i-checks" path="${c.javaFieldId}" items="${"$"}{fns:getDictList('${c.dictType}')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			<#elseif c.showType == "radiobox">
				<form:radiobuttons class="i-checks" path="${c.javaFieldId}" items="${"$"}{fns:getDictList('${c.dictType}')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			<#elseif c.showType == "dateselect" && c.queryType == "between">
				<input id="begin${c.simpleJavaField?cap_first}" name="begin${c.simpleJavaField?cap_first}" type="text" maxlength="20" class="laydate-icon form-control layer-date input-sm"
					value="<fmt:formatDate value="${"$"}{${className}.begin${c.simpleJavaField?cap_first}}" pattern="yyyy-MM-dd HH:mm:ss"/>"/> - 
				<input id="end${c.simpleJavaField?cap_first}" name="end${c.simpleJavaField?cap_first}" type="text" maxlength="20" class="laydate-icon form-control layer-date input-sm"
					value="<fmt:formatDate value="${"$"}{${className}.end${c.simpleJavaField?cap_first}}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
			<#elseif c.showType == "dateselect">
				<input id="${c.javaFieldId}" name="${c.javaFieldId}" type="text" maxlength="20" class="laydate-icon form-control layer-date input-sm"
					value="<fmt:formatDate value="${"$"}{${className}.${c.javaFieldId}}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
			<#elseif c.showType == "userselect">
				<sys:treeselect id="${c.simpleJavaField}" name="${c.javaFieldId}" value="${"$"}{${className}.${c.javaFieldId}}" labelName="${c.javaFieldName}" labelValue="${"$"}{${className}.${c.javaFieldName}}"
					title="用户" url="/sys/office/treeData?type=3" cssClass="form-control input-sm" allowClear="true" notAllowSelectParent="true"/>
			<#elseif c.showType == "officeselect">
				<sys:treeselect id="${c.simpleJavaField}" name="${c.javaFieldId}" value="${"$"}{${className}.${c.javaFieldId}}" labelName="${c.javaFieldName}" labelValue="${"$"}{${className}.${c.javaFieldName}}"
					title="部门" url="/sys/office/treeData?type=2" cssClass="form-control input-sm" allowClear="true" notAllowSelectParent="true"/>
			<#elseif c.showType == "areaselect">
				<sys:treeselect id="${c.simpleJavaField}" name="${c.javaFieldId}" value="${"$"}{${className}.${c.javaFieldId}}" labelName="${c.javaFieldName}" labelValue="${"$"}{${className}.${c.javaFieldName}}"
					title="区域" url="/sys/area/treeData" cssClass="form-control input-sm" allowClear="true" notAllowSelectParent="true"/>
			<#elseif c.showType == "gridselect">
				<sys:gridselect url="${r"${ctx}"}/${urlPrefix}/select${c.simpleJavaField}" id="${c.simpleJavaField}" name="${c.simpleJavaField}"  value="${"$"}{${className}.${c.simpleJavaField}.id}"  title="选择${c.comments}" labelName="${c.simpleJavaField}.${c.searchKey}" 
					labelValue="${"$"}{${className}.${c.simpleJavaField}.${c.searchKey}}" cssClass="form-control required" fieldLabels="${c.fieldLabels}" fieldKeys="${c.fieldKeys}" searchLabel="${c.searchLabel}" searchKey="${c.searchKey}" ></sys:gridselect>
			</#if>
			</#if>
		</#list>
		 </div>	
	</form:form>
	<br/>
	</div>
	</div>
	
	<!-- 工具栏 -->
	<div class="row">
	<div class="col-sm-12">
		<div class="pull-left">
			<shiro:hasPermission name="${permissionPrefix}:add">
				<table:addRow url="${r"${ctx}"}/${urlPrefix}/form" title="${functionNameSimple}"></table:addRow><!-- 增加按钮 -->
			</shiro:hasPermission>
			<shiro:hasPermission name="${permissionPrefix}:edit">
			    <table:editRow url="${r"${ctx}"}/${urlPrefix}/form" title="${functionNameSimple}" id="contentTable"></table:editRow><!-- 编辑按钮 -->
			</shiro:hasPermission>
			<shiro:hasPermission name="${permissionPrefix}:del">
				<table:delRow url="${r"${ctx}"}/${urlPrefix}/deleteAll" id="contentTable"></table:delRow><!-- 删除按钮 -->
			</shiro:hasPermission>
			<shiro:hasPermission name="${permissionPrefix}:import">
				<table:importExcel url="${r"${ctx}"}/${urlPrefix}/import"></table:importExcel><!-- 导入按钮 -->
			</shiro:hasPermission>
			<shiro:hasPermission name="${permissionPrefix}:export">
	       		<table:exportExcel url="${r"${ctx}"}/${urlPrefix}/export"></table:exportExcel><!-- 导出按钮 -->
	       	</shiro:hasPermission>
	       <button class="btn btn-white btn-sm " data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i> 刷新</button>
		
			</div>
		<div class="pull-right">
			<button  class="btn btn-primary btn-rounded btn-outline btn-sm " onclick="search()" ><i class="fa fa-search"></i> 查询</button>
			<button  class="btn btn-primary btn-rounded btn-outline btn-sm " onclick="reset()" ><i class="fa fa-refresh"></i> 重置</button>
		</div>
	</div>
	</div>
	
	<!-- 表格 -->
	<table id="contentTable" class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable">
		<thead>
			<tr>
				<th> <input type="checkbox" class="i-checks"></th>
				<#list table.columnList as c>
				<#if c.isList?? && c.isList == "1">
					<#if c.showType == "userselect" || c.showType == "officeselect" || c.showType == "areaselect">
				<th  class="sort-column ${c.javaFieldName}">${c.comments}</th>
					<#else>
				<th  class="sort-column ${c.javaFieldId}">${c.comments}</th>
					</#if>
				</#if>
				</#list>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${r"${page.list}"}" var="${className}">
			<tr>
				<td> <input type="checkbox" id="${"$"}{${className}.id}" class="i-checks"></td>
				<#assign firstListField = true>
				<#list table.columnList as c>
					<#if c.isList?? && c.isList == "1">
				<td><#if firstListField><a  href="#" onclick="openDialogView('查看${functionNameSimple}', '${r"${ctx}"}/${urlPrefix}/form?id=${"${"+className+".id}"}','800px', '500px')"></#if>
				<#if c.simpleJavaType == "Date">
					<fmt:formatDate value="${"$"}{${className}.${c.javaFieldId}}" pattern="yyyy-MM-dd HH:mm:ss"/>
				<#elseif c.showType == "select" || c.showType == "checkbox" || c.showType == "radiobox">
					${"$"}{fns:getDictLabel(${className}.${c.javaFieldId}, '${c.dictType}', '')}
				<#elseif c.showType == "userselect" || c.showType == "officeselect" || c.showType == "areaselect" || c.showType == "gridselect">
					${"$"}{${className}.${c.javaFieldName}}
				<#elseif c.showType == "umeditor">
					${"$"}{fns:unescapeHtml(${className}.${c.javaFieldId})}
				<#else>
					${"$"}{${className}.${c.javaFieldId}}
				</#if>
				<#if firstListField></a></#if></td>
						<#assign firstListField = false>
					</#if>
				</#list>
				<td>
					<shiro:hasPermission name="${permissionPrefix}:view">
						<a href="#" onclick="openDialogView('查看${functionNameSimple}', '${r"${ctx}"}/${urlPrefix}/form?id=${"${"+className+".id}"}','800px', '500px')" class="btn btn-info btn-xs" ><i class="fa fa-search-plus"></i> 查看</a>
					</shiro:hasPermission>
					<shiro:hasPermission name="${permissionPrefix}:edit">
    					<a href="#" onclick="openDialog('修改${functionNameSimple}', '${r"${ctx}"}/${urlPrefix}/form?id=${"${"+className+".id}"}','800px', '500px')" class="btn btn-success btn-xs" ><i class="fa fa-edit"></i> 修改</a>
    				</shiro:hasPermission>
    				<shiro:hasPermission name="${permissionPrefix}:del">
						<a href="${r"${ctx}"}/${urlPrefix}/delete?id=${"${"+className+".id}"}" onclick="return confirmx('确认要删除该${functionNameSimple}吗？', this.href)"   class="btn btn-danger btn-xs"><i class="fa fa-trash"></i> 删除</a>
					</shiro:hasPermission>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	
		<!-- 分页代码 -->
	<table:page page="${r"${page}"}"></table:page>
	<br/>
	<br/>
	</div>
	</div>
</div>
</body>
</html>]]>
	</content>
</template>