diff --git a/server/resource/autocode_template/web/form.vue.tpl b/server/resource/autocode_template/web/form.vue.tpl
index 8e2585816..9510e21c9 100644
--- a/server/resource/autocode_template/web/form.vue.tpl
+++ b/server/resource/autocode_template/web/form.vue.tpl
@@ -51,6 +51,10 @@
{{- if eq .FieldType "file" }}
{{- end }}
+ {{- if eq .FieldType "json" }}
+ // 此字段为json结构,可以前端自行控制展示和数据绑定模式 需绑定json的key为 formData.{{.FieldJson}} 后端会按照json的类型进行存取
+ {{"{{"}} formData.{{.FieldJson}} {{"}}"}}
+ {{- end }}
{{- end }}
@@ -129,6 +133,9 @@ const formData = ref({
{{- if eq .FieldType "file" }}
{{.FieldJson}}: [],
{{- end }}
+ {{- if eq .FieldType "json" }}
+ {{.FieldJson}}: {},
+ {{- end }}
{{- end }}
})
// 验证规则
diff --git a/server/resource/autocode_template/web/table.vue.tpl b/server/resource/autocode_template/web/table.vue.tpl
index d46897fb3..1f79a64b7 100644
--- a/server/resource/autocode_template/web/table.vue.tpl
+++ b/server/resource/autocode_template/web/table.vue.tpl
@@ -158,6 +158,12 @@
+ {{- else if eq .FieldType "json" }}
+
+
+ [JSON]
+
+
{{- else }}
{{- end }}
@@ -214,6 +220,10 @@
{{- if eq .FieldType "richtext" }}
{{- end }}
+ {{- if eq .FieldType "json" }}
+ // 此字段为json结构,可以前端自行控制展示和数据绑定模式 需绑定json的key为 formData.{{.FieldJson}} 后端会按照json的类型进行存取
+ {{"{{"}} formData.{{.FieldJson}} {{"}}"}}
+ {{- end }}
{{- if eq .FieldType "int" }}
{{- if .DictType}}
@@ -297,6 +307,8 @@
{{"{{"}} formatDate(formData.{{.FieldJson}}) {{"}}"}}
{{- else if eq .FieldType "richtext" }}
[富文本内容]
+ {{- else if eq .FieldType "json" }}
+ [JSON]
{{- else}}
{{"{{"}} formData.{{.FieldJson}} {{"}}"}}
{{- end }}
@@ -381,6 +393,9 @@ const formData = ref({
{{- if eq .FieldType "file" }}
{{.FieldJson}}: [],
{{- end }}
+ {{- if eq .FieldType "json" }}
+ {{.FieldJson}}: {},
+ {{- end }}
{{- end }}
})
diff --git a/web/src/view/systemTools/autoCode/component/fieldDialog.vue b/web/src/view/systemTools/autoCode/component/fieldDialog.vue
index 91e6f8e50..d87a28e84 100644
--- a/web/src/view/systemTools/autoCode/component/fieldDialog.vue
+++ b/web/src/view/systemTools/autoCode/component/fieldDialog.vue
@@ -96,6 +96,7 @@
>