From 089ebaf9c59d2ee8186c8327720ca67f22efde50 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Thu, 24 Feb 2022 09:29:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=E6=94=AF=E6=8C=81=E6=97=A5=E6=9C=9F/=E5=AD=97?= =?UTF-8?q?=E5=85=B8=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/common/security/auth/AuthLogic.java | 2 +- .../java/com/ruoyi/gen/util/VelocityUtils.java | 18 +++++++++- .../src/main/resources/vm/vue/index.vue.vm | 35 ++++++++++++++++--- .../src/main/resources/vm/vue/v3/index.vue.vm | 40 +++++++++++++++++++--- ruoyi-ui/src/views/system/dept/index.vue | 2 +- 5 files changed, 86 insertions(+), 11 deletions(-) diff --git a/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/auth/AuthLogic.java b/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/auth/AuthLogic.java index 6b7c82c..61820df 100644 --- a/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/auth/AuthLogic.java +++ b/ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/auth/AuthLogic.java @@ -93,7 +93,7 @@ public class AuthLogic } /** - * 验证当前用户有效期, 如果相差不足360分钟,自动刷新缓存 + * 验证当前用户有效期, 如果相差不足120分钟,自动刷新缓存 * * @param loginUser 当前用户信息 */ diff --git a/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/util/VelocityUtils.java b/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/util/VelocityUtils.java index 125328a..5aa3c7c 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/util/VelocityUtils.java +++ b/ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/util/VelocityUtils.java @@ -271,6 +271,23 @@ public class VelocityUtils { List columns = genTable.getColumns(); Set dicts = new HashSet(); + addDicts(dicts, columns); + if (StringUtils.isNotNull(genTable.getSubTable())) + { + List subColumns = genTable.getSubTable().getColumns(); + addDicts(dicts, subColumns); + } + return StringUtils.join(dicts, ", "); + } + + /** + * 添加字典列表 + * + * @param dicts 字典列表 + * @param columns 列集合 + */ + public static void addDicts(Set dicts, List columns) + { for (GenTableColumn column : columns) { if (!column.isSuperColumn() && StringUtils.isNotEmpty(column.getDictType()) && StringUtils.equalsAny( @@ -280,7 +297,6 @@ public class VelocityUtils dicts.add("'" + column.getDictType() + "'"); } } - return StringUtils.join(dicts, ", "); } /** 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 e7687b7..f034d7d 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 @@ -44,7 +44,7 @@ v-model="queryParams.${column.javaField}" type="date" value-format="yyyy-MM-dd" - placeholder="选择${comment}"> + placeholder="请选择${comment}"> #elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN") @@ -269,7 +269,7 @@ v-model="form.${field}" type="date" value-format="yyyy-MM-dd" - placeholder="选择${comment}"> + placeholder="请选择${comment}"> #elseif($column.htmlType == "textarea") @@ -302,12 +302,39 @@ #set($comment=$column.columnComment) #end #if($column.pk || $javaField == ${subTableFkclassName}) -#elseif($column.list && "" != $javaField) - +#elseif($column.list && $column.htmlType == "input") + +#elseif($column.list && $column.htmlType == "datetime") + + + +#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" != $column.dictType) + + + +#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" == $column.dictType) + + + #end #end diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index.vue.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index.vue.vm index 08bb071..a363ef3 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index.vue.vm +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index.vue.vm @@ -43,7 +43,7 @@ v-model="queryParams.${column.javaField}" type="date" value-format="YYYY-MM-DD" - placeholder="选择${comment}"> + placeholder="请选择${comment}"> #elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN") @@ -260,7 +260,7 @@ v-model="form.${field}" type="date" value-format="YYYY-MM-DD" - placeholder="选择${comment}"> + placeholder="请选择${comment}"> #elseif($column.htmlType == "textarea") @@ -293,12 +293,44 @@ #set($comment=$column.columnComment) #end #if($column.pk || $javaField == ${subTableFkclassName}) -#elseif($column.list && "" != $javaField) - +#elseif($column.list && $column.htmlType == "input") + +#elseif($column.list && $column.htmlType == "datetime") + + + +#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" != $column.dictType) + + + +#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" == $column.dictType) + + + #end #end diff --git a/ruoyi-ui/src/views/system/dept/index.vue b/ruoyi-ui/src/views/system/dept/index.vue index 41c36a8..8af79f1 100644 --- a/ruoyi-ui/src/views/system/dept/index.vue +++ b/ruoyi-ui/src/views/system/dept/index.vue @@ -206,7 +206,7 @@ export default { email: [ { type: "email", - message: "'请输入正确的邮箱地址", + message: "请输入正确的邮箱地址", trigger: ["blur", "change"] } ],