From 61c2e96aaab4a69e6da101e05bcb2ff41d90de44 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 13 May 2024 10:58:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=A1=A8=E6=A0=BC=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B=EF=BC=88=E8=99=9A=E6=8B=9F=E6=BB=9A=E5=8A=A8=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/controller/DemoTableController.java | 9 ++ .../main/resources/static/ruoyi/js/ry-ui.js | 3 +- .../templates/demo/table/virtualScroll.html | 98 +++++++++++++++++++ .../resources/templates/index-topnav.html | 1 + .../src/main/resources/templates/index.html | 1 + .../ruoyi/framework/config/ShiroConfig.java | 11 ++- 6 files changed, 117 insertions(+), 6 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/demo/table/virtualScroll.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/controller/DemoTableController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/controller/DemoTableController.java index ed1ab0308..6bad0bc80 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/controller/DemoTableController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/controller/DemoTableController.java @@ -390,6 +390,15 @@ public class DemoTableController extends BaseController return prefix + "/dynamicColumns"; } + /** + * 表格虚拟滚动 + */ + @GetMapping("/virtualScroll") + public String virtualScroll() + { + return prefix + "/virtualScroll"; + } + /** * 自定义视图分页 */ diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index 6c6d0216a..1d8bc88aa 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -48,7 +48,7 @@ var table = { paginationLoop: false, pageSize: 10, pageNumber: 1, - pageList: [10, 25, 50], + pageList: [10, 25, 50, 100], toolbar: "toolbar", loadingFontSize: 13, striped: false, @@ -103,6 +103,7 @@ var table = { showFooter: options.showFooter, // 是否显示表尾 iconSize: 'outline', // 图标大小:undefined默认的按钮尺寸 xs超小按钮sm小按钮lg大按钮 toolbar: '#' + options.toolbar, // 指定工作栏 + virtualScroll: options.virtualScroll, // 是否启动虚拟滚动(大量数据纯展示时使用) loadingFontSize: options.loadingFontSize, // 自定义加载文本的字体大小 sidePagination: options.sidePagination, // server启用服务端分页client客户端分页 search: options.search, // 是否显示搜索框功能 diff --git a/ruoyi-admin/src/main/resources/templates/demo/table/virtualScroll.html b/ruoyi-admin/src/main/resources/templates/demo/table/virtualScroll.html new file mode 100644 index 000000000..5c0fa839d --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/demo/table/virtualScroll.html @@ -0,0 +1,98 @@ + + + + + + + +
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/index-topnav.html b/ruoyi-admin/src/main/resources/templates/index-topnav.html index 2d99720de..991494236 100644 --- a/ruoyi-admin/src/main/resources/templates/index-topnav.html +++ b/ruoyi-admin/src/main/resources/templates/index-topnav.html @@ -147,6 +147,7 @@
  • 表格自动刷新
  • 表格打印配置
  • 表格动态列
  • +
  • 表格虚拟滚动
  • 自定义视图分页
  • 异步加载表格树
  • 表格其他操作
  • diff --git a/ruoyi-admin/src/main/resources/templates/index.html b/ruoyi-admin/src/main/resources/templates/index.html index 22377fd7b..13b1acd2c 100644 --- a/ruoyi-admin/src/main/resources/templates/index.html +++ b/ruoyi-admin/src/main/resources/templates/index.html @@ -127,6 +127,7 @@
  • 表格自动刷新
  • 表格打印配置
  • 表格动态列
  • +
  • 表格虚拟滚动
  • 自定义视图分页
  • 异步加载表格树
  • 表格其他操作
  • diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ShiroConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ShiroConfig.java index cd3e41164..2f487fa82 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ShiroConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ShiroConfig.java @@ -4,6 +4,7 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; import javax.servlet.Filter; import org.apache.commons.io.IOUtils; @@ -17,7 +18,6 @@ import org.apache.shiro.spring.web.ShiroFilterFactoryBean; import org.apache.shiro.web.mgt.CookieRememberMeManager; import org.apache.shiro.web.mgt.DefaultWebSecurityManager; import org.apache.shiro.web.servlet.SimpleCookie; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; @@ -132,9 +132,6 @@ public class ShiroConfig @Value("${shiro.rememberMe.enabled: false}") private boolean rememberMe; - @Autowired - private PermitAllUrlProperties permitAllUrl; - /** * 缓存管理器 使用Ehcache实现 */ @@ -294,7 +291,11 @@ public class ShiroConfig filterChainDefinitionMap.put("/ruoyi/**", "anon"); filterChainDefinitionMap.put("/captcha/captchaImage**", "anon"); // 匿名访问不鉴权注解列表 - permitAllUrl.getUrls().forEach(url -> filterChainDefinitionMap.put(url, "anon")); + List permitAllUrl = SpringUtils.getBean(PermitAllUrlProperties.class).getUrls(); + if (StringUtils.isNotEmpty(permitAllUrl)) + { + permitAllUrl.forEach(url -> filterChainDefinitionMap.put(url, "anon")); + } // 退出 logout地址,shiro去清除session filterChainDefinitionMap.put("/logout", "logout"); // 不需要拦截的访问