report前端分页bug修复

This commit is contained in:
chenjinsong
2018-07-11 15:38:37 +08:00
parent 84338393d9
commit f067b24fba
7 changed files with 57 additions and 44 deletions

View File

@@ -133,7 +133,6 @@ public class NtcSrcipDomesticReportController extends BaseController {
} }
model.addAttribute("splitor", Constants.REPORT_TRIM_CONNECTOR); model.addAttribute("splitor", Constants.REPORT_TRIM_CONNECTOR);
model.addAttribute("datas", showData); model.addAttribute("datas", showData);
model.addAttribute("dataLength", showData.size());
return "/report/srcIp"; return "/report/srcIp";
} }
} }

View File

@@ -125,7 +125,6 @@ public class NtcTagReportController extends BaseController {
showData.put(label.getServiceDictId().toString(), _line); showData.put(label.getServiceDictId().toString(), _line);
} }
model.addAttribute("datas", showData); model.addAttribute("datas", showData);
model.addAttribute("dataLength", showData.size());
return "/report/label"; return "/report/label";
} }
} }

View File

@@ -5,15 +5,15 @@ function pagination() {
pageNo = 1; pageNo = 1;
count = $('tbody').children().size();// 总记录数 count = $('tbody').children().size();// 总记录数
//处理ajax时jquery选择器缓存的问题 //处理ajax时jquery选择器缓存的问题
dataLength = "${dataLength}"; /* dataLength = "${fn:length(datas)}";
preCount = 0; preCount = 0;
if (dataLength < count) { if (dataLength < count) {
preCount = count - dataLength; preCount = count - dataLength;
count = count - preCount; count = count - preCount;
} alert(count)
$('tbody').children().slice(0, preCount).remove(); //$('tbody').children().slice(0, preCount).remove();
} */
pageSize = 30; // 页面大小 pageSize = 30; // 页面大小

View File

@@ -1,7 +1,6 @@
<%@ page contentType="text/html;charset=UTF-8"%> <%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%> <%@ include file="/WEB-INF/include/taglib.jsp"%>
<%@ include file="/WEB-INF/include/form/pageGroup.jsp"%> <%@ include file="/WEB-INF/include/form/pageGroup.jsp"%>
<%-- <script src="${ctxStatic }/pages/scripts/pageGroup.js" type="text/javascript"></script> --%>
<table id="tagTable" class="table table-striped table-bordered table-condensed text-nowrap"> <table id="tagTable" class="table table-striped table-bordered table-condensed text-nowrap">
<thead> <thead>
<tr> <tr>
@@ -13,18 +12,25 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<script type="text/javascript">
var trContent = "";
<c:forEach items="${datas}" var="data"> <c:forEach items="${datas}" var="data">
<tr> trContent += "<tr>";
<td>
<c:forEach items="${labels}" var="label"> <c:forEach items="${labels}" var="label">
<c:if test="${label.serviceDictId==data.key}">${label.itemValue}</c:if> <c:if test="${label.serviceDictId==data.key}">
trContent += "<td>${label.itemValue}</td>";
</c:if>
</c:forEach> </c:forEach>
</td>
<c:forEach items="${data.value}" var="cloumn" varStatus="status"> <c:forEach items="${data.value}" var="cloumn" varStatus="status">
<td>${cloumn}</td> trContent += "<td>${cloumn}</td>";
</c:forEach> </c:forEach>
</tr> trContent += "</tr>";
</c:forEach> </c:forEach>
$('tbody').remove();
$('#tagTable').append("<tbody></tbody>");
$('tbody').html(trContent);
pagination();
</script>
</tbody> </tbody>
</table> </table>
<div class="page"></div> <div class="page"></div>

View File

@@ -105,7 +105,7 @@
} }
var ajaxReport=function(url,target){ var ajaxReport=function(url,target){
loading('<spring:message code="onloading"/>'); //loading('<spring:message code="onloading"/>');
$.ajax({ $.ajax({
type:'post', type:'post',
async:false, async:false,
@@ -119,8 +119,7 @@ var ajaxReport=function(url,target){
dataType:"html", dataType:"html",
success:function(data){ success:function(data){
$(target).html(data);//#label $(target).html(data);//#label
pagination(); //closeTip();
closeTip();
} }
}); });
}; };

View File

@@ -1,9 +1,6 @@
<%@ page contentType="text/html;charset=UTF-8"%> <%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%> <%@ include file="/WEB-INF/include/taglib.jsp"%>
<script type="text/javascript"> <%@ include file="/WEB-INF/include/form/pageGroup.jsp"%>
$(function(){
});
</script>
<table id="lwhhTable" class="table table-striped table-bordered table-condensed text-nowrap"> <table id="lwhhTable" class="table table-striped table-bordered table-condensed text-nowrap">
<thead> <thead>
<tr> <tr>
@@ -15,18 +12,25 @@ $(function(){
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<script type="text/javascript">
var trContent = "";
<c:forEach items="${datas}" var="data"> <c:forEach items="${datas}" var="data">
<tr> trContent += "<tr>";
<td>
<c:forEach items="${requestInfos}" var="lwhh"> <c:forEach items="${requestInfos}" var="lwhh">
<c:if test="${lwhh.id eq data.key}">${lwhh.requestTitle}</c:if> <c:if test="${lwhh.id eq data.key}">
trContent += "<td>${lwhh.requestTitle}</td>";
</c:if>
</c:forEach> </c:forEach>
</td>
<c:forEach items="${data.value}" var="cloumn" varStatus="status"> <c:forEach items="${data.value}" var="cloumn" varStatus="status">
<td>${cloumn}</td> trContent += "<td>${cloumn}</td>";
</c:forEach> </c:forEach>
</tr> trContent += "</tr>";
</c:forEach> </c:forEach>
$('tbody').remove();
$('#lwhhTable').append("<tbody></tbody>");
$('tbody').html(trContent);
pagination();
</script>
</tbody> </tbody>
</table> </table>
<div class="page">${page}</div> <div class="page">${page}</div>

View File

@@ -1,7 +1,6 @@
<%@ page contentType="text/html;charset=UTF-8"%> <%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%> <%@ include file="/WEB-INF/include/taglib.jsp"%>
<%@ include file="/WEB-INF/include/form/pageGroup.jsp"%> <%@ include file="/WEB-INF/include/form/pageGroup.jsp"%>
<%-- <script src="${ctxStatic }/pages/scripts/pageGroup.js" type="text/javascript"></script> --%>
<table id="contentTable1" class="table table-striped table-bordered table-condensed text-nowrap"> <table id="contentTable1" class="table table-striped table-bordered table-condensed text-nowrap">
<thead> <thead>
<tr> <tr>
@@ -14,16 +13,23 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<script type="text/javascript">
var trContent = "";
<c:forEach items="${datas}" var="data"> <c:forEach items="${datas}" var="data">
<tr> trContent += "<tr>";
<c:forEach items="${fn:split(data.key,splitor)}" var="location"> <c:forEach items="${fn:split(data.key,splitor)}" var="location">
<td>${location}</td> trContent += "<td>${location}</td>";
</c:forEach> </c:forEach>
<c:forEach items="${data.value}" var="cloumn" varStatus="status"> <c:forEach items="${data.value}" var="cloumn" varStatus="status">
<td>${cloumn}</td> trContent += "<td>${cloumn}</td>";
</c:forEach> </c:forEach>
</tr> trContent += "</tr>";
</c:forEach> </c:forEach>
$('tbody').remove();
$('#contentTable1').append("<tbody></tbody>");
$('tbody').html(trContent);
pagination();
</script>
</tbody> </tbody>
</table> </table>
<div class="page"></div> <div class="page"></div>