优化makecode

This commit is contained in:
hoteas 2021-11-18 12:22:14 +08:00
parent 68257d1742
commit 320ebe25ec
4 changed files with 19 additions and 2355 deletions

View File

@ -403,26 +403,29 @@ func (that *MakeCode) Db2JSON(name string, path string, db *db.HoTimeDB) {
if oldTableName == "parent" { if oldTableName == "parent" {
oldTableName = fk oldTableName = fk
} }
//如果本身匹配则不再继续精简匹配
if that.TableConfig[oldTableName] == nil {
//如果依然找不到则查询system_org是否存在 //如果依然找不到则查询system_org是否存在
if that.TableConfig[DefaultMenuParentName+"_"+oldTableName] != nil { if that.TableConfig[DefaultMenuParentName+"_"+oldTableName] != nil {
oldTableName = DefaultMenuParentName + "_" + oldTableName 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 { if prefixColumn > -1 && that.TableConfig[oldTableName[prefixColumn+1:]] != nil {
oldTableName = oldTableName[prefixColumn+1:] oldTableName = oldTableName[prefixColumn+1:]
} }
if prefixColumn >= len(oldTableName) { if prefixColumn >= len(oldTableName) {
prefixColumn = -1 prefixColumn = -1
} }
//如果依然找不到则查询system_org是否存在 //如果依然找不到则查询system_org是否存在
if prefixColumn > -1 && that.TableConfig[DefaultMenuParentName+"_"+oldTableName[prefixColumn+1:]] != nil { if prefixColumn > -1 && that.TableConfig[DefaultMenuParentName+"_"+oldTableName[prefixColumn+1:]] != nil {
oldTableName = DefaultMenuParentName + "_" + oldTableName[prefixColumn+1:] oldTableName = DefaultMenuParentName + "_" + oldTableName[prefixColumn+1:]
}
} }
//普通方式查询不到,则转换为大型项目模块划分,暂时只支持一级模块划分, //普通方式查询不到,则转换为大型项目模块划分,暂时只支持一级模块划分,

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.