diff --git a/server/api/v1/system/auto_code_template.go b/server/api/v1/system/auto_code_template.go index 7592eb5c80..1a4ce601ce 100644 --- a/server/api/v1/system/auto_code_template.go +++ b/server/api/v1/system/auto_code_template.go @@ -100,6 +100,10 @@ func (a *AutoCodeTemplateApi) AddFunc(c *gin.Context) { } var tempMap map[string]string if info.IsPreview { + info.Router = "填充router" + info.FuncName = "填充funcName" + info.Method = "填充method" + info.Description = "填充description" tempMap, err = autoCodeTemplateService.GetApiAndServer(info) } else { err = autoCodeTemplateService.AddFunc(info) diff --git a/server/resource/package/web/view/form.vue.tpl b/server/resource/package/web/view/form.vue.tpl index d31a69503f..1e0d132998 100644 --- a/server/resource/package/web/view/form.vue.tpl +++ b/server/resource/package/web/view/form.vue.tpl @@ -76,6 +76,12 @@ const {{ $element }}Options = ref([]) {{- end }} +// init方法中增加如下调用 + +{{- range $index, $element := .DictTypes }} + {{ $element }}Options.value = await getDictFunc('{{$element}}') +{{- end }} + // 基础formData结构增加如下字段 {{- range .Fields}} {{- if .Form}} diff --git a/server/resource/plugin/web/form/form.vue.template b/server/resource/plugin/web/form/form.vue.template index 19499aa4a2..2c221d912b 100644 --- a/server/resource/plugin/web/form/form.vue.template +++ b/server/resource/plugin/web/form/form.vue.template @@ -76,6 +76,12 @@ const {{ $element }}Options = ref([]) {{- end }} +// init方法中增加如下调用 + +{{- range $index, $element := .DictTypes }} + {{ $element }}Options.value = await getDictFunc('{{$element}}') +{{- end }} + // 基础formData结构增加如下字段 {{- range .Fields}} {{- if .Form}}