12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <% //macro paginate currentPage totalPage totalRow actionUrl urlParas=""%>
- <%
- if (totalPage <= 0 || currentPage > totalPage) return;
- var startPage = currentPage - 4;
- if(startPage<1){
- startPage=1;
- }
- var endPage = currentPage+4;
- if(endPage>totalPage){
- endPage = totalPage;
- }
- %>
- <ul class="page" style="height: 28px; margin-left: 257px;">
- <li style=" margin-right:15px; line-height:28px; float: left;">共<span>${totalRow}</span>条记录</li>
- <%
- if(currentPage <= 8){
- startPage = 1;
- }
- if(totalPage-currentPage < 8){
- endPage = totalPage;
- }
- if(currentPage == 1){
- %>
- <a href="javascript:"><li style="width:43px; margin-right:4px; border:1px solid #ccc; line-height:26px; text-align:center; height:26px; float:left;"><<</li></a>
- <%}else{%>
- <a href="${actionUrl}${currentPage - 1}&urlParas=${urlParas!}"><li style="width:43px; margin-right:4px; border:1px solid #ccc; line-height:26px; text-align:center; height:26px; float:left;"><<</li></a>
- <%}%>
-
- <%if(currentPage > 8){%>
- <a href="${actionUrl}1&urlParas=${urlParas!''}"><li style="width:20px; margin-right:4px; border:1px solid #ccc; line-height:26px; text-align:center; height:26px; float:left;">1</li></a>
- <a href="${actionUrl}2&urlParas=${urlParas!''}"><li style="width:20px; margin-right:4px; border:1px solid #ccc; line-height:26px; text-align:center; height:26px; float:left;">2</li></a>
- <li>...</li>
- <%}%>
-
- <%
- var index = startPage;
- while(index<=endPage){%>
- <%if(currentPage == index){%>
- <a href="javascript:"><li style="width:20px; margin-right:4px; border:1px solid #ccc; line-height:26px; text-align:center; height:26px; float:left;" class="liColor">${index}</li></a>
- <%}else{%>
- <a href="${actionUrl+index}&urlParas=${urlParas!''}"><li style="width:20px; margin-right:4px; border:1px solid #ccc; line-height:26px; text-align:center; height:26px; float:left;">${index}</li></a>
- <%}%>
- <%
- index= index+1;
- }%>
-
- <%if((totalPage - currentPage) >= 8){%>
- <a href="javascript:"><li>...</li></a>
- <a href="${actionUrl}${totalPage - 1}&urlParas=${urlParas!''}"><li style="width:43px; margin-right:4px; border:1px solid #ccc; line-height:26px; text-align:center; height:26px; float:left;">${totalPage - 1}</li></a>
- <a href="${actionUrl}${totalPage}&urlParas=${urlParas!''}"> <li style="width:43px; margin-right:4px; border:1px solid #ccc; line-height:26px; text-align:center; height:26px; float:left;">${totalPage}</li></a>
- <%}%>
-
- <%if(currentPage == totalPage){%>
- <a href="javascript:" class="next"><li style="width:43px; margin-right:4px; border:1px solid #ccc; line-height:26px; text-align:center; height:26px; float:left;">>></li></a>
- <%}else{%>
- <a href="${actionUrl}${currentPage + 1}&urlParas=${urlParas!}" class="next"><li style="width:43px; margin-right:4px; border:1px solid #ccc; line-height:26px; text-align:center; height:26px; float:left;">>></li></a>
- <%}%>
- </ul>
|