Skip to content

Commit

Permalink
feat: 完善自动化代码填充方法逻辑,增加成功率
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelmaxQm committed Nov 3, 2024
1 parent e036395 commit 12124eb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/api/v1/system/auto_code_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions server/resource/package/web/view/form.vue.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
6 changes: 6 additions & 0 deletions server/resource/plugin/web/form/form.vue.template
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down

0 comments on commit 12124eb

Please sign in to comment.