|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
|
|
|
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> <!--输出,条件,迭代标签库-->
|
|
|
|
<%@ page pageEncoding="utf-8" %>
|
|
|
|
<head>
|
|
|
|
<c:import url="head.jsp"/>
|
|
|
|
|
|
|
|
<c:if test="${!empty datas.columns}">
|
|
|
|
<script>
|
|
|
|
$(function () {
|
|
|
|
$("#checkAll").click(function () {
|
|
|
|
if ($(this).is(":checked")) {
|
|
|
|
$("input[name=cids]:not([disabled])").prop("checked", true);
|
|
|
|
} else {
|
|
|
|
$("input[name=cids]:not([disabled])").prop("checked", false);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</c:if>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<c:choose>
|
|
|
|
<c:when test="${datas.type=='success'}">
|
|
|
|
|
|
|
|
<form:form id="pageForm">
|
|
|
|
|
|
|
|
<c:import url="${datas.importJspPath}/form.jsp"/>
|
|
|
|
|
|
|
|
<table class="table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<c:choose>
|
|
|
|
<c:when test="${!empty datas.titles}">
|
|
|
|
<th>
|
|
|
|
<div class="custom-control custom-checkbox">
|
|
|
|
<input type="checkbox" class="custom-control-input" id="checkAll" />
|
|
|
|
${datas.titles[0]}
|
|
|
|
<label class="custom-control-label" for="checkAll">${data[datas.columns[0]]}</label>
|
|
|
|
</div>
|
|
|
|
</th>
|
|
|
|
|
|
|
|
|
|
|
|
<c:forEach items="${datas.titles}" var="title" begin="1">
|
|
|
|
<th>${title}</th>
|
|
|
|
</c:forEach>
|
|
|
|
|
|
|
|
<c:if test="${!empty datas.otherTitles}">
|
|
|
|
<c:forEach items="${datas.otherTitles}" var="title">
|
|
|
|
<th>${title}</th>
|
|
|
|
</c:forEach>
|
|
|
|
</c:if>
|
|
|
|
|
|
|
|
</c:when>
|
|
|
|
|
|
|
|
<c:otherwise>
|
|
|
|
没有设置标题显示
|
|
|
|
</c:otherwise>
|
|
|
|
</c:choose>
|
|
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
<c:choose>
|
|
|
|
<c:when test="${!empty datas.columns}">
|
|
|
|
<c:forEach items="${datas.datas}" var="data" varStatus="i">
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<div class="custom-control custom-checkbox">
|
|
|
|
<input type="checkbox" class="custom-control-input"
|
|
|
|
id="${datas.columns[0]}_${data[datas.columns[0]]}"
|
|
|
|
name="${datas.columns[0]}s" value="${data[datas.columns[0]]}" disabled="disabled"/>
|
|
|
|
<label class="custom-control-label"
|
|
|
|
for="${datas.columns[0]}_${data[datas.columns[0]]}">${data[datas.columns[0]]}</label>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
<c:forEach items="${datas.columns}" var="column" begin="1">
|
|
|
|
<td>${data[column]}</td>
|
|
|
|
</c:forEach>
|
|
|
|
|
|
|
|
<c:if test="${!empty datas.otherTitles}">
|
|
|
|
<c:import url="${datas.importJspPath}/otherData.jsp">
|
|
|
|
<c:param name="id" value="${data[datas.columns[0]]}"/>
|
|
|
|
<c:param name="index" value="${i.index}"/>
|
|
|
|
</c:import>
|
|
|
|
</c:if>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
</c:forEach>
|
|
|
|
</c:when>
|
|
|
|
<c:otherwise>
|
|
|
|
没有设置列数据显示
|
|
|
|
</c:otherwise>
|
|
|
|
</c:choose>
|
|
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-6">
|
|
|
|
<p class="text-justify font-weight-bold">
|
|
|
|
Showing ${(datas.currentPage-1)*datas.pageSize+1} to ${datas.currentPage*datas.pageSize}
|
|
|
|
of ${datas.count} entries
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-6">
|
|
|
|
<div id="pageButton" class="btn-toolbar justify-content-end" role="toolbar"
|
|
|
|
aria-label="Toolbar with button groups">
|
|
|
|
<div class="btn-group mr-2" role="group">
|
|
|
|
<button value="0" type="button" class="btn btn-secondary">首页</button>
|
|
|
|
<button value="${datas.currentPage-2}" type="button" class="btn btn-secondary"
|
|
|
|
<c:if test="${datas.currentPage-2==-1}">disabled</c:if>>上一页
|
|
|
|
</button>
|
|
|
|
<button value="${datas.currentPage}" type="button" class="btn btn-secondary"
|
|
|
|
<c:if test="${datas.currentPage==datas.pages}">disabled</c:if>>下一页
|
|
|
|
</button>
|
|
|
|
<button value="${datas.pages-1}" type="button" class="btn btn-secondary">尾页</button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="btn-group mr-2" role="group">
|
|
|
|
<c:forEach begin="${datas.currentPage+1}"
|
|
|
|
end="${datas.currentPage+9}" var="i">
|
|
|
|
<c:if test="${i<=datas.pages-1}">
|
|
|
|
<button value="${i}" type="button" class="btn btn-secondary">${i}</button>
|
|
|
|
</c:if>
|
|
|
|
</c:forEach>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form:form>
|
|
|
|
</c:when>
|
|
|
|
<c:otherwise>
|
|
|
|
<div class="alert alert-danger text-center" role="alert">
|
|
|
|
${datas.errorMsg}
|
|
|
|
</div>
|
|
|
|
</c:otherwise>
|
|
|
|
</c:choose>
|
|
|
|
</body>
|
|
|
|
</html>
|