diff --git a/src/main/java/neatlogic/module/report/widget/DrawTable.java b/src/main/java/neatlogic/module/report/widget/DrawTable.java index 239422f0483230fc9552ff6fe7d71b4f80428ebd..02846a5bfbd955b250bd062c55c81a3ec8950934 100644 --- a/src/main/java/neatlogic/module/report/widget/DrawTable.java +++ b/src/main/java/neatlogic/module/report/widget/DrawTable.java @@ -153,12 +153,70 @@ public class DrawTable implements TemplateMethodModelEx { sb.append(" 条"); int prevPage = currentPage - 1; sb.append("
  • "); + // 首页码 + List homePageList = new ArrayList<>(1); + // 向前 5 页页码 + List forward5PageList = new ArrayList<>(1); + // 上2页 页码 + List previous2PageList = new ArrayList<>(2); + // 当前页码 + List currentPageList = new ArrayList<>(1); + // 后2页 页码 + List next2PageList = new ArrayList<>(2); + // 向后 5 页页码 + List backward5PageList = new ArrayList<>(1); + // 尾页码 + List lastPageList = new ArrayList<>(1); for (int i = 1; i <= pageCount; i++) { - sb.append("
  • " + i + "
  • "); + } + if (CollectionUtils.isNotEmpty(homePageList)) { + int i = homePageList.get(0); + sb.append("
  • " + i + "
  • "); + } + if (CollectionUtils.isNotEmpty(forward5PageList)) { + int i = Math.max(forward5PageList.get(0), 1); + sb.append("
  • "); + } + if (CollectionUtils.isNotEmpty(previous2PageList)) { + for (Integer i : previous2PageList) { + sb.append("
  • " + i + "
  • "); + } + } + if (CollectionUtils.isNotEmpty(currentPageList)) { + int i = currentPageList.get(0); + sb.append("
  • " + i + "
  • "); + } + if (CollectionUtils.isNotEmpty(next2PageList)) { + for (Integer i : next2PageList) { + sb.append("
  • " + i + "
  • "); + } + } + if (CollectionUtils.isNotEmpty(backward5PageList)) { + int i = Math.min(backward5PageList.get(0), pageCount); + sb.append("
  • "); + } + if (CollectionUtils.isNotEmpty(lastPageList)) { + int i = lastPageList.get(0); + sb.append("
  • " + i + "
  • "); } int nextPage = currentPage + 1; sb.append("
  • ");