diff --git a/example/admin/admin.go b/example/admin/admin.go new file mode 100644 index 0000000..769b776 --- /dev/null +++ b/example/admin/admin.go @@ -0,0 +1,107 @@ +package admin + +import ( + . "../../../hotime" + . "../../../hotime/common" +) + +var adminCtr = Ctr{ + "info": func(that *Context) { + re := that.Db.Get(that.RouterString[1], that.MakeCode.Info(that.RouterString[1]), Map{"id": that.RouterString[2]}) + + if re == nil { + that.Display(4, "找不到对应信息") + return + } + + for k, v := range re { + + column := that.MakeCode.TableColumns[that.RouterString[1]][k] + if column == nil { + continue + } + if (column["list"] == nil || column.GetBool("list")) && column.GetString("link") != "" { + re[column.GetString("link")] = that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v}) + } + } + + that.Display(0, re) + }, + "add": func(that *Context) { + inData := that.MakeCode.Add(that.RouterString[1], that.Req) + if inData == nil { + that.Display(3, "请求参数不足") + return + } + re := that.Db.Insert(that.RouterString[1], inData) + + if re == 0 { + that.Display(4, "无法插入对应数据") + return + } + + that.Display(0, re) + }, + "update": func(that *Context) { + inData := that.MakeCode.Edit(that.RouterString[1], that.Req) + if inData == nil { + that.Display(3, "没有找到要更新的数据") + return + } + re := that.Db.Update(that.RouterString[1], inData, Map{"id": that.RouterString[2]}) + + if re == 0 { + that.Display(4, "更新数据失败") + return + } + + that.Display(0, re) + }, + "remove": func(that *Context) { + re := that.Db.Delete(that.RouterString[1], Map{"id": that.RouterString[2]}) + + if re == 0 { + that.Display(4, "删除数据失败") + return + } + that.Display(0, re) + }, + "search": func(that *Context) { + + columnStr, leftJoin, where := that.MakeCode.Search(that.RouterString[1], that.Req, that.Db) + page := ObjToInt(that.Req.FormValue("page")) + pageSize := ObjToInt(that.Req.FormValue("pageSize")) + + if page < 1 { + page = 1 + } + + if pageSize <= 0 { + pageSize = 20 + } + + count := that.Db.Count(that.RouterString[1], leftJoin, where) + reData := that.Db.Page(page, pageSize). + PageSelect(that.RouterString[1], leftJoin, columnStr, where) + + for _, v := range reData { + for k, _ := range v { + column := that.MakeCode.TableColumns[that.RouterString[1]][k] + if column == nil { + continue + } + + if column["list"] != false && column["name"] == "parent_id" && column.GetString("link") != "" { + parentC := that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v.GetCeilInt(k)}) + v[column.GetString("link")+"_"+column.GetString("name")+"_"+column.GetString("value")] = "" + if parentC != nil { + v[column.GetString("link")+"_"+column.GetString("name")+"_"+column.GetString("value")] = parentC.GetString(column.GetString("value")) + } + } + + } + } + + that.Display(0, Map{"count": count, "data": reData}) + }, +} diff --git a/example/admin/cached.go b/example/admin/cached.go new file mode 100644 index 0000000..99aaccc --- /dev/null +++ b/example/admin/cached.go @@ -0,0 +1,107 @@ +package admin + +import ( + . "../../../hotime" + . "../../../hotime/common" +) + +var cachedCtr = Ctr{ + "info": func(that *Context) { + re := that.Db.Get(that.RouterString[1], that.MakeCode.Info(that.RouterString[1]), Map{"id": that.RouterString[2]}) + + if re == nil { + that.Display(4, "找不到对应信息") + return + } + + for k, v := range re { + + column := that.MakeCode.TableColumns[that.RouterString[1]][k] + if column == nil { + continue + } + if (column["list"] == nil || column.GetBool("list")) && column.GetString("link") != "" { + re[column.GetString("link")] = that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v}) + } + } + + that.Display(0, re) + }, + "add": func(that *Context) { + inData := that.MakeCode.Add(that.RouterString[1], that.Req) + if inData == nil { + that.Display(3, "请求参数不足") + return + } + re := that.Db.Insert(that.RouterString[1], inData) + + if re == 0 { + that.Display(4, "无法插入对应数据") + return + } + + that.Display(0, re) + }, + "update": func(that *Context) { + inData := that.MakeCode.Edit(that.RouterString[1], that.Req) + if inData == nil { + that.Display(3, "没有找到要更新的数据") + return + } + re := that.Db.Update(that.RouterString[1], inData, Map{"id": that.RouterString[2]}) + + if re == 0 { + that.Display(4, "更新数据失败") + return + } + + that.Display(0, re) + }, + "remove": func(that *Context) { + re := that.Db.Delete(that.RouterString[1], Map{"id": that.RouterString[2]}) + + if re == 0 { + that.Display(4, "删除数据失败") + return + } + that.Display(0, re) + }, + "search": func(that *Context) { + + columnStr, leftJoin, where := that.MakeCode.Search(that.RouterString[1], that.Req, that.Db) + page := ObjToInt(that.Req.FormValue("page")) + pageSize := ObjToInt(that.Req.FormValue("pageSize")) + + if page < 1 { + page = 1 + } + + if pageSize <= 0 { + pageSize = 20 + } + + count := that.Db.Count(that.RouterString[1], leftJoin, where) + reData := that.Db.Page(page, pageSize). + PageSelect(that.RouterString[1], leftJoin, columnStr, where) + + for _, v := range reData { + for k, _ := range v { + column := that.MakeCode.TableColumns[that.RouterString[1]][k] + if column == nil { + continue + } + + if column["list"] != false && column["name"] == "parent_id" && column.GetString("link") != "" { + parentC := that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v.GetCeilInt(k)}) + v[column.GetString("link")+"_"+column.GetString("name")+"_"+column.GetString("value")] = "" + if parentC != nil { + v[column.GetString("link")+"_"+column.GetString("name")+"_"+column.GetString("value")] = parentC.GetString(column.GetString("value")) + } + } + + } + } + + that.Display(0, Map{"count": count, "data": reData}) + }, +} diff --git a/example/admin/category.go b/example/admin/category.go new file mode 100644 index 0000000..46e82c6 --- /dev/null +++ b/example/admin/category.go @@ -0,0 +1,107 @@ +package admin + +import ( + . "../../../hotime" + . "../../../hotime/common" +) + +var categoryCtr = Ctr{ + "info": func(that *Context) { + re := that.Db.Get(that.RouterString[1], that.MakeCode.Info(that.RouterString[1]), Map{"id": that.RouterString[2]}) + + if re == nil { + that.Display(4, "找不到对应信息") + return + } + + for k, v := range re { + + column := that.MakeCode.TableColumns[that.RouterString[1]][k] + if column == nil { + continue + } + if (column["list"] == nil || column.GetBool("list")) && column.GetString("link") != "" { + re[column.GetString("link")] = that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v}) + } + } + + that.Display(0, re) + }, + "add": func(that *Context) { + inData := that.MakeCode.Add(that.RouterString[1], that.Req) + if inData == nil { + that.Display(3, "请求参数不足") + return + } + re := that.Db.Insert(that.RouterString[1], inData) + + if re == 0 { + that.Display(4, "无法插入对应数据") + return + } + + that.Display(0, re) + }, + "update": func(that *Context) { + inData := that.MakeCode.Edit(that.RouterString[1], that.Req) + if inData == nil { + that.Display(3, "没有找到要更新的数据") + return + } + re := that.Db.Update(that.RouterString[1], inData, Map{"id": that.RouterString[2]}) + + if re == 0 { + that.Display(4, "更新数据失败") + return + } + + that.Display(0, re) + }, + "remove": func(that *Context) { + re := that.Db.Delete(that.RouterString[1], Map{"id": that.RouterString[2]}) + + if re == 0 { + that.Display(4, "删除数据失败") + return + } + that.Display(0, re) + }, + "search": func(that *Context) { + + columnStr, leftJoin, where := that.MakeCode.Search(that.RouterString[1], that.Req, that.Db) + page := ObjToInt(that.Req.FormValue("page")) + pageSize := ObjToInt(that.Req.FormValue("pageSize")) + + if page < 1 { + page = 1 + } + + if pageSize <= 0 { + pageSize = 20 + } + + count := that.Db.Count(that.RouterString[1], leftJoin, where) + reData := that.Db.Page(page, pageSize). + PageSelect(that.RouterString[1], leftJoin, columnStr, where) + + for _, v := range reData { + for k, _ := range v { + column := that.MakeCode.TableColumns[that.RouterString[1]][k] + if column == nil { + continue + } + + if column["list"] != false && column["name"] == "parent_id" && column.GetString("link") != "" { + parentC := that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v.GetCeilInt(k)}) + v[column.GetString("link")+"_"+column.GetString("name")+"_"+column.GetString("value")] = "" + if parentC != nil { + v[column.GetString("link")+"_"+column.GetString("name")+"_"+column.GetString("value")] = parentC.GetString(column.GetString("value")) + } + } + + } + } + + that.Display(0, Map{"count": count, "data": reData}) + }, +} diff --git a/example/admin/ctg_order_date.go b/example/admin/ctg_order_date.go new file mode 100644 index 0000000..0e58a9c --- /dev/null +++ b/example/admin/ctg_order_date.go @@ -0,0 +1,107 @@ +package admin + +import ( + . "../../../hotime" + . "../../../hotime/common" +) + +var ctg_order_dateCtr = Ctr{ + "info": func(that *Context) { + re := that.Db.Get(that.RouterString[1], that.MakeCode.Info(that.RouterString[1]), Map{"id": that.RouterString[2]}) + + if re == nil { + that.Display(4, "找不到对应信息") + return + } + + for k, v := range re { + + column := that.MakeCode.TableColumns[that.RouterString[1]][k] + if column == nil { + continue + } + if (column["list"] == nil || column.GetBool("list")) && column.GetString("link") != "" { + re[column.GetString("link")] = that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v}) + } + } + + that.Display(0, re) + }, + "add": func(that *Context) { + inData := that.MakeCode.Add(that.RouterString[1], that.Req) + if inData == nil { + that.Display(3, "请求参数不足") + return + } + re := that.Db.Insert(that.RouterString[1], inData) + + if re == 0 { + that.Display(4, "无法插入对应数据") + return + } + + that.Display(0, re) + }, + "update": func(that *Context) { + inData := that.MakeCode.Edit(that.RouterString[1], that.Req) + if inData == nil { + that.Display(3, "没有找到要更新的数据") + return + } + re := that.Db.Update(that.RouterString[1], inData, Map{"id": that.RouterString[2]}) + + if re == 0 { + that.Display(4, "更新数据失败") + return + } + + that.Display(0, re) + }, + "remove": func(that *Context) { + re := that.Db.Delete(that.RouterString[1], Map{"id": that.RouterString[2]}) + + if re == 0 { + that.Display(4, "删除数据失败") + return + } + that.Display(0, re) + }, + "search": func(that *Context) { + + columnStr, leftJoin, where := that.MakeCode.Search(that.RouterString[1], that.Req, that.Db) + page := ObjToInt(that.Req.FormValue("page")) + pageSize := ObjToInt(that.Req.FormValue("pageSize")) + + if page < 1 { + page = 1 + } + + if pageSize <= 0 { + pageSize = 20 + } + + count := that.Db.Count(that.RouterString[1], leftJoin, where) + reData := that.Db.Page(page, pageSize). + PageSelect(that.RouterString[1], leftJoin, columnStr, where) + + for _, v := range reData { + for k, _ := range v { + column := that.MakeCode.TableColumns[that.RouterString[1]][k] + if column == nil { + continue + } + + if column["list"] != false && column["name"] == "parent_id" && column.GetString("link") != "" { + parentC := that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v.GetCeilInt(k)}) + v[column.GetString("link")+"_"+column.GetString("name")+"_"+column.GetString("value")] = "" + if parentC != nil { + v[column.GetString("link")+"_"+column.GetString("name")+"_"+column.GetString("value")] = parentC.GetString(column.GetString("value")) + } + } + + } + } + + that.Display(0, Map{"count": count, "data": reData}) + }, +} diff --git a/example/admin/order.go b/example/admin/order.go new file mode 100644 index 0000000..4f8bdaa --- /dev/null +++ b/example/admin/order.go @@ -0,0 +1,107 @@ +package admin + +import ( + . "../../../hotime" + . "../../../hotime/common" +) + +var orderCtr = Ctr{ + "info": func(that *Context) { + re := that.Db.Get(that.RouterString[1], that.MakeCode.Info(that.RouterString[1]), Map{"id": that.RouterString[2]}) + + if re == nil { + that.Display(4, "找不到对应信息") + return + } + + for k, v := range re { + + column := that.MakeCode.TableColumns[that.RouterString[1]][k] + if column == nil { + continue + } + if (column["list"] == nil || column.GetBool("list")) && column.GetString("link") != "" { + re[column.GetString("link")] = that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v}) + } + } + + that.Display(0, re) + }, + "add": func(that *Context) { + inData := that.MakeCode.Add(that.RouterString[1], that.Req) + if inData == nil { + that.Display(3, "请求参数不足") + return + } + re := that.Db.Insert(that.RouterString[1], inData) + + if re == 0 { + that.Display(4, "无法插入对应数据") + return + } + + that.Display(0, re) + }, + "update": func(that *Context) { + inData := that.MakeCode.Edit(that.RouterString[1], that.Req) + if inData == nil { + that.Display(3, "没有找到要更新的数据") + return + } + re := that.Db.Update(that.RouterString[1], inData, Map{"id": that.RouterString[2]}) + + if re == 0 { + that.Display(4, "更新数据失败") + return + } + + that.Display(0, re) + }, + "remove": func(that *Context) { + re := that.Db.Delete(that.RouterString[1], Map{"id": that.RouterString[2]}) + + if re == 0 { + that.Display(4, "删除数据失败") + return + } + that.Display(0, re) + }, + "search": func(that *Context) { + + columnStr, leftJoin, where := that.MakeCode.Search(that.RouterString[1], that.Req, that.Db) + page := ObjToInt(that.Req.FormValue("page")) + pageSize := ObjToInt(that.Req.FormValue("pageSize")) + + if page < 1 { + page = 1 + } + + if pageSize <= 0 { + pageSize = 20 + } + + count := that.Db.Count(that.RouterString[1], leftJoin, where) + reData := that.Db.Page(page, pageSize). + PageSelect(that.RouterString[1], leftJoin, columnStr, where) + + for _, v := range reData { + for k, _ := range v { + column := that.MakeCode.TableColumns[that.RouterString[1]][k] + if column == nil { + continue + } + + if column["list"] != false && column["name"] == "parent_id" && column.GetString("link") != "" { + parentC := that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v.GetCeilInt(k)}) + v[column.GetString("link")+"_"+column.GetString("name")+"_"+column.GetString("value")] = "" + if parentC != nil { + v[column.GetString("link")+"_"+column.GetString("name")+"_"+column.GetString("value")] = parentC.GetString(column.GetString("value")) + } + } + + } + } + + that.Display(0, Map{"count": count, "data": reData}) + }, +} diff --git a/example/admin/org.go b/example/admin/org.go new file mode 100644 index 0000000..6111eca --- /dev/null +++ b/example/admin/org.go @@ -0,0 +1,107 @@ +package admin + +import ( + . "../../../hotime" + . "../../../hotime/common" +) + +var orgCtr = Ctr{ + "info": func(that *Context) { + re := that.Db.Get(that.RouterString[1], that.MakeCode.Info(that.RouterString[1]), Map{"id": that.RouterString[2]}) + + if re == nil { + that.Display(4, "找不到对应信息") + return + } + + for k, v := range re { + + column := that.MakeCode.TableColumns[that.RouterString[1]][k] + if column == nil { + continue + } + if (column["list"] == nil || column.GetBool("list")) && column.GetString("link") != "" { + re[column.GetString("link")] = that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v}) + } + } + + that.Display(0, re) + }, + "add": func(that *Context) { + inData := that.MakeCode.Add(that.RouterString[1], that.Req) + if inData == nil { + that.Display(3, "请求参数不足") + return + } + re := that.Db.Insert(that.RouterString[1], inData) + + if re == 0 { + that.Display(4, "无法插入对应数据") + return + } + + that.Display(0, re) + }, + "update": func(that *Context) { + inData := that.MakeCode.Edit(that.RouterString[1], that.Req) + if inData == nil { + that.Display(3, "没有找到要更新的数据") + return + } + re := that.Db.Update(that.RouterString[1], inData, Map{"id": that.RouterString[2]}) + + if re == 0 { + that.Display(4, "更新数据失败") + return + } + + that.Display(0, re) + }, + "remove": func(that *Context) { + re := that.Db.Delete(that.RouterString[1], Map{"id": that.RouterString[2]}) + + if re == 0 { + that.Display(4, "删除数据失败") + return + } + that.Display(0, re) + }, + "search": func(that *Context) { + + columnStr, leftJoin, where := that.MakeCode.Search(that.RouterString[1], that.Req, that.Db) + page := ObjToInt(that.Req.FormValue("page")) + pageSize := ObjToInt(that.Req.FormValue("pageSize")) + + if page < 1 { + page = 1 + } + + if pageSize <= 0 { + pageSize = 20 + } + + count := that.Db.Count(that.RouterString[1], leftJoin, where) + reData := that.Db.Page(page, pageSize). + PageSelect(that.RouterString[1], leftJoin, columnStr, where) + + for _, v := range reData { + for k, _ := range v { + column := that.MakeCode.TableColumns[that.RouterString[1]][k] + if column == nil { + continue + } + + if column["list"] != false && column["name"] == "parent_id" && column.GetString("link") != "" { + parentC := that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v.GetCeilInt(k)}) + v[column.GetString("link")+"_"+column.GetString("name")+"_"+column.GetString("value")] = "" + if parentC != nil { + v[column.GetString("link")+"_"+column.GetString("name")+"_"+column.GetString("value")] = parentC.GetString(column.GetString("value")) + } + } + + } + } + + that.Display(0, Map{"count": count, "data": reData}) + }, +} diff --git a/example/admin/role.go b/example/admin/role.go new file mode 100644 index 0000000..b2e31cb --- /dev/null +++ b/example/admin/role.go @@ -0,0 +1,107 @@ +package admin + +import ( + . "../../../hotime" + . "../../../hotime/common" +) + +var roleCtr = Ctr{ + "info": func(that *Context) { + re := that.Db.Get(that.RouterString[1], that.MakeCode.Info(that.RouterString[1]), Map{"id": that.RouterString[2]}) + + if re == nil { + that.Display(4, "找不到对应信息") + return + } + + for k, v := range re { + + column := that.MakeCode.TableColumns[that.RouterString[1]][k] + if column == nil { + continue + } + if (column["list"] == nil || column.GetBool("list")) && column.GetString("link") != "" { + re[column.GetString("link")] = that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v}) + } + } + + that.Display(0, re) + }, + "add": func(that *Context) { + inData := that.MakeCode.Add(that.RouterString[1], that.Req) + if inData == nil { + that.Display(3, "请求参数不足") + return + } + re := that.Db.Insert(that.RouterString[1], inData) + + if re == 0 { + that.Display(4, "无法插入对应数据") + return + } + + that.Display(0, re) + }, + "update": func(that *Context) { + inData := that.MakeCode.Edit(that.RouterString[1], that.Req) + if inData == nil { + that.Display(3, "没有找到要更新的数据") + return + } + re := that.Db.Update(that.RouterString[1], inData, Map{"id": that.RouterString[2]}) + + if re == 0 { + that.Display(4, "更新数据失败") + return + } + + that.Display(0, re) + }, + "remove": func(that *Context) { + re := that.Db.Delete(that.RouterString[1], Map{"id": that.RouterString[2]}) + + if re == 0 { + that.Display(4, "删除数据失败") + return + } + that.Display(0, re) + }, + "search": func(that *Context) { + + columnStr, leftJoin, where := that.MakeCode.Search(that.RouterString[1], that.Req, that.Db) + page := ObjToInt(that.Req.FormValue("page")) + pageSize := ObjToInt(that.Req.FormValue("pageSize")) + + if page < 1 { + page = 1 + } + + if pageSize <= 0 { + pageSize = 20 + } + + count := that.Db.Count(that.RouterString[1], leftJoin, where) + reData := that.Db.Page(page, pageSize). + PageSelect(that.RouterString[1], leftJoin, columnStr, where) + + for _, v := range reData { + for k, _ := range v { + column := that.MakeCode.TableColumns[that.RouterString[1]][k] + if column == nil { + continue + } + + if column["list"] != false && column["name"] == "parent_id" && column.GetString("link") != "" { + parentC := that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v.GetCeilInt(k)}) + v[column.GetString("link")+"_"+column.GetString("name")+"_"+column.GetString("value")] = "" + if parentC != nil { + v[column.GetString("link")+"_"+column.GetString("name")+"_"+column.GetString("value")] = parentC.GetString(column.GetString("value")) + } + } + + } + } + + that.Display(0, Map{"count": count, "data": reData}) + }, +} diff --git a/example/admin/user.go b/example/admin/user.go new file mode 100644 index 0000000..1918b28 --- /dev/null +++ b/example/admin/user.go @@ -0,0 +1,107 @@ +package admin + +import ( + . "../../../hotime" + . "../../../hotime/common" +) + +var userCtr = Ctr{ + "info": func(that *Context) { + re := that.Db.Get(that.RouterString[1], that.MakeCode.Info(that.RouterString[1]), Map{"id": that.RouterString[2]}) + + if re == nil { + that.Display(4, "找不到对应信息") + return + } + + for k, v := range re { + + column := that.MakeCode.TableColumns[that.RouterString[1]][k] + if column == nil { + continue + } + if (column["list"] == nil || column.GetBool("list")) && column.GetString("link") != "" { + re[column.GetString("link")] = that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v}) + } + } + + that.Display(0, re) + }, + "add": func(that *Context) { + inData := that.MakeCode.Add(that.RouterString[1], that.Req) + if inData == nil { + that.Display(3, "请求参数不足") + return + } + re := that.Db.Insert(that.RouterString[1], inData) + + if re == 0 { + that.Display(4, "无法插入对应数据") + return + } + + that.Display(0, re) + }, + "update": func(that *Context) { + inData := that.MakeCode.Edit(that.RouterString[1], that.Req) + if inData == nil { + that.Display(3, "没有找到要更新的数据") + return + } + re := that.Db.Update(that.RouterString[1], inData, Map{"id": that.RouterString[2]}) + + if re == 0 { + that.Display(4, "更新数据失败") + return + } + + that.Display(0, re) + }, + "remove": func(that *Context) { + re := that.Db.Delete(that.RouterString[1], Map{"id": that.RouterString[2]}) + + if re == 0 { + that.Display(4, "删除数据失败") + return + } + that.Display(0, re) + }, + "search": func(that *Context) { + + columnStr, leftJoin, where := that.MakeCode.Search(that.RouterString[1], that.Req, that.Db) + page := ObjToInt(that.Req.FormValue("page")) + pageSize := ObjToInt(that.Req.FormValue("pageSize")) + + if page < 1 { + page = 1 + } + + if pageSize <= 0 { + pageSize = 20 + } + + count := that.Db.Count(that.RouterString[1], leftJoin, where) + reData := that.Db.Page(page, pageSize). + PageSelect(that.RouterString[1], leftJoin, columnStr, where) + + for _, v := range reData { + for k, _ := range v { + column := that.MakeCode.TableColumns[that.RouterString[1]][k] + if column == nil { + continue + } + + if column["list"] != false && column["name"] == "parent_id" && column.GetString("link") != "" { + parentC := that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v.GetCeilInt(k)}) + v[column.GetString("link")+"_"+column.GetString("name")+"_"+column.GetString("value")] = "" + if parentC != nil { + v[column.GetString("link")+"_"+column.GetString("name")+"_"+column.GetString("value")] = parentC.GetString(column.GetString("value")) + } + } + + } + } + + that.Display(0, Map{"count": count, "data": reData}) + }, +} diff --git a/example/bzyy.exe b/example/bzyy.exe new file mode 100644 index 0000000..469ae05 Binary files /dev/null and b/example/bzyy.exe differ diff --git a/example/config/app.json b/example/config/app.json new file mode 100644 index 0000000..20ab320 --- /dev/null +++ b/example/config/app.json @@ -0,0 +1,1232 @@ +{ + "id": "3c5fc9732b8ddcb0a91b428976f2ce86", + "label": "HoTime管理平台", + "menus": [ + { + "icon": "el-icon-s-home", + "label": "平台首页", + "name": "HelloWorld" + }, + { + "icon": "el-icon-setting", + "label": "系统管理", + "menus": [ + { + "label": "人员管理", + "table": "admin" + }, + { + "label": "事项管理", + "table": "category" + }, + { + "label": "排号计划", + "table": "ctg_order_date" + }, + { + "label": "预约管理", + "table": "order" + }, + { + "label": "部门管理", + "table": "org" + }, + { + "label": "角色管理", + "table": "role" + }, + { + "label": "群众管理", + "table": "user" + } + ], + "name": "sys" + } + ], + "name": "admin", + "tables": { + "admin": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "名称", + "name": "name", + "type": "text" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "list": false, + "name": "modify_time", + "type": "time" + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + } + ], + "type": "select" + }, + { + "info": false, + "label": "密码", + "list": false, + "name": "password", + "type": "password" + }, + { + "label": "头像", + "list": false, + "name": "avatar_img", + "type": "image" + }, + { + "label": "管理分区", + "link": "category", + "name": "category_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "角色", + "link": "role", + "name": "role_id", + "sortable": true, + "type": "number", + "value": "name" + } + ], + "label": "人员管理", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, + { + "label": "管理分区", + "link": "category", + "name": "category_id", + "type": "tree", + "value": "name" + } + ], + "table": "admin" + }, + "category": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "名称", + "name": "name", + "type": "text" + }, + { + "label": "排序 序号越大越排前面", + "list": false, + "name": "sort", + "sortable": true, + "type": "number" + }, + { + "label": "专区id", + "link": "category", + "name": "parent_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "创建人员", + "link": "admin", + "name": "admin_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "list": false, + "name": "modify_time", + "sortable": true, + "type": "number" + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "周一上午", + "name": "am1", + "sortable": true, + "type": "number" + }, + { + "label": "周二上午", + "name": "am2", + "sortable": true, + "type": "number" + }, + { + "label": "周三上午", + "name": "am3", + "sortable": true, + "type": "number" + }, + { + "label": "周四上午", + "name": "am4", + "sortable": true, + "type": "number" + }, + { + "label": "周五上午", + "name": "am5", + "sortable": true, + "type": "number" + }, + { + "label": "周一下午", + "name": "pm1", + "sortable": true, + "type": "number" + }, + { + "label": "周二下午", + "name": "pm2", + "sortable": true, + "type": "number" + }, + { + "label": "周三下午", + "name": "pm3", + "sortable": true, + "type": "number" + }, + { + "label": "周四下午", + "name": "pm4", + "sortable": true, + "type": "number" + }, + { + "label": "周五下午", + "name": "pm5", + "sortable": true, + "type": "number" + }, + { + "label": "办理地址", + "list": false, + "name": "address", + "type": "text" + }, + { + "label": "叫号起始号", + "name": "startnum", + "sortable": true, + "type": "number" + }, + { + "label": "办理窗口", + "name": "window", + "type": "text" + }, + { + "label": "天府通办APP端", + "must": true, + "name": "tftbapp", + "options": [ + { + "name": "未启用", + "value": "0" + }, + { + "name": "已启用", + "value": "1" + } + ], + "sortable": true, + "type": "select" + }, + { + "label": "天府通办web端", + "must": true, + "name": "tftbweb", + "options": [ + { + "name": "未启用", + "value": "0" + }, + { + "name": "已启用", + "value": "1" + } + ], + "sortable": true, + "type": "select" + }, + { + "label": "图标", + "name": "icon", + "type": "text" + } + ], + "label": "事项管理", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "天府通办APP端", + "must": true, + "name": "tftbapp", + "options": [ + { + "name": "未启用", + "value": "0" + }, + { + "name": "已启用", + "value": "1" + }, + { + "name": "全部", + "value": null + } + ], + "sortable": true, + "type": "select", + "value": null + }, + { + "label": "天府通办web端", + "must": true, + "name": "tftbweb", + "options": [ + { + "name": "未启用", + "value": "0" + }, + { + "name": "已启用", + "value": "1" + }, + { + "name": "全部", + "value": null + } + ], + "sortable": true, + "type": "select", + "value": null + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, + { + "label": "专区id", + "link": "category", + "name": "parent_id", + "type": "tree", + "value": "name" + } + ], + "table": "category" + }, + "ctg_order_date": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "名称", + "name": "name", + "type": "text" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "name": "create_time", + "sortable": true, + "type": "number" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "list": false, + "name": "modify_time", + "sortable": true, + "type": "number" + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "预约日期", + "name": "date", + "type": "time" + }, + { + "label": "排号起始数", + "name": "start_sn", + "sortable": true, + "type": "number" + }, + { + "label": "排号结束号", + "name": "max_sn", + "sortable": true, + "type": "number" + }, + { + "label": "当前排号", + "name": "now_sn", + "sortable": true, + "type": "number" + }, + { + "label": "类别", + "link": "category", + "name": "category_id", + "sortable": true, + "type": "number", + "value": "name" + } + ], + "label": "排号计划", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, + { + "label": "类别", + "link": "category", + "name": "category_id", + "type": "tree", + "value": "name" + } + ], + "table": "ctg_order_date" + }, + "order": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "名称", + "name": "name", + "type": "text" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "list": false, + "name": "modify_time", + "sortable": true, + "type": "number" + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "预约用户", + "link": "user", + "name": "user_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "预约日期", + "name": "date", + "type": "time" + }, + { + "label": "排号", + "name": "sn", + "sortable": true, + "type": "number" + }, + { + "label": "预约分类", + "link": "category", + "name": "category_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "预约状态", + "must": true, + "name": "status", + "options": [ + { + "name": "待分配", + "value": "0" + }, + { + "name": "待办结", + "value": "1" + }, + { + "name": "已办结", + "value": "2" + }, + { + "name": "已逾期", + "value": "3" + }, + { + "name": "异常", + "value": "4" + } + ], + "type": "select" + }, + { + "label": "办事员", + "link": "admin", + "name": "admin_id", + "sortable": true, + "type": "number", + "value": "name" + } + ], + "label": "预约管理", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "预约状态", + "must": true, + "name": "status", + "options": [ + { + "name": "待分配", + "value": "0" + }, + { + "name": "待办结", + "value": "1" + }, + { + "name": "已办结", + "value": "2" + }, + { + "name": "已逾期", + "value": "3" + }, + { + "name": "异常", + "value": "4" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, + { + "label": "预约分类", + "link": "category", + "name": "category_id", + "type": "tree", + "value": "name" + } + ], + "table": "order" + }, + "org": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "编号", + "name": "sn", + "type": "text" + }, + { + "label": "组织名称", + "name": "name", + "type": "text" + }, + { + "label": "上级组织", + "link": "org", + "name": "parent_id", + "sortable": true, + "type": "number", + "value": "name" + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + } + ], + "type": "select" + }, + { + "add": false, + "edit": false, + "label": "注册时间", + "list": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "list": false, + "name": "modify_time", + "type": "time" + }, + { + "label": "创建用户", + "link": "admin", + "name": "admin_id", + "sortable": true, + "type": "number", + "value": "name" + } + ], + "label": "部门管理", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + }, + { + "label": "上级组织", + "link": "org", + "name": "parent_id", + "type": "tree", + "value": "name" + } + ], + "table": "org" + }, + "role": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "名称", + "name": "name", + "type": "text" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "list": false, + "name": "modify_time", + "sortable": true, + "type": "number" + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "规则", + "name": "rule", + "type": "text" + } + ], + "label": "角色管理", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "已启用", + "value": "0" + }, + { + "name": "未启用", + "value": "1" + }, + { + "name": "异常", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + } + ], + "table": "role" + }, + "user": { + "auth": [ + "add", + "delete", + "edit", + "info" + ], + "columns": [ + { + "add": false, + "edit": false, + "label": "ID", + "name": "id", + "sortable": true, + "type": "number" + }, + { + "label": "编号", + "name": "sn", + "type": "text" + }, + { + "label": "用户姓名", + "name": "name", + "type": "text" + }, + { + "label": "手机号码", + "name": "phone", + "type": "text" + }, + { + "label": "邮箱", + "list": false, + "name": "idcard", + "type": "text" + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "正常", + "value": "0" + }, + { + "name": "异常", + "value": "1" + }, + { + "name": "隐藏", + "value": "2" + } + ], + "type": "select" + }, + { + "label": "头像", + "name": "avatar", + "type": "text" + }, + { + "add": false, + "edit": false, + "label": "创建时间", + "list": false, + "name": "create_time", + "type": "time" + }, + { + "add": false, + "edit": false, + "label": "变更时间", + "list": false, + "name": "modify_time", + "sortable": true, + "type": "number" + } + ], + "label": "群众管理", + "search": [ + { + "label": "请输入关键词", + "name": "keyword", + "type": "search", + "value": null + }, + { + "label": "时间段", + "name": "daterange", + "type": "search", + "value": null + }, + { + "label": "排序", + "name": "sort", + "type": "search", + "value": null + }, + { + "label": "状态", + "list": false, + "must": true, + "name": "state", + "options": [ + { + "name": "正常", + "value": "0" + }, + { + "name": "异常", + "value": "1" + }, + { + "name": "隐藏", + "value": "2" + }, + { + "name": "全部", + "value": null + } + ], + "type": "select", + "value": null + } + ], + "table": "user" + } + } +} \ No newline at end of file