From 56de9df35916551316c3b642249cea949c77c820 Mon Sep 17 00:00:00 2001
From: autumnal_wind@yeah.net <autumnal_wind@yeah.net>
Date: 星期二, 28 五月 2024 15:17:18 +0800
Subject: [PATCH] feat: 代码生成器优化
---
hs-modules/hs-generator/src/main/resources/vm/vue/DetailForm.vue.vm | 58 +++++++++++++++++++++++++++++-----------------------------
1 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/hs-modules/hs-generator/src/main/resources/vm/vue/DetailForm.vue.vm b/hs-modules/hs-generator/src/main/resources/vm/vue/DetailForm.vue.vm
index 8e58fc7..765cf3c 100644
--- a/hs-modules/hs-generator/src/main/resources/vm/vue/DetailForm.vue.vm
+++ b/hs-modules/hs-generator/src/main/resources/vm/vue/DetailForm.vue.vm
@@ -144,43 +144,43 @@
const formRef = ref<ElFormInstance>();
// 表单数据
const formData = ref<${BusinessName}Form>({
-#foreach ($column in $columns)
-#if($column.query)
-#if($column.htmlType != "datetime" || $column.queryType != "BETWEEN")
-$column.javaField: undefined,
-#end
-#end
-#end
+ #foreach ($column in $columns)
+ #if($column.query)
+ #if($column.htmlType != "datetime" || $column.queryType != "BETWEEN")
+ $column.javaField: undefined,
+ #end
+ #end
+ #end
})
// 表单校验规则
const formRules = reactive({
- #foreach ($column in $columns)
- #if($column.insert || $column.edit)
- #if($column.required)
- #set($parentheseIndex=$column.columnComment.indexOf("("))
- #if($parentheseIndex != -1)
- #set($comment=$column.columnComment.substring(0, $parentheseIndex))
- #else
- #set($comment=$column.columnComment)
- #end
- $column.javaField: [
- { required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
- ]#if($foreach.count != $columns.size()),#end
- #end
- #end
- #end
+#foreach ($column in $columns)
+#if($column.insert || $column.edit)
+#if($column.required)
+#set($parentheseIndex=$column.columnComment.indexOf("("))
+#if($parentheseIndex != -1)
+ #set($comment=$column.columnComment.substring(0, $parentheseIndex))
+#else
+ #set($comment=$column.columnComment)
+#end
+ $column.javaField: [
+ { required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
+]#if($foreach.count != $columns.size()),#end
+#end
+#end
+#end
})
/** 表单重置 */
const resetForm = () => {
formData.value = {
- #foreach ($column in $columns)
- #if($column.query)
- #if($column.htmlType != "datetime" || $column.queryType != "BETWEEN")
- $column.javaField: undefined,
- #end
- #end
- #end
+ #foreach ($column in $columns)
+ #if($column.query)
+ #if($column.htmlType != "datetime" || $column.queryType != "BETWEEN")
+ $column.javaField: undefined,
+ #end
+ #end
+ #end
}
formRef.value?.resetFields();
}
--
Gitblit v1.8.0