增加表关联新建功能,同时修复数据库bug

This commit is contained in:
hoteas 2021-07-14 00:48:34 +08:00
parent ada4a926c0
commit d736a74198

View File

@ -234,8 +234,11 @@ func (that *MakeCode) Db2JSON(name string, path string, db db.HoTimeDB) {
coloum["sortable"] = true
}
if !coloum.GetBool("notUse") {
that.TableConfig.GetMap(v.GetString("name"))["columns"] = append(that.TableConfig.GetMap(v.GetString("name")).GetSlice("columns"), coloum)
}
//如果是select类型需要设置options
if coloum.GetString("type") == "select" {
//if coloum.GetString("type") == "select" {
options := Slice{}
comments := strings.Split(info.GetString("label"), " ")
@ -248,12 +251,17 @@ func (that *MakeCode) Db2JSON(name string, path string, db db.HoTimeDB) {
}
}
}
coloum["options"] = options
}
if !coloum.GetBool("notUse") {
that.TableConfig.GetMap(v.GetString("name"))["columns"] = append(that.TableConfig.GetMap(v.GetString("name")).GetSlice("columns"), coloum)
if coloum.GetString("type") == "select" {
coloum["must"] = true
coloum["options"] = options
} else if len(options) > 0 {
coloum["must"] = true
coloum["options"] = options
coloum["type"] = "select"
}
//}
}
//else {