Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8337cdec0c | |||
| 46cecc47ea | |||
| 7535300107 | |||
| be41a70c76 | |||
| 5b407824a5 | |||
| 56f66fcaed | |||
| a298cb3d52 | |||
| 68f2c0fd8f |
+34
-7
@@ -68,18 +68,20 @@ func (that *Application) Run(router Router) {
|
|||||||
if that.Router == nil {
|
if that.Router == nil {
|
||||||
that.Router = Router{}
|
that.Router = Router{}
|
||||||
}
|
}
|
||||||
for k, v := range router {
|
for k, _ := range router {
|
||||||
|
v := router[k]
|
||||||
if that.Router[k] == nil {
|
if that.Router[k] == nil {
|
||||||
that.Router[k] = v
|
that.Router[k] = v
|
||||||
}
|
}
|
||||||
//直达接口层复用
|
//直达接口层复用
|
||||||
for k1, v1 := range v {
|
for k1, _ := range v {
|
||||||
|
v1 := v[k1]
|
||||||
if that.Router[k][k1] == nil {
|
if that.Router[k][k1] == nil {
|
||||||
that.Router[k][k1] = v1
|
that.Router[k][k1] = v1
|
||||||
}
|
}
|
||||||
|
|
||||||
for k2, v2 := range v1 {
|
for k2, _ := range v1 {
|
||||||
|
v2 := v1[k2]
|
||||||
that.Router[k][k1][k2] = v2
|
that.Router[k][k1][k2] = v2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -329,6 +331,9 @@ func (that *Application) handler(w http.ResponseWriter, req *http.Request) {
|
|||||||
if len(token) == 32 {
|
if len(token) == 32 {
|
||||||
sessionId = token
|
sessionId = token
|
||||||
//没有token,则查阅session
|
//没有token,则查阅session
|
||||||
|
if cookie == nil || cookie.Value != sessionId {
|
||||||
|
needSetCookie = sessionId
|
||||||
|
}
|
||||||
} else if err == nil && cookie.Value != "" {
|
} else if err == nil && cookie.Value != "" {
|
||||||
sessionId = cookie.Value
|
sessionId = cookie.Value
|
||||||
//session也没有则判断是否创建cookie
|
//session也没有则判断是否创建cookie
|
||||||
@@ -582,15 +587,27 @@ func Init(config string) *Application {
|
|||||||
|
|
||||||
//appIns.Router[codeMake.GetString("name")] = TptProject
|
//appIns.Router[codeMake.GetString("name")] = TptProject
|
||||||
appIns.Router[codeMake.GetString("name")] = Proj{}
|
appIns.Router[codeMake.GetString("name")] = Proj{}
|
||||||
|
|
||||||
for k2, _ := range TptProject {
|
for k2, _ := range TptProject {
|
||||||
appIns.Router[codeMake.GetString("name")][k2] = Ctr{}
|
if appIns.Router[codeMake.GetString("name")][k2] == nil {
|
||||||
for k3, v3 := range TptProject[k2] {
|
appIns.Router[codeMake.GetString("name")][k2] = Ctr{}
|
||||||
|
}
|
||||||
|
for k3, _ := range TptProject[k2] {
|
||||||
|
v3 := TptProject[k2][k3]
|
||||||
appIns.Router[codeMake.GetString("name")][k2][k3] = v3
|
appIns.Router[codeMake.GetString("name")][k2][k3] = v3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for k1, _ := range appIns.MakeCodeRouter[codeMake.GetString("name")].TableColumns {
|
for k1, _ := range appIns.MakeCodeRouter[codeMake.GetString("name")].TableColumns {
|
||||||
appIns.Router[codeMake.GetString("name")][k1] = appIns.Router[codeMake.GetString("name")]["hotimeCommon"]
|
if appIns.Router[codeMake.GetString("name")][k1] == nil {
|
||||||
|
appIns.Router[codeMake.GetString("name")][k1] = Ctr{}
|
||||||
|
}
|
||||||
|
|
||||||
|
for k2, _ := range appIns.Router[codeMake.GetString("name")]["hotimeCommon"] {
|
||||||
|
//golang毛病
|
||||||
|
v2 := appIns.Router[codeMake.GetString("name")]["hotimeCommon"][k2]
|
||||||
|
appIns.Router[codeMake.GetString("name")][k1][k2] = v2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setMakeCodeListener(codeMake.GetString("name"), &appIns)
|
setMakeCodeListener(codeMake.GetString("name"), &appIns)
|
||||||
@@ -728,6 +745,16 @@ func setMakeCodeListener(name string, appIns *Application) {
|
|||||||
context.Req.Method == "POST" {
|
context.Req.Method == "POST" {
|
||||||
return isFinished
|
return isFinished
|
||||||
}
|
}
|
||||||
|
//分析
|
||||||
|
if len(context.RouterString) == 3 && context.RouterString[2] == "analyse" &&
|
||||||
|
context.Req.Method == "GET" {
|
||||||
|
|
||||||
|
if context.Router[context.RouterString[0]][context.RouterString[1]]["analyse"] == nil {
|
||||||
|
return isFinished
|
||||||
|
}
|
||||||
|
|
||||||
|
context.Router[context.RouterString[0]][context.RouterString[1]]["analyse"](context)
|
||||||
|
}
|
||||||
//查询单条
|
//查询单条
|
||||||
if len(context.RouterString) == 3 &&
|
if len(context.RouterString) == 3 &&
|
||||||
context.Req.Method == "GET" {
|
context.Req.Method == "GET" {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@@ -22,16 +23,18 @@ var TptProject = Proj{
|
|||||||
tableName := that.RouterString[1]
|
tableName := that.RouterString[1]
|
||||||
|
|
||||||
data := that.Db.Get(fileConfig.GetString("table"), "*", Map{"id": that.Session(fileConfig.GetString("table") + "_id").ToCeilInt()})
|
data := that.Db.Get(fileConfig.GetString("table"), "*", Map{"id": that.Session(fileConfig.GetString("table") + "_id").ToCeilInt()})
|
||||||
str, inData := that.MakeCodeRouter[hotimeName].Info(tableName, data, that.Db)
|
//str, inData := that.MakeCodeRouter[hotimeName].Info(tableName, data, that.Db)
|
||||||
|
str, _ := that.MakeCodeRouter[hotimeName].Info(tableName, data, that.Db)
|
||||||
where := Map{"id": that.RouterString[2]}
|
where := Map{"id": that.RouterString[2]}
|
||||||
|
|
||||||
if len(inData) == 1 {
|
//权限控制,暂时取消
|
||||||
inData["id"] = where["id"]
|
//if len(inData) == 1 {
|
||||||
where = Map{"AND": inData}
|
// inData["id"] = where["id"]
|
||||||
} else if len(inData) > 1 {
|
// where = Map{"AND": inData}
|
||||||
where["OR"] = inData
|
//} else if len(inData) > 1 {
|
||||||
where = Map{"AND": where}
|
// where["OR"] = inData
|
||||||
}
|
// where = Map{"AND": where}
|
||||||
|
//}
|
||||||
|
|
||||||
re := that.Db.Get(tableName, str, where)
|
re := that.Db.Get(tableName, str, where)
|
||||||
|
|
||||||
@@ -684,6 +687,173 @@ var TptProject = Proj{
|
|||||||
|
|
||||||
that.Display(0, Map{"count": count, "data": reData})
|
that.Display(0, Map{"count": count, "data": reData})
|
||||||
},
|
},
|
||||||
|
"analyse": func(that *Context) {
|
||||||
|
hotimeName := that.RouterString[0]
|
||||||
|
//hotimeName := "super"
|
||||||
|
fileConfig := that.MakeCodeRouter[hotimeName].FileConfig
|
||||||
|
tableName := that.RouterString[1]
|
||||||
|
data := that.Db.Get(fileConfig.GetString("table"), "*", Map{"id": that.Session(fileConfig.GetString("table") + "_id").ToCeilInt()})
|
||||||
|
where := Map{}
|
||||||
|
|
||||||
|
//树状结构不允许修改自身的属性,修改别人的可以
|
||||||
|
btes, err := ioutil.ReadFile(fileConfig.GetString("config"))
|
||||||
|
if err != nil {
|
||||||
|
that.Display(4, "找不到权限配置文件")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
conf := ObjToMap(string(btes))
|
||||||
|
//相同则
|
||||||
|
//if tableName!=fileConfig.GetString("table"){
|
||||||
|
|
||||||
|
flow := conf.GetMap("flow").GetMap(tableName)
|
||||||
|
if flow != nil && flow.GetMap("sql") != nil {
|
||||||
|
sql := ObjToMap(DeepCopyMap(flow.GetMap("sql")))
|
||||||
|
for k, _ := range sql {
|
||||||
|
//for uk,_:=range data{
|
||||||
|
// if sql[uk]==nil{
|
||||||
|
// continue
|
||||||
|
// }
|
||||||
|
// uv:=data.GetString(uk)
|
||||||
|
//
|
||||||
|
// tv:=strings.Replace(sql.GetString(uk),uk,uv,-1)
|
||||||
|
// if tv!=uv{
|
||||||
|
// where[k]=tv
|
||||||
|
// break
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
if k == "parent_ids[~]" && tableName == fileConfig.GetString("table") {
|
||||||
|
where[k] = strings.Replace(sql.GetString(k), "id", data.GetString("id"), -1)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if k == "parent_ids[~]" && data[tableName+"_id"] != nil {
|
||||||
|
where[k] = strings.Replace(sql.GetString(k), tableName+"_id", data.GetString(tableName+"_id"), -1)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if data[sql.GetString(k)] != nil {
|
||||||
|
where[k] = data[sql.GetString(k)]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//}
|
||||||
|
|
||||||
|
_, where = that.MakeCodeRouter[hotimeName].Search(tableName, data, where, that.Req, that.Db)
|
||||||
|
delete(where, "ORDER")
|
||||||
|
//page := ObjToInt(that.Req.FormValue("page"))
|
||||||
|
//pageSize := ObjToInt(that.Req.FormValue("pageSize"))
|
||||||
|
|
||||||
|
//download := ObjToInt(that.Req.FormValue("download"))
|
||||||
|
//
|
||||||
|
//if page < 1 {
|
||||||
|
// page = 1
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//if pageSize <= 0 {
|
||||||
|
// pageSize = 20
|
||||||
|
//}
|
||||||
|
redData := Map{}
|
||||||
|
|
||||||
|
data["count"] = that.Db.Count(tableName, where)
|
||||||
|
testQu := []string{}
|
||||||
|
testQuData := that.MakeCodeRouter[hotimeName].TableColumns[tableName]
|
||||||
|
for key, _ := range testQuData {
|
||||||
|
//fmt.Println(key, ":", value)
|
||||||
|
testQu = append(testQu, key)
|
||||||
|
}
|
||||||
|
sort.Strings(testQu)
|
||||||
|
for _, k := range testQu {
|
||||||
|
v := testQuData[k]
|
||||||
|
//不可使用,未在前端展示,但在内存中保持有
|
||||||
|
if v.GetBool("notUse") {
|
||||||
|
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.Contains(k, "state") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if strings.Contains(k, "scope") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if strings.Contains(k, "_code") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
//检索查询
|
||||||
|
if v.GetString("type") == "select" {
|
||||||
|
|
||||||
|
ops := v.GetSlice("options")
|
||||||
|
for k1, _ := range ops {
|
||||||
|
v1 := ops.GetMap(k1)
|
||||||
|
where1 := DeepCopyMap(where).(Map)
|
||||||
|
if where1["AND"] != nil {
|
||||||
|
and := where1.GetMap("AND")
|
||||||
|
and[k] = v1.GetString("value")
|
||||||
|
} else {
|
||||||
|
where1[k] = v1.GetString("value")
|
||||||
|
where1 = Map{"AND": where1}
|
||||||
|
}
|
||||||
|
v1["count"] = that.Db.Count(tableName, where1)
|
||||||
|
ops[k1] = v1
|
||||||
|
}
|
||||||
|
redData[k] = ops
|
||||||
|
}
|
||||||
|
|
||||||
|
//检索查询
|
||||||
|
if v.GetString("type") == "number" {
|
||||||
|
|
||||||
|
if strings.Contains(k, "area_id") {
|
||||||
|
areas := that.Db.Select("area", "id,name", Map{"parent_id": 533301})
|
||||||
|
for ak, av := range areas {
|
||||||
|
where1 := DeepCopyMap(where).(Map)
|
||||||
|
if where1["AND"] != nil {
|
||||||
|
and := where1.GetMap("AND")
|
||||||
|
and["area_id"] = av.GetCeilInt64("id")
|
||||||
|
} else {
|
||||||
|
where1["area_id"] = av.GetCeilInt64("id")
|
||||||
|
where1 = Map{"AND": where1}
|
||||||
|
}
|
||||||
|
av["count"] = that.Db.Count(tableName, where1)
|
||||||
|
areas[ak] = av
|
||||||
|
}
|
||||||
|
|
||||||
|
redData["area"] = areas
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.Contains(k, "_id") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if k == "id" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if strings.Contains(k, "percent") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if strings.Contains(k, "exp_") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if strings.Contains(k, "side") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if strings.Contains(k, "lat") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if strings.Contains(k, "lng") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if strings.Contains(k, "distance") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
where1 := DeepCopyMap(where).(Map)
|
||||||
|
redData[k] = that.Db.Sum(tableName, k, where1)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
that.Display(0, redData)
|
||||||
|
|
||||||
|
},
|
||||||
},
|
},
|
||||||
"hotime": Ctr{
|
"hotime": Ctr{
|
||||||
"file": func(that *Context) {
|
"file": func(that *Context) {
|
||||||
@@ -875,11 +1045,12 @@ var TptProject = Proj{
|
|||||||
}
|
}
|
||||||
|
|
||||||
linkAuthMap := that.Db.Get(v.GetString("link"), "auth", Map{"id": user.GetCeilInt(v.GetString("name"))})
|
linkAuthMap := that.Db.Get(v.GetString("link"), "auth", Map{"id": user.GetCeilInt(v.GetString("name"))})
|
||||||
linkAuth := linkAuthMap.GetMap("auth")
|
oldLinkAuth := linkAuthMap.GetMap("auth")
|
||||||
|
linkAuth := Map{}
|
||||||
//conf := ObjToMap(string(btes))
|
//conf := ObjToMap(string(btes))
|
||||||
//menus := conf.GetSlice("menus")
|
//menus := conf.GetSlice("menus")
|
||||||
if linkAuth == nil {
|
if oldLinkAuth != nil {
|
||||||
linkAuth = Map{}
|
linkAuth = oldLinkAuth
|
||||||
}
|
}
|
||||||
|
|
||||||
for k1, _ := range menus {
|
for k1, _ := range menus {
|
||||||
@@ -890,7 +1061,7 @@ var TptProject = Proj{
|
|||||||
}
|
}
|
||||||
if v1["auth"] != nil {
|
if v1["auth"] != nil {
|
||||||
|
|
||||||
if linkAuth[name] == nil {
|
if oldLinkAuth == nil {
|
||||||
linkAuth[name] = v1["auth"]
|
linkAuth[name] = v1["auth"]
|
||||||
} else {
|
} else {
|
||||||
newAuth := Slice{}
|
newAuth := Slice{}
|
||||||
@@ -913,7 +1084,7 @@ var TptProject = Proj{
|
|||||||
}
|
}
|
||||||
if v2["auth"] != nil {
|
if v2["auth"] != nil {
|
||||||
|
|
||||||
if linkAuth[name] == nil {
|
if oldLinkAuth == nil {
|
||||||
linkAuth[name] = v2["auth"]
|
linkAuth[name] = v2["auth"]
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -935,32 +1106,36 @@ var TptProject = Proj{
|
|||||||
|
|
||||||
for k1, _ := range menus {
|
for k1, _ := range menus {
|
||||||
v1 := menus.GetMap(k1)
|
v1 := menus.GetMap(k1)
|
||||||
//保证个人权限可用
|
|
||||||
if fileConfig.GetString("table") == v1.GetString("table") {
|
|
||||||
v1["auth"] = Slice{"info", "edit"}
|
|
||||||
}
|
|
||||||
name := v1.GetString("name")
|
name := v1.GetString("name")
|
||||||
if name == "" {
|
if name == "" {
|
||||||
name = v1.GetString("table")
|
name = v1.GetString("table")
|
||||||
}
|
}
|
||||||
|
|
||||||
if linkAuth[name] != nil {
|
if len(linkAuth.GetSlice(name)) != 0 {
|
||||||
|
v1["auth"] = linkAuth[name]
|
||||||
|
} else
|
||||||
|
//保证个人权限可用
|
||||||
|
if fileConfig.GetString("table") == v1.GetString("table") {
|
||||||
|
v1["auth"] = Slice{"info", "edit"}
|
||||||
|
} else {
|
||||||
v1["auth"] = linkAuth[name]
|
v1["auth"] = linkAuth[name]
|
||||||
}
|
}
|
||||||
|
|
||||||
v1menus := v1.GetSlice("menus")
|
v1menus := v1.GetSlice("menus")
|
||||||
for k2, _ := range v1menus {
|
for k2, _ := range v1menus {
|
||||||
v2 := v1menus.GetMap(k2)
|
v2 := v1menus.GetMap(k2)
|
||||||
//保证个人权限可用
|
//保证个人权限可用
|
||||||
if fileConfig.GetString("table") == v2.GetString("table") {
|
|
||||||
v2["auth"] = Slice{"info", "edit"}
|
|
||||||
|
|
||||||
}
|
|
||||||
name := v2.GetString("name")
|
name := v2.GetString("name")
|
||||||
if name == "" {
|
if name == "" {
|
||||||
name = v2.GetString("table")
|
name = v2.GetString("table")
|
||||||
}
|
}
|
||||||
if linkAuth[name] != nil {
|
if len(linkAuth.GetSlice(name)) != 0 {
|
||||||
|
v2["auth"] = linkAuth[name]
|
||||||
|
} else if fileConfig.GetString("table") == v2.GetString("table") {
|
||||||
|
v2["auth"] = Slice{"info", "edit"}
|
||||||
|
|
||||||
|
} else {
|
||||||
v2["auth"] = linkAuth[name]
|
v2["auth"] = linkAuth[name]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+16
-10
@@ -175,8 +175,9 @@ func (that *MakeCode) Db2JSON(db *db.HoTimeDB, config Map) {
|
|||||||
if coloum == nil {
|
if coloum == nil {
|
||||||
//根据类型判断真实类型
|
//根据类型判断真实类型
|
||||||
for k, v1 := range ColumnDataType {
|
for k, v1 := range ColumnDataType {
|
||||||
if strings.Contains(info.GetString("name"), k) || strings.Contains(info.GetString("type"), k) {
|
if strings.Contains(info.GetString("type"), k) {
|
||||||
info["type"] = v1
|
info["type"] = v1
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -539,7 +540,7 @@ func (that *MakeCode) Db2JSON(db *db.HoTimeDB, config Map) {
|
|||||||
}
|
}
|
||||||
sql := flow.GetMap(fk).GetMap("sql")
|
sql := flow.GetMap(fk).GetMap("sql")
|
||||||
if k == "parent_id" {
|
if k == "parent_id" {
|
||||||
sql["parent_ids[~]"] = "%," + av.GetString("name") + ",%"
|
sql["parent_ids[~]"] = "," + av.GetString("name") + ","
|
||||||
} else {
|
} else {
|
||||||
sql[k] = k
|
sql[k] = k
|
||||||
}
|
}
|
||||||
@@ -580,7 +581,7 @@ func (that *MakeCode) Db2JSON(db *db.HoTimeDB, config Map) {
|
|||||||
flow[fk] = Map{"table": fk, "stop": false, "sql": Map{}}
|
flow[fk] = Map{"table": fk, "stop": false, "sql": Map{}}
|
||||||
}
|
}
|
||||||
sql := flow.GetMap(fk).GetMap("sql")
|
sql := flow.GetMap(fk).GetMap("sql")
|
||||||
sql["parent_ids[~]"] = "%,id,%"
|
sql["parent_ids[~]"] = ",id,"
|
||||||
flow.GetMap(fk)["sql"] = sql
|
flow.GetMap(fk)["sql"] = sql
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1048,15 +1049,18 @@ func (that *MakeCode) Search(table string, userData Map, data Map, req *http.Req
|
|||||||
if len(reqValue) == 0 || reqValue[0] == "" {
|
if len(reqValue) == 0 || reqValue[0] == "" {
|
||||||
|
|
||||||
if parent_idsStr != "" && userData[searchItem.GetString("name")] != nil {
|
if parent_idsStr != "" && userData[searchItem.GetString("name")] != nil {
|
||||||
|
|
||||||
|
if data[searchItemName] == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
where := Map{parent_idsStr: "," + ObjToStr(userData.GetCeilInt64(searchItem.GetString("name"))) + ","}
|
where := Map{parent_idsStr: "," + ObjToStr(userData.GetCeilInt64(searchItem.GetString("name"))) + ","}
|
||||||
r := db.Select(searchItem.GetString("link"), "id", where)
|
r := db.Select(searchItem.GetString("link"), "id", where)
|
||||||
reqValue = []string{}
|
reqValue = []string{}
|
||||||
for _, v := range r {
|
for _, v := range r {
|
||||||
reqValue = append(reqValue, v.GetString("id"))
|
reqValue = append(reqValue, v.GetString("id"))
|
||||||
}
|
}
|
||||||
if data[searchItemName] != nil {
|
|
||||||
data[searchItemName] = reqValue
|
data[searchItemName] = reqValue
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1112,11 +1116,13 @@ func (that *MakeCode) Search(table string, userData Map, data Map, req *http.Req
|
|||||||
if keywordTableStr == v.GetString("value") {
|
if keywordTableStr == v.GetString("value") {
|
||||||
childs := db.Select(v.GetString("link"), "id", Map{v.GetString("value") + "[~]": keywordStr})
|
childs := db.Select(v.GetString("link"), "id", Map{v.GetString("value") + "[~]": keywordStr})
|
||||||
childIds := Slice{}
|
childIds := Slice{}
|
||||||
|
|
||||||
for _, cv := range childs {
|
for _, cv := range childs {
|
||||||
childIds = append(childIds, cv.GetString("id"))
|
|
||||||
|
childIds = append(childIds, cv.GetCeilInt64("id"))
|
||||||
}
|
}
|
||||||
if len(childIds) != 0 {
|
if len(childIds) != 0 {
|
||||||
data[v.GetString("link")+".id"] = childIds
|
data[v.GetString("name")] = childIds
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
@@ -1134,10 +1140,10 @@ func (that *MakeCode) Search(table string, userData Map, data Map, req *http.Req
|
|||||||
childs := db.Select(v.GetString("link"), "id", Map{v.GetString("value") + "[~]": keywordStr})
|
childs := db.Select(v.GetString("link"), "id", Map{v.GetString("value") + "[~]": keywordStr})
|
||||||
childIds := Slice{}
|
childIds := Slice{}
|
||||||
for _, cv := range childs {
|
for _, cv := range childs {
|
||||||
childIds = append(childIds, cv.GetString("id"))
|
childIds = append(childIds, cv.GetCeilInt64("id"))
|
||||||
}
|
}
|
||||||
if len(childIds) != 0 {
|
if len(childIds) != 0 {
|
||||||
keyword[v.GetString("link")+".id"] = childIds
|
keyword[v.GetString("name")] = childIds
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+17
-1
@@ -5,6 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"math"
|
"math"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -103,7 +104,22 @@ func ObjToTime(obj interface{}, e ...*Error) time.Time {
|
|||||||
//字符串类型,只支持标准mysql datetime格式
|
//字符串类型,只支持标准mysql datetime格式
|
||||||
if tInt == 0 {
|
if tInt == 0 {
|
||||||
tStr := ObjToStr(obj)
|
tStr := ObjToStr(obj)
|
||||||
|
timeNewStr := ""
|
||||||
|
timeNewStrs := strings.Split(tStr, "-")
|
||||||
|
for _, v := range timeNewStrs {
|
||||||
|
if v == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if len(v) == 1 {
|
||||||
|
v = "0" + v
|
||||||
|
}
|
||||||
|
if timeNewStr == "" {
|
||||||
|
timeNewStr = v
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
timeNewStr = timeNewStr + "-" + v
|
||||||
|
}
|
||||||
|
tStr = timeNewStr
|
||||||
if len(tStr) > 18 {
|
if len(tStr) > 18 {
|
||||||
t, e := time.Parse("2006-01-02 15:04:05", tStr)
|
t, e := time.Parse("2006-01-02 15:04:05", tStr)
|
||||||
if e == nil {
|
if e == nil {
|
||||||
|
|||||||
+223
-9
@@ -702,7 +702,7 @@ func (that *HoTimeDB) Select(table string, qu ...interface{}) []Map {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if reflect.ValueOf(qu[0]).Type().String() == "common.Slice" {
|
if reflect.ValueOf(qu[0]).Type().String() == "common.Slice" || strings.Contains(reflect.ValueOf(qu[0]).Type().String(), "[]") {
|
||||||
qu0 := ObjToSlice(qu[0])
|
qu0 := ObjToSlice(qu[0])
|
||||||
for key, _ := range qu0 {
|
for key, _ := range qu0 {
|
||||||
v := qu0.GetMap(key)
|
v := qu0.GetMap(key)
|
||||||
@@ -849,6 +849,31 @@ func (that *HoTimeDB) Count(table string, qu ...interface{}) int {
|
|||||||
var condition = []string{"AND", "OR"}
|
var condition = []string{"AND", "OR"}
|
||||||
var vcond = []string{"GROUP", "ORDER", "LIMIT"}
|
var vcond = []string{"GROUP", "ORDER", "LIMIT"}
|
||||||
|
|
||||||
|
// Count 计数
|
||||||
|
func (that *HoTimeDB) Sum(table string, column string, qu ...interface{}) float64 {
|
||||||
|
var req = []interface{}{}
|
||||||
|
if len(qu) == 2 {
|
||||||
|
req = append(req, qu[0])
|
||||||
|
req = append(req, "SUM("+column+")")
|
||||||
|
req = append(req, qu[1])
|
||||||
|
} else {
|
||||||
|
req = append(req, "SUM("+column+")")
|
||||||
|
req = append(req, qu...)
|
||||||
|
}
|
||||||
|
|
||||||
|
//req=append(req,qu...)
|
||||||
|
data := that.Select(table, req...)
|
||||||
|
//fmt.Println(data)
|
||||||
|
if len(data) == 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
//res,_:=StrToInt(data[0]["COUNT(*)"].(string))
|
||||||
|
res := ObjToStr(data[0]["SUM("+column+")"])
|
||||||
|
count := ObjToFloat64(res)
|
||||||
|
return count
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//where语句解析
|
//where语句解析
|
||||||
func (that *HoTimeDB) where(data Map) (string, []interface{}) {
|
func (that *HoTimeDB) where(data Map) (string, []interface{}) {
|
||||||
|
|
||||||
@@ -942,11 +967,12 @@ func (that *HoTimeDB) where(data Map) (string, []interface{}) {
|
|||||||
where += k
|
where += k
|
||||||
}
|
}
|
||||||
|
|
||||||
if reflect.ValueOf(v).Type().String() == "common.Slice" {
|
if reflect.ValueOf(v).Type().String() == "common.Slice" || strings.Contains(reflect.ValueOf(v).Type().String(), "[]") {
|
||||||
for i := 0; i < len(v.(Slice)); i++ {
|
vs := ObjToSlice(v)
|
||||||
where += " " + ObjToStr(v.(Slice)[i]) + " "
|
for i := 0; i < len(vs); i++ {
|
||||||
|
where += " " + vs.GetString(i) + " "
|
||||||
|
|
||||||
if len(v.(Slice)) != i+1 {
|
if len(vs) != i+1 {
|
||||||
where += ", "
|
where += ", "
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1078,16 +1104,18 @@ func (that *HoTimeDB) varCond(k string, v interface{}) (string, []interface{}) {
|
|||||||
k = "`" + k + "` "
|
k = "`" + k + "` "
|
||||||
}
|
}
|
||||||
where += k + " NOT BETWEEN ? AND ? "
|
where += k + " NOT BETWEEN ? AND ? "
|
||||||
res = append(res, v.(Slice)[0])
|
vs := ObjToSlice(v)
|
||||||
res = append(res, v.(Slice)[1])
|
res = append(res, vs[0])
|
||||||
|
res = append(res, vs[1])
|
||||||
case "[<>]":
|
case "[<>]":
|
||||||
k = strings.Replace(k, "[<>]", "", -1)
|
k = strings.Replace(k, "[<>]", "", -1)
|
||||||
if !strings.Contains(k, ".") {
|
if !strings.Contains(k, ".") {
|
||||||
k = "`" + k + "` "
|
k = "`" + k + "` "
|
||||||
}
|
}
|
||||||
where += k + " BETWEEN ? AND ? "
|
where += k + " BETWEEN ? AND ? "
|
||||||
res = append(res, v.(Slice)[0])
|
vs := ObjToSlice(v)
|
||||||
res = append(res, v.(Slice)[1])
|
res = append(res, vs[0])
|
||||||
|
res = append(res, vs[1])
|
||||||
default:
|
default:
|
||||||
if !strings.Contains(k, ".") {
|
if !strings.Contains(k, ".") {
|
||||||
k = "`" + k + "` "
|
k = "`" + k + "` "
|
||||||
@@ -1098,6 +1126,98 @@ func (that *HoTimeDB) varCond(k string, v interface{}) (string, []interface{}) {
|
|||||||
return where, res
|
return where, res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(vs) == 1 {
|
||||||
|
where += k + "=? "
|
||||||
|
res = append(res, vs[0])
|
||||||
|
return where, res
|
||||||
|
}
|
||||||
|
|
||||||
|
min := int64(0)
|
||||||
|
isMin := true
|
||||||
|
IsRange := true
|
||||||
|
num := int64(0)
|
||||||
|
isNum := true
|
||||||
|
|
||||||
|
where1 := ""
|
||||||
|
res1 := Slice{}
|
||||||
|
where2 := k + " IN ("
|
||||||
|
res2 := Slice{}
|
||||||
|
for kvs := 0; kvs <= len(vs); kvs++ {
|
||||||
|
vsv := int64(0)
|
||||||
|
if kvs < len(vs) {
|
||||||
|
vsv = vs.GetCeilInt64(kvs)
|
||||||
|
//确保是全部是int类型
|
||||||
|
if ObjToStr(vsv) != vs.GetString(kvs) {
|
||||||
|
IsRange = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if isNum {
|
||||||
|
isNum = false
|
||||||
|
num = vsv
|
||||||
|
} else {
|
||||||
|
num++
|
||||||
|
}
|
||||||
|
if isMin {
|
||||||
|
isMin = false
|
||||||
|
min = vsv
|
||||||
|
}
|
||||||
|
//不等于则到了分路口
|
||||||
|
if num != vsv {
|
||||||
|
//between
|
||||||
|
if num-min > 1 {
|
||||||
|
if where1 != "" {
|
||||||
|
where1 += " OR " + k + " BETWEEN ? AND ? "
|
||||||
|
} else {
|
||||||
|
where1 += k + " BETWEEN ? AND ? "
|
||||||
|
}
|
||||||
|
res1 = append(res1, min)
|
||||||
|
res1 = append(res1, num-1)
|
||||||
|
} else {
|
||||||
|
//如果就前进一步就用OR
|
||||||
|
where2 += "?,"
|
||||||
|
res2 = append(res2, min)
|
||||||
|
}
|
||||||
|
min = vsv
|
||||||
|
num = vsv
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if IsRange {
|
||||||
|
|
||||||
|
where3 := ""
|
||||||
|
|
||||||
|
if where1 != "" {
|
||||||
|
where3 += where1
|
||||||
|
res = append(res, res1...)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res2) == 1 {
|
||||||
|
if where3 == "" {
|
||||||
|
where3 += k + " = ? "
|
||||||
|
} else {
|
||||||
|
where3 += " OR " + k + " = ? "
|
||||||
|
}
|
||||||
|
res = append(res, res2...)
|
||||||
|
} else if len(res2) > 1 {
|
||||||
|
where2 = where2[:len(where2)-1]
|
||||||
|
if where3 == "" {
|
||||||
|
where3 += where2 + ")"
|
||||||
|
} else {
|
||||||
|
where3 += " OR " + where2 + ")"
|
||||||
|
}
|
||||||
|
res = append(res, res2...)
|
||||||
|
}
|
||||||
|
|
||||||
|
if where3 != "" {
|
||||||
|
where += "(" + where3 + ")"
|
||||||
|
}
|
||||||
|
|
||||||
|
return where, res
|
||||||
|
}
|
||||||
|
|
||||||
where += k + " IN ("
|
where += k + " IN ("
|
||||||
res = append(res, vs...)
|
res = append(res, vs...)
|
||||||
|
|
||||||
@@ -1131,6 +1251,100 @@ func (that *HoTimeDB) varCond(k string, v interface{}) (string, []interface{}) {
|
|||||||
if len(vs) == 0 {
|
if len(vs) == 0 {
|
||||||
return where, res
|
return where, res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(vs) == 1 {
|
||||||
|
where += k + "=? "
|
||||||
|
res = append(res, vs[0])
|
||||||
|
return where, res
|
||||||
|
}
|
||||||
|
|
||||||
|
//In转betwin和IN,提升部分性能
|
||||||
|
min := int64(0)
|
||||||
|
isMin := true
|
||||||
|
IsRange := true
|
||||||
|
num := int64(0)
|
||||||
|
isNum := true
|
||||||
|
|
||||||
|
where1 := ""
|
||||||
|
res1 := Slice{}
|
||||||
|
where2 := k + " IN ("
|
||||||
|
res2 := Slice{}
|
||||||
|
for kvs := 0; kvs <= len(vs); kvs++ {
|
||||||
|
vsv := int64(0)
|
||||||
|
if kvs < len(vs) {
|
||||||
|
vsv = vs.GetCeilInt64(kvs)
|
||||||
|
//确保是全部是int类型
|
||||||
|
if ObjToStr(vsv) != vs.GetString(kvs) {
|
||||||
|
IsRange = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if isNum {
|
||||||
|
isNum = false
|
||||||
|
num = vsv
|
||||||
|
} else {
|
||||||
|
num++
|
||||||
|
}
|
||||||
|
if isMin {
|
||||||
|
isMin = false
|
||||||
|
min = vsv
|
||||||
|
}
|
||||||
|
//不等于则到了分路口
|
||||||
|
if num != vsv {
|
||||||
|
//between
|
||||||
|
if num-min > 1 {
|
||||||
|
if where1 != "" {
|
||||||
|
where1 += " OR " + k + " BETWEEN ? AND ? "
|
||||||
|
} else {
|
||||||
|
where1 += k + " BETWEEN ? AND ? "
|
||||||
|
}
|
||||||
|
res1 = append(res1, min)
|
||||||
|
res1 = append(res1, num-1)
|
||||||
|
} else {
|
||||||
|
//如果就前进一步就用OR
|
||||||
|
where2 += "?,"
|
||||||
|
res2 = append(res2, min)
|
||||||
|
}
|
||||||
|
min = vsv
|
||||||
|
num = vsv
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if IsRange {
|
||||||
|
|
||||||
|
where3 := ""
|
||||||
|
|
||||||
|
if where1 != "" {
|
||||||
|
where3 += where1
|
||||||
|
res = append(res, res1...)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(res2) == 1 {
|
||||||
|
if where3 == "" {
|
||||||
|
where3 += k + " = ? "
|
||||||
|
} else {
|
||||||
|
where3 += " OR " + k + " = ? "
|
||||||
|
}
|
||||||
|
res = append(res, res2...)
|
||||||
|
} else if len(res2) > 1 {
|
||||||
|
where2 = where2[:len(where2)-1]
|
||||||
|
if where3 == "" {
|
||||||
|
where3 += where2 + ")"
|
||||||
|
} else {
|
||||||
|
where3 += " OR " + where2 + ")"
|
||||||
|
}
|
||||||
|
res = append(res, res2...)
|
||||||
|
}
|
||||||
|
|
||||||
|
if where3 != "" {
|
||||||
|
where += "(" + where3 + ")"
|
||||||
|
}
|
||||||
|
|
||||||
|
return where, res
|
||||||
|
}
|
||||||
|
|
||||||
where += k + " IN ("
|
where += k + " IN ("
|
||||||
res = append(res, vs...)
|
res = append(res, vs...)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,472 @@
|
|||||||
|
{
|
||||||
|
"flow": {
|
||||||
|
"admin": {
|
||||||
|
"sql": {
|
||||||
|
"role_id": "role_id"
|
||||||
|
},
|
||||||
|
"stop": false,
|
||||||
|
"table": "admin"
|
||||||
|
},
|
||||||
|
"article": {
|
||||||
|
"sql": {
|
||||||
|
"admin_id": "id"
|
||||||
|
},
|
||||||
|
"stop": false,
|
||||||
|
"table": "article"
|
||||||
|
},
|
||||||
|
"ctg": {
|
||||||
|
"sql": {
|
||||||
|
"admin_id": "id"
|
||||||
|
},
|
||||||
|
"stop": false,
|
||||||
|
"table": "ctg"
|
||||||
|
},
|
||||||
|
"ctg_article": {
|
||||||
|
"sql": {
|
||||||
|
"admin_id": "id"
|
||||||
|
},
|
||||||
|
"stop": false,
|
||||||
|
"table": "ctg_article"
|
||||||
|
},
|
||||||
|
"ctg_copy": {
|
||||||
|
"sql": {
|
||||||
|
"admin_id": "id"
|
||||||
|
},
|
||||||
|
"stop": false,
|
||||||
|
"table": "ctg_copy"
|
||||||
|
},
|
||||||
|
"logs": {
|
||||||
|
"sql": {
|
||||||
|
|
||||||
|
},
|
||||||
|
"stop": false,
|
||||||
|
"table": "logs"
|
||||||
|
},
|
||||||
|
"org": {
|
||||||
|
"sql": {
|
||||||
|
"admin_id": "id"
|
||||||
|
},
|
||||||
|
"stop": false,
|
||||||
|
"table": "org"
|
||||||
|
},
|
||||||
|
"role": {
|
||||||
|
"sql": {
|
||||||
|
"admin_id": "id",
|
||||||
|
"id": "role_id"
|
||||||
|
},
|
||||||
|
"stop": true,
|
||||||
|
"table": "role"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": "74a8a59407fa7d6c7fcdc85742dbae57",
|
||||||
|
"label": "HoTime管理平台",
|
||||||
|
"labelConfig": {
|
||||||
|
"add": "添加",
|
||||||
|
"delete": "删除",
|
||||||
|
"download": "下载清单",
|
||||||
|
"edit": "编辑",
|
||||||
|
"info": "查看详情",
|
||||||
|
"show": "开启"
|
||||||
|
},
|
||||||
|
"menus": [
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show"
|
||||||
|
],
|
||||||
|
"icon": "Setting",
|
||||||
|
"label": "ebw_news",
|
||||||
|
"menus": [
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "ebw_news",
|
||||||
|
"table": "ebw_news"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "ebw_news_addition_res",
|
||||||
|
"table": "ebw_news_addition_res"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "ebw_annex",
|
||||||
|
"table": "ebw_annex"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "ebw_customer",
|
||||||
|
"table": "ebw_customer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "ebw_items",
|
||||||
|
"table": "ebw_items"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "ebw_res",
|
||||||
|
"table": "ebw_res"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "ebw_vote",
|
||||||
|
"table": "ebw_vote"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "ebw_vote_option",
|
||||||
|
"table": "ebw_vote_option"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "ebw_user",
|
||||||
|
"table": "ebw_user"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "ebw_attachment",
|
||||||
|
"table": "ebw_attachment"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "ebw_jobs",
|
||||||
|
"table": "ebw_jobs"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "ebw_vote_user",
|
||||||
|
"table": "ebw_vote_user"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "sys:ebw"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show"
|
||||||
|
],
|
||||||
|
"icon": "Setting",
|
||||||
|
"label": "系统管理",
|
||||||
|
"menus": [
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "日志管理",
|
||||||
|
"table": "logs"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "角色管理",
|
||||||
|
"table": "role"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "组织管理",
|
||||||
|
"table": "org"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "人员管理",
|
||||||
|
"table": "admin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "文章管理",
|
||||||
|
"table": "article"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "sys"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show"
|
||||||
|
],
|
||||||
|
"icon": "Setting",
|
||||||
|
"label": "外部系统",
|
||||||
|
"menus": [
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "外部系统",
|
||||||
|
"table": "swiper_sys"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "顶部",
|
||||||
|
"table": "swiper_top"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "飘窗",
|
||||||
|
"table": "swiper_fly"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "底部",
|
||||||
|
"table": "swiper_bottom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "中间",
|
||||||
|
"table": "swiper_center"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "关联专题",
|
||||||
|
"table": "swiper_point"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "sys:swiper"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show"
|
||||||
|
],
|
||||||
|
"icon": "Setting",
|
||||||
|
"label": "栏目管理",
|
||||||
|
"menus": [
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "栏目管理",
|
||||||
|
"table": "ctg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "关联栏目",
|
||||||
|
"table": "ctg_article"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "栏目管理",
|
||||||
|
"table": "ctg_copy"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "sys:ctg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show"
|
||||||
|
],
|
||||||
|
"icon": "Setting",
|
||||||
|
"label": "纪委信箱",
|
||||||
|
"menus": [
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "纪委信箱",
|
||||||
|
"table": "mail_discipline"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "总经理信箱",
|
||||||
|
"table": "mail"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"auth": [
|
||||||
|
"show",
|
||||||
|
"add",
|
||||||
|
"delete",
|
||||||
|
"edit",
|
||||||
|
"info",
|
||||||
|
"download"
|
||||||
|
],
|
||||||
|
"label": "党委书记信箱",
|
||||||
|
"table": "mail_part"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "sys:mail"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "admin",
|
||||||
|
"stop": [
|
||||||
|
"role",
|
||||||
|
"org"
|
||||||
|
]
|
||||||
|
}
|
||||||
+337
-337
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user