yangyj há 2 meses atrás
pai
commit
b4841b8249

+ 3 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/impl/ExecutorMeter.java

@@ -2598,6 +2598,7 @@ public class ExecutorMeter extends FormulaExecutor {
             FormData pageIndex = fdm.get(FormulaUtils.getPageIndex(clazz));
             if(pageFd!=null) {
                 int total = totalPage();
+                total=Math.max(1,total);
                 JSONField jf =FormulaUtils.getPageFormat(clazz);
                 String pageTmp;
                 if(jf != null&&jf.format().length()>0){
@@ -2606,7 +2607,8 @@ public class ExecutorMeter extends FormulaExecutor {
                     pageTmp = "第$1页 共" + total + "页";
                 }
                 if(pageTotal!=null){
-                    pageTotal.setValues(IntStream.rangeClosed(1, total).boxed().map(i -> new ElementData(total)).collect(Collectors.toList()));
+                    int finalTotal = total;
+                    pageTotal.setValues(IntStream.rangeClosed(1, total).boxed().map(i -> new ElementData(finalTotal)).collect(Collectors.toList()));
                 }
                 if(pageIndex!=null){
                     pageIndex.setValues(IntStream.rangeClosed(1, total).boxed().map(ElementData::new).collect(Collectors.toList()));