diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ServletUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ServletUtils.java
index 51a6141e..1142e412 100644
--- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ServletUtils.java
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/ServletUtils.java
@@ -63,6 +63,22 @@ public class ServletUtils
return Convert.toInt(getRequest().getParameter(name), defaultValue);
}
+ /**
+ * 获取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
*/
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/controller/BaseController.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/controller/BaseController.java
index 1b423d63..64169511 100644
--- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/controller/BaseController.java
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/controller/BaseController.java
@@ -55,7 +55,8 @@ public class BaseController
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);
}
}
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/page/PageDomain.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/page/PageDomain.java
index e97b4e55..413aabf2 100644
--- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/page/PageDomain.java
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/page/PageDomain.java
@@ -21,6 +21,9 @@ public class PageDomain
/** 排序的方向desc或者asc */
private String isAsc = "asc";
+ /** 分页参数合理化 */
+ private Boolean reasonable = true;
+
public String getOrderBy()
{
if (StringUtils.isEmpty(orderByColumn))
@@ -81,4 +84,18 @@ public class PageDomain
this.isAsc = isAsc;
}
}
+
+ public Boolean getReasonable()
+ {
+ if (StringUtils.isNull(reasonable))
+ {
+ return Boolean.TRUE;
+ }
+ return reasonable;
+ }
+
+ public void setReasonable(Boolean reasonable)
+ {
+ this.reasonable = reasonable;
+ }
}
diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/page/TableSupport.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/page/TableSupport.java
index 351064e6..c6bd3dda 100644
--- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/page/TableSupport.java
+++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/web/page/TableSupport.java
@@ -29,6 +29,11 @@ public class TableSupport
*/
public static final String IS_ASC = "isAsc";
+ /**
+ * 分页参数合理化
+ */
+ public static final String REASONABLE = "reasonable";
+
/**
* 封装分页对象
*/
@@ -39,6 +44,7 @@ public class TableSupport
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;
}
diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm
index f7105cba..51c447ee 100644
--- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm
+++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm
@@ -106,7 +106,11 @@
#elseif($column.list && "" != $column.dictType)
-
+
+
+
+
+
#elseif($column.list && "" != $javaField)
#if(${foreach.index} == 1)
@@ -378,20 +382,6 @@ export default {
this.${businessName}Options.push(data);
});
},
-#foreach ($column in $columns)
-#if(${column.dictType} != '')
-#set($parentheseIndex=$column.columnComment.indexOf("("))
-#if($parentheseIndex != -1)
-#set($comment=$column.columnComment.substring(0, $parentheseIndex))
-#else
-#set($comment=$column.columnComment)
-#end
- // $comment字典翻译
- ${column.javaField}Format(row, column) {
- return this.selectDictLabel#if($column.htmlType == "checkbox")s#end(this.${column.javaField}Options, row.${column.javaField});
- },
-#end
-#end
// 取消按钮
cancel() {
this.open = false;
diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm
index 3bf618a1..ca68f624 100644
--- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm
+++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm
@@ -134,7 +134,11 @@
#elseif($column.list && "" != $column.dictType)
-
+
+
+
+
+
#elseif($column.list && "" != $javaField)
#end
@@ -423,20 +427,6 @@ export default {
this.loading = false;
});
},
-#foreach ($column in $columns)
-#if(${column.dictType} != '')
-#set($parentheseIndex=$column.columnComment.indexOf("("))
-#if($parentheseIndex != -1)
-#set($comment=$column.columnComment.substring(0, $parentheseIndex))
-#else
-#set($comment=$column.columnComment)
-#end
- // $comment字典翻译
- ${column.javaField}Format(row, column) {
- return this.selectDictLabel#if($column.htmlType == "checkbox")s#end(this.${column.javaField}Options, row.${column.javaField});
- },
-#end
-#end
// 取消按钮
cancel() {
this.open = false;
diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml
index 9d2cd0ad..afd7e0e9 100644
--- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml
+++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml
@@ -61,13 +61,13 @@
left join sys_role ro on ur.role_id = ro.role_id
where ur.user_id = #{params.userId}
- AND menu_name like concat('%', #{menuName}, '%')
+ AND m.menu_name like concat('%', #{menuName}, '%')
- AND visible = #{visible}
+ AND m.visible = #{visible}
- AND status = #{status}
+ AND m.status = #{status}
order by m.parent_id, m.order_num
diff --git a/ruoyi-ui/src/views/monitor/job/index.vue b/ruoyi-ui/src/views/monitor/job/index.vue
index 9583f70a..f6f0966e 100644
--- a/ruoyi-ui/src/views/monitor/job/index.vue
+++ b/ruoyi-ui/src/views/monitor/job/index.vue
@@ -96,7 +96,11 @@
-
+
+
+
+
+
@@ -356,10 +360,6 @@ export default {
jobGroupFormat(row, column) {
return this.selectDictLabel(this.jobGroupOptions, row.jobGroup);
},
- // 状态字典翻译
- statusFormat(row, column) {
- return this.selectDictLabel(this.statusOptions, row.status);
- },
// 取消按钮
cancel() {
this.open = false;
diff --git a/ruoyi-ui/src/views/monitor/job/log.vue b/ruoyi-ui/src/views/monitor/job/log.vue
index 5aa102d6..e45e4feb 100644
--- a/ruoyi-ui/src/views/monitor/job/log.vue
+++ b/ruoyi-ui/src/views/monitor/job/log.vue
@@ -109,10 +109,18 @@
-
+
+
+
+
+
-
+
+
+
+
+
{{ parseTime(scope.row.createTime) }}
@@ -244,14 +252,6 @@ export default {
}
);
},
- // 执行状态字典翻译
- statusFormat(row, column) {
- return this.selectDictLabel(this.statusOptions, row.status);
- },
- // 任务组名字典翻译
- jobGroupFormat(row, column) {
- return this.selectDictLabel(this.jobGroupOptions, row.jobGroup);
- },
// 返回按钮
handleClose() {
this.$store.dispatch("tagsView/delView", this.$route);
@@ -290,7 +290,7 @@ export default {
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
- })
+ }).catch(() => {});
},
/** 清空按钮操作 */
handleClean() {
@@ -303,7 +303,7 @@ export default {
}).then(() => {
this.getList();
this.msgSuccess("清空成功");
- })
+ }).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
diff --git a/ruoyi-ui/src/views/system/config/index.vue b/ruoyi-ui/src/views/system/config/index.vue
index b692d2cc..8658d1a6 100644
--- a/ruoyi-ui/src/views/system/config/index.vue
+++ b/ruoyi-ui/src/views/system/config/index.vue
@@ -111,7 +111,11 @@
-
+
+
+
+
+
@@ -249,10 +253,6 @@ export default {
}
);
},
- // 参数系统内置字典翻译
- typeFormat(row, column) {
- return this.selectDictLabel(this.typeOptions, row.configType);
- },
// 取消按钮
cancel() {
this.open = false;
diff --git a/ruoyi-ui/src/views/system/dept/index.vue b/ruoyi-ui/src/views/system/dept/index.vue
index 2d58f642..96cbcafc 100644
--- a/ruoyi-ui/src/views/system/dept/index.vue
+++ b/ruoyi-ui/src/views/system/dept/index.vue
@@ -49,7 +49,11 @@
>
-
+
+
+
+
+
{{ parseTime(scope.row.createTime) }}
@@ -57,17 +61,17 @@
- 修改
- 新增
@@ -223,10 +227,6 @@ export default {
children: node.children
};
},
- // 字典状态字典翻译
- statusFormat(row, column) {
- return this.selectDictLabel(this.statusOptions, row.status);
- },
// 取消按钮
cancel() {
this.open = false;
diff --git a/ruoyi-ui/src/views/system/logininfor/index.vue b/ruoyi-ui/src/views/system/logininfor/index.vue
index a0e9569b..6d039b30 100644
--- a/ruoyi-ui/src/views/system/logininfor/index.vue
+++ b/ruoyi-ui/src/views/system/logininfor/index.vue
@@ -95,7 +95,11 @@
-
+
+
+
+
+
@@ -166,10 +170,6 @@ export default {
}
);
},
- // 登录状态字典翻译
- statusFormat(row, column) {
- return this.selectDictLabel(this.statusOptions, row.status);
- },
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
diff --git a/ruoyi-ui/src/views/system/menu/index.vue b/ruoyi-ui/src/views/system/menu/index.vue
index b0ea59a9..80559692 100644
--- a/ruoyi-ui/src/views/system/menu/index.vue
+++ b/ruoyi-ui/src/views/system/menu/index.vue
@@ -55,7 +55,11 @@
-
+
+
+
+
+
{{ parseTime(scope.row.createTime) }}
@@ -63,16 +67,16 @@
- 修改
- 新增
@@ -338,20 +342,6 @@ export default {
this.menuOptions.push(menu);
});
},
- // 显示状态字典翻译
- visibleFormat(row, column) {
- if (row.menuType == "F") {
- return "";
- }
- return this.selectDictLabel(this.visibleOptions, row.visible);
- },
- // 菜单状态字典翻译
- statusFormat(row, column) {
- if (row.menuType == "F") {
- return "";
- }
- return this.selectDictLabel(this.statusOptions, row.status);
- },
// 取消按钮
cancel() {
this.open = false;
@@ -439,4 +429,4 @@ export default {
}
}
};
-
\ No newline at end of file
+
diff --git a/ruoyi-ui/src/views/system/notice/index.vue b/ruoyi-ui/src/views/system/notice/index.vue
index cfbe761e..971412c0 100644
--- a/ruoyi-ui/src/views/system/notice/index.vue
+++ b/ruoyi-ui/src/views/system/notice/index.vue
@@ -80,20 +80,16 @@
prop="noticeTitle"
:show-overflow-tooltip="true"
/>
-
-
+
+
+
+
+
+
+
+
+
+
@@ -244,14 +240,6 @@ export default {
this.loading = false;
});
},
- // 公告状态字典翻译
- statusFormat(row, column) {
- return this.selectDictLabel(this.statusOptions, row.status);
- },
- // 公告状态字典翻译
- typeFormat(row, column) {
- return this.selectDictLabel(this.typeOptions, row.noticeType);
- },
// 取消按钮
cancel() {
this.open = false;
diff --git a/ruoyi-ui/src/views/system/operlog/index.vue b/ruoyi-ui/src/views/system/operlog/index.vue
index 19b35567..8d86f336 100644
--- a/ruoyi-ui/src/views/system/operlog/index.vue
+++ b/ruoyi-ui/src/views/system/operlog/index.vue
@@ -110,11 +110,19 @@
-
+
+
+
+
+
-
+
+
+
+
+
{{ parseTime(scope.row.operTime) }}
@@ -247,10 +255,6 @@ export default {
}
);
},
- // 操作日志状态字典翻译
- statusFormat(row, column) {
- return this.selectDictLabel(this.statusOptions, row.status);
- },
// 操作日志类型字典翻译
typeFormat(row, column) {
return this.selectDictLabel(this.typeOptions, row.businessType);
diff --git a/ruoyi-ui/src/views/system/post/index.vue b/ruoyi-ui/src/views/system/post/index.vue
index d3a686fc..ab5ee30f 100644
--- a/ruoyi-ui/src/views/system/post/index.vue
+++ b/ruoyi-ui/src/views/system/post/index.vue
@@ -87,7 +87,11 @@
-
+
+
+
+
+
{{ parseTime(scope.row.createTime) }}
@@ -112,7 +116,7 @@
-
+