RuoYi
2021-09-02 ee823b8326fd1ae1c838828499643e2e57cf8263
防止表格最后页最后项删除变成暂无数据
已修改17个文件
52 ■■■■■ 文件已修改
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/api/login.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/monitor/job/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/monitor/job/log.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/monitor/logininfor/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/system/config/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/system/dict/data.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/system/dict/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/system/notice/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/system/post/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/system/role/authUser.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/system/role/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/system/user/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/views/tool/gen/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java
@@ -57,7 +57,8 @@
        if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
        {
            String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
            PageHelper.startPage(pageNum, pageSize, orderBy);
            Boolean reasonable = pageDomain.getReasonable();
            PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable);
        }
    }
ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java
@@ -21,6 +21,9 @@
    /** 排序的方向desc或者asc */
    private String isAsc = "asc";
    /** 分页参数合理化 */
    private Boolean reasonable = false;
    public String getOrderBy()
    {
        if (StringUtils.isEmpty(orderByColumn))
@@ -81,4 +84,14 @@
            this.isAsc = isAsc;
        }
    }
    public Boolean getReasonable()
    {
        return reasonable;
    }
    public void setReasonable(Boolean reasonable)
    {
        this.reasonable = reasonable;
    }
}
ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java
@@ -30,6 +30,11 @@
    public static final String IS_ASC = "isAsc";
    /**
     * 分页参数合理化
     */
    public static final String REASONABLE = "reasonable";
    /**
     * 封装分页对象
     */
    public static PageDomain getPageDomain()
@@ -39,6 +44,7 @@
        pageDomain.setPageSize(ServletUtils.getParameterToInt(PAGE_SIZE));
        pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN));
        pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC));
        pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE));
        return pageDomain;
    }
ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java
@@ -49,6 +49,22 @@
    }
    /**
     * 获取Boolean参数
     */
    public static Boolean getParameterToBool(String name)
    {
        return Convert.toBool(getRequest().getParameter(name));
    }
    /**
     * 获取Boolean参数
     */
    public static Boolean getParameterToBool(String name, Boolean defaultValue)
    {
        return Convert.toBool(getRequest().getParameter(name), defaultValue);
    }
    /**
     * 获取request
     */
    public static HttpServletRequest getRequest()
ruoyi-ui/src/api/login.js
@@ -48,6 +48,6 @@
  return request({
    url: '/captchaImage',
    method: 'get',
    timeout: 20000
    timeout: 20000
  })
}
ruoyi-ui/src/views/monitor/job/index.vue
@@ -320,6 +320,7 @@
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        reasonable: true,
        jobName: undefined,
        jobGroup: undefined,
        status: undefined
ruoyi-ui/src/views/monitor/job/log.vue
@@ -220,6 +220,7 @@
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        reasonable: true,
        jobName: undefined,
        jobGroup: undefined,
        status: undefined
ruoyi-ui/src/views/monitor/logininfor/index.vue
@@ -153,6 +153,7 @@
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        reasonable: true,
        ipaddr: undefined,
        userName: undefined,
        status: undefined
ruoyi-ui/src/views/system/config/index.vue
@@ -219,6 +219,7 @@
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        reasonable: true,
        configName: undefined,
        configKey: undefined,
        configType: undefined
ruoyi-ui/src/views/system/dict/data.vue
@@ -247,6 +247,7 @@
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        reasonable: true,
        dictName: undefined,
        dictType: undefined,
        status: undefined
ruoyi-ui/src/views/system/dict/index.vue
@@ -227,6 +227,7 @@
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        reasonable: true,
        dictName: undefined,
        dictType: undefined,
        status: undefined
ruoyi-ui/src/views/system/notice/index.vue
@@ -204,6 +204,7 @@
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        reasonable: true,
        noticeTitle: undefined,
        createBy: undefined,
        status: undefined
ruoyi-ui/src/views/system/post/index.vue
@@ -192,6 +192,7 @@
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        reasonable: true,
        postCode: undefined,
        postName: undefined,
        status: undefined
ruoyi-ui/src/views/system/role/authUser.vue
@@ -128,6 +128,7 @@
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        reasonable: true,
        roleId: undefined,
        userName: undefined,
        phonenumber: undefined
ruoyi-ui/src/views/system/role/index.vue
@@ -328,6 +328,7 @@
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        reasonable: true,
        roleName: undefined,
        roleKey: undefined,
        status: undefined
ruoyi-ui/src/views/system/user/index.vue
@@ -418,6 +418,7 @@
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        reasonable: true,
        userName: undefined,
        phonenumber: undefined,
        status: undefined,
ruoyi-ui/src/views/tool/gen/index.vue
@@ -219,6 +219,7 @@
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        reasonable: true,
        tableName: undefined,
        tableComment: undefined
      },