优化系统
This commit is contained in:
parent
cd911e8fa4
commit
2eab29f428
@ -403,26 +403,29 @@ func (that *MakeCode) Db2JSON(name string, path string, db *db.HoTimeDB) {
|
||||
if oldTableName == "parent" {
|
||||
oldTableName = fk
|
||||
}
|
||||
//如果本身匹配则不再继续精简匹配
|
||||
if that.TableConfig[oldTableName] == nil {
|
||||
|
||||
//如果依然找不到则查询system_org是否存在
|
||||
if that.TableConfig[DefaultMenuParentName+"_"+oldTableName] != nil {
|
||||
oldTableName = DefaultMenuParentName + "_" + oldTableName
|
||||
}
|
||||
//如果依然找不到则查询system_org是否存在
|
||||
if that.TableConfig[DefaultMenuParentName+"_"+oldTableName] != nil {
|
||||
oldTableName = DefaultMenuParentName + "_" + oldTableName
|
||||
}
|
||||
|
||||
//字段有动词前缀,自动进行解析
|
||||
prefixColumn := strings.Index(oldTableName, "_")
|
||||
//字段有动词前缀,自动进行解析
|
||||
prefixColumn := strings.Index(oldTableName, "_")
|
||||
|
||||
//sys_org_id oldTableName即为sys此处判断为org表存在
|
||||
//sys_org_id oldTableName即为sys此处判断为org表存在
|
||||
|
||||
if prefixColumn > -1 && that.TableConfig[oldTableName[prefixColumn+1:]] != nil {
|
||||
oldTableName = oldTableName[prefixColumn+1:]
|
||||
}
|
||||
if prefixColumn >= len(oldTableName) {
|
||||
prefixColumn = -1
|
||||
}
|
||||
//如果依然找不到则查询system_org是否存在
|
||||
if prefixColumn > -1 && that.TableConfig[DefaultMenuParentName+"_"+oldTableName[prefixColumn+1:]] != nil {
|
||||
oldTableName = DefaultMenuParentName + "_" + oldTableName[prefixColumn+1:]
|
||||
if prefixColumn > -1 && that.TableConfig[oldTableName[prefixColumn+1:]] != nil {
|
||||
oldTableName = oldTableName[prefixColumn+1:]
|
||||
}
|
||||
if prefixColumn >= len(oldTableName) {
|
||||
prefixColumn = -1
|
||||
}
|
||||
//如果依然找不到则查询system_org是否存在
|
||||
if prefixColumn > -1 && that.TableConfig[DefaultMenuParentName+"_"+oldTableName[prefixColumn+1:]] != nil {
|
||||
oldTableName = DefaultMenuParentName + "_" + oldTableName[prefixColumn+1:]
|
||||
}
|
||||
}
|
||||
|
||||
//普通方式查询不到,则转换为大型项目模块划分,暂时只支持一级模块划分,
|
||||
@ -571,7 +574,12 @@ func (that *MakeCode) Add(table string, req *http.Request) Map {
|
||||
if v.Get("add") == nil || v.GetBool("add") {
|
||||
|
||||
if len(req.Form[v.GetString("name")]) == 0 {
|
||||
return nil
|
||||
if v.GetBool("must") {
|
||||
return nil
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
|
||||
}
|
||||
reqValue := req.FormValue(v.GetString("name"))
|
||||
if (reqValue == "" || reqValue == "null") && strings.Contains(v.GetString("name"), "id") {
|
||||
@ -680,6 +688,11 @@ func (that *MakeCode) Search(table string, userData Map, req *http.Request, db *
|
||||
hasUser = true
|
||||
}
|
||||
|
||||
reqValue := req.FormValue(v.GetString("name"))
|
||||
if reqValue != "" {
|
||||
data[table+"."+v.GetString("name")] = reqValue
|
||||
}
|
||||
|
||||
} else {
|
||||
reStr += table + "." + v.GetString("name") + ","
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
BIN
example/tpt/file/2021/12/27/a24a4bc4d8f4947de0eed6bcf9b7186c.jpg
Normal file
BIN
example/tpt/file/2021/12/27/a24a4bc4d8f4947de0eed6bcf9b7186c.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
Loading…
Reference in New Issue
Block a user