js:
java后台:
import org.springframework.stereotype.Component;
@Component
public class PageUtil {
/*
/ 获取总页数 /
public long getTotalPage() {
long remainder = totalCount % this.getEveryPage(); // 剩余数
if (remainder == 0)
totalPage = totalCount / this.getEveryPage();
else
totalPage = totalCount / this.getEveryPage() + 1;
return totalPage;
}
/ 判断是否有上一页 /
public void hasPrevious() {
if (currentPage > 1)
this.setPrevIoUs(true);
else
this.setPrevIoUs(false);
}
/ 判断是否有下一页 /
public void hasNext() {
if (currentPage < this.getTotalCount())
this.setNext(true);
else
this.setNext(false);
}
public boolean isNext() {
return next;
}
public boolean isPrevIoUs() {
return prevIoUs;
}
public void setTotalPage(long totalPage) {
this.totalPage = totalPage;
}
public void setNext(boolean next) {
this.next = next;
}
public void setPrevIoUs(boolean prevIoUs) {
this.prevIoUs = prevIoUs;
}
public int getEveryPage() {
return everyPage;
}
public long getTotalCount() {
return totalCount;
}
public int getCurrentPage() {
return currentPage;
}
public int getBeginIndex() {
return beginIndex;
}
public List getList() {
return list;
}
public void setEveryPage(int everyPage) {
this.everyPage = everyPage;
}
public void setTotalCount(long totalCount) {
this.totalCount = totalCount;
}
public void setCurrentPage(int currentPage) {
this.currentPage = currentPage;
}
public void setBeginIndex(int beginIndex) {
this.beginIndex = beginIndex;
}
public void setList(List list) {
this.list = list;
}
public PageUtil(int currentPage,int pageSize) {
this.currentPage = currentPage;
this.everyPage = pageSize;
}
public PageUtil() {
/*
public PageUtil(int everyPage,int totalCount,int currentPage,int beginIndex,List list) {
super();
this.everyPage = everyPage;
this.totalCount = totalCount;
this.currentPage = currentPage;
this.beginIndex = beginIndex;
this.list = list;
}
}
以上这篇vue.js分页中单击页码更换页面内容的方法(配合spring springmvc)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持编程之家。
原文链接:https://www.f2er.com/springmvc/33731.html