From f864eaa996d3b2c05907b33ad51fb77811f84d34 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?=
<15040126243@163.com>
Date: Thu, 15 Aug 2024 14:21:30 +0800
Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81=E7=94=9F=E6=88=90=E5=99=A8=20=E8=87=AA=E5=8A=A8?=
=?UTF-8?q?=E9=80=82=E9=85=8Doss=E7=BF=BB=E8=AF=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/main/java/org/dromara/gen/util/VelocityUtils.java | 3 +++
.../ruoyi-gen/src/main/resources/vm/java/vo.java.vm | 7 +++++++
.../ruoyi-gen/src/main/resources/vm/ts/types.ts.vm | 6 ++++++
.../ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm | 4 ++--
.../ruoyi-gen/src/main/resources/vm/vue/index.vue.vm | 4 ++--
5 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/ruoyi-modules/ruoyi-gen/src/main/java/org/dromara/gen/util/VelocityUtils.java b/ruoyi-modules/ruoyi-gen/src/main/java/org/dromara/gen/util/VelocityUtils.java
index bdb80e18..61cd55e9 100644
--- a/ruoyi-modules/ruoyi-gen/src/main/java/org/dromara/gen/util/VelocityUtils.java
+++ b/ruoyi-modules/ruoyi-gen/src/main/java/org/dromara/gen/util/VelocityUtils.java
@@ -213,6 +213,9 @@ public class VelocityUtils {
importList.add("com.fasterxml.jackson.annotation.JsonFormat");
} else if (!column.isSuperColumn() && GenConstants.TYPE_BIGDECIMAL.equals(column.getJavaType())) {
importList.add("java.math.BigDecimal");
+ } else if (!column.isSuperColumn() && "imageUpload".equals(column.getHtmlType())) {
+ importList.add("org.dromara.common.translation.annotation.Translation");
+ importList.add("org.dromara.common.translation.constant.TransConstant");
}
}
return importList;
diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/vo.java.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/vo.java.vm
index f99a2ed9..c896afbe 100644
--- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/vo.java.vm
+++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/vo.java.vm
@@ -53,6 +53,13 @@ public class ${ClassName}Vo implements Serializable {
#end
private $column.javaType $column.javaField;
+#if($column.htmlType == "imageUpload")
+ /**
+ * ${column.columnComment}Url
+ */
+ @Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "${column.javaField}")
+ private String ${column.javaField}Url";
+#end
#end
#end
diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/ts/types.ts.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/ts/types.ts.vm
index c3f6ed1f..35a468e8 100644
--- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/ts/types.ts.vm
+++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/ts/types.ts.vm
@@ -9,6 +9,12 @@ export interface ${BusinessName}VO {
#elseif($column.javaType == 'Boolean') boolean;
#else string;
#end
+#if($column.htmlType == "imageUpload")
+ /**
+ * ${column.columnComment}Url
+ */
+ ${column.javaField}Url: string;
+#end
#end
#end
#if ($table.tree)
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 d13ef2f2..caf3472e 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
@@ -99,9 +99,9 @@
#elseif($column.list && $column.htmlType == "imageUpload")
-
+
-
+
#elseif($column.list && $column.dictType && "" != $column.dictType)
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 886f4ab7..a92d19ad 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
@@ -101,9 +101,9 @@
#elseif($column.list && $column.htmlType == "imageUpload")
-
+
-
+
#elseif($column.list && $column.dictType && "" != $column.dictType)