Skip to content

Commit 12124eb

Browse files
committed
feat: 完善自动化代码填充方法逻辑,增加成功率
1 parent e036395 commit 12124eb

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

Diff for: server/api/v1/system/auto_code_template.go

+4
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ func (a *AutoCodeTemplateApi) AddFunc(c *gin.Context) {
100100
}
101101
var tempMap map[string]string
102102
if info.IsPreview {
103+
info.Router = "填充router"
104+
info.FuncName = "填充funcName"
105+
info.Method = "填充method"
106+
info.Description = "填充description"
103107
tempMap, err = autoCodeTemplateService.GetApiAndServer(info)
104108
} else {
105109
err = autoCodeTemplateService.AddFunc(info)

Diff for: server/resource/package/web/view/form.vue.tpl

+6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@
7676
const {{ $element }}Options = ref([])
7777
{{- end }}
7878

79+
// init方法中增加如下调用
80+
81+
{{- range $index, $element := .DictTypes }}
82+
{{ $element }}Options.value = await getDictFunc('{{$element}}')
83+
{{- end }}
84+
7985
// 基础formData结构增加如下字段
8086
{{- range .Fields}}
8187
{{- if .Form}}

Diff for: server/resource/plugin/web/form/form.vue.template

+6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@
7676
const {{ $element }}Options = ref([])
7777
{{- end }}
7878

79+
// init方法中增加如下调用
80+
81+
{{- range $index, $element := .DictTypes }}
82+
{{ $element }}Options.value = await getDictFunc('{{$element}}')
83+
{{- end }}
84+
7985
// 基础formData结构增加如下字段
8086
{{- range .Fields}}
8187
{{- if .Form}}

0 commit comments

Comments
 (0)