fix 代码生成下拉选择,单选框类型匹配

This commit is contained in:
yxh 2023-07-11 22:30:24 +08:00
parent 22124dc4f2
commit 6bdc7a836b
3 changed files with 22 additions and 2 deletions

View File

@ -8,5 +8,5 @@
package consts
const (
Version = "3.2.3"
Version = "3.2.4"
)

View File

@ -39,7 +39,7 @@ import (
{{if $hasArr}}
"github.com/gogf/gf/v2/container/garray"
{{end}}
{{if and .table.HasTimeColumn $hasGtime}}
{{if or .table.HasTimeColumn $hasGtime}}
"github.com/gogf/gf/v2/os/gtime"
{{end}}
"github.com/gogf/gf/v2/util/gmeta"

View File

@ -385,6 +385,26 @@ export default defineComponent({
{{end}}
{{else if and (eq $column.HtmlType "radio" "select") (ne $column.DictType "")}}
data.{{$column.HtmlField}} = ''+data.{{$column.HtmlField}}
{{else if eq $column.HtmlType "radio" "select" }}
{{if eq $column.TsType "number"}}
data.{{$column.HtmlField}} = parseInt(data.{{$column.HtmlField}})
{{else if eq $column.TsType "string"}}
data.{{$column.HtmlField}} = ''+data.{{$column.HtmlField}}
{{else}}
data.{{$column.HtmlField}} = data.{{$column.HtmlField}}
{{end}}
{{else if eq $column.HtmlType "treeSelect"}}
{{$isNumber := false}}
{{range $li,$lc := $.table.LinkedTables}}
{{if and (eq $lc.TableName $column.LinkTableName) (ne $lc.OptionsStruct.ColumnAttr.GoType "string")}}
{{$isNumber = true}}
{{end}}
{{end}}
{{if $isNumber}}
data.{{$column.HtmlField}} = parseInt(data.{{$column.HtmlField}})
{{else}}
data.{{$column.HtmlField}} = ''+data.{{$column.HtmlField}}
{{end}}
{{else if eq $column.HtmlType "imagefile"}}
//单图地址赋值
imageUrl{{$column.GoField}}.value = data.{{$column.HtmlField}} ? proxy.getUpFileUrl(data.{{$column.HtmlField}}) : ''