This commit is contained in:
jiangyong 2026-03-09 12:38:49 +08:00
parent 587e29ccd9
commit 79dd16de58
1 changed files with 3 additions and 0 deletions

View File

@ -24,6 +24,7 @@ type Form struct {
Name string `json:"name"` //表单名称
Key string `json:"key"` //表单KEY
Value interface{} `json:"value"` //表单值
Default interface{} `json:"default"` //默认值
Disable bool `json:"disable,omitempty"` //是否禁用
Tips string `json:"tips"` //表单提示
Option []*FormOption `json:"option"` //表单选项radio和checkbox需要
@ -50,6 +51,8 @@ func NewFroms(tplConfig, saveConfig string) ([]*Form, error) {
for _, form := range forms {
if _, ok := cfg[form.Key]; ok {
form.Value = cfg[form.Key]
} else {
form.Value = form.Default
}
}
return forms, err