From 94d1863ef3b47b76e08f3b9e71fcc21e12463452 Mon Sep 17 00:00:00 2001 From: xlsea Date: Tue, 17 Jun 2025 14:03:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(other):=20=E4=BF=AE=E5=A4=8D=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=94=9F=E6=88=90=E5=AD=97=E5=85=B8=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/java/VelocityUtils.java | 20 ++------------------ docs/template/modules/operate-drawer.vue.vm | 8 ++++---- docs/template/modules/search.vue.vm | 8 ++++---- 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/docs/java/VelocityUtils.java b/docs/java/VelocityUtils.java index 062481cb..92c555ed 100644 --- a/docs/java/VelocityUtils.java +++ b/docs/java/VelocityUtils.java @@ -73,8 +73,9 @@ public class VelocityUtils { velocityContext.put("permissionPrefix", getPermissionPrefix(moduleName, businessName)); velocityContext.put("dicts", getDicts(genTable)); velocityContext.put("dictList", getDictList(genTable)); - velocityContext.put("columns", getColumns(genTable)); + velocityContext.put("columns", genTable.getColumns()); velocityContext.put("table", genTable); + velocityContext.put("StrUtil", new StrUtil()); setMenuVelocityContext(velocityContext, genTable); if (GenConstants.TPL_TREE.equals(tplCategory)) { setTreeVelocityContext(velocityContext, genTable); @@ -296,23 +297,6 @@ public class VelocityUtils { } } - /** - * 根据列类型获取字典组 - * - * @param genTable 业务表对象 - * @return 返回字典组 - */ - public static List getColumns(GenTable genTable) { - List columns = genTable.getColumns(); - for (GenTableColumn column : columns) { - if (StringUtils.isNotBlank(column.getDictType())) { - column.setDictType(StringUtils.toCamelCase(column.getDictType())); - } - } - return columns; - } - - /** * 获取权限前缀 * diff --git a/docs/template/modules/operate-drawer.vue.vm b/docs/template/modules/operate-drawer.vue.vm index b5478c01..a7032da4 100644 --- a/docs/template/modules/operate-drawer.vue.vm +++ b/docs/template/modules/operate-drawer.vue.vm @@ -136,7 +136,7 @@ watch(visible, () => { #else #set($comment=$column.columnComment) #end -#set($dictType=$column.dictType) +#set($dictType=$!StrUtil.toCamelCase($column.dictType)) #if($column.htmlType == "textarea" || $column.htmlType == "editor") { #elseif($column.htmlType == "select" && $dictType) @@ -163,7 +163,7 @@ watch(visible, () => { { #foreach($column in $columns) #if($column.query) -#set($dictType=$column.dictType) +#set($dictType=$!StrUtil.toCamelCase($column.dictType)) #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) #set($parentheseIndex=$column.columnComment.indexOf("(")) #if($parentheseIndex != -1) @@ -75,14 +75,14 @@ async function search() { #set($comment=$column.columnComment) #end - #if(($tool.in($column.htmlType, "select", "radio", "checkbox")) && $dictType && "" != $dictType) + #if($!StrUtil.contains("select, radio, checkbox", $column.htmlType) && $dictType && "" != $dictType) - #elseif($tool.in($column.htmlType, "select", "radio", "checkbox")) + #elseif($!StrUtil.contains("select, radio, checkbox", $column.htmlType))