权限模块开发

This commit is contained in:
hoteas 2022-01-12 17:33:20 +08:00
parent 48fd753a96
commit 7e2abb43e3
4 changed files with 18 additions and 3288 deletions

11
code.go
View File

@ -208,7 +208,16 @@ var TptProject = Proj{
continue continue
} }
if (column["list"] == nil || column.GetBool("list")) && column.GetString("link") != "" { if (column["list"] == nil || column.GetBool("list")) && column.GetString("link") != "" {
re[column.GetString("link")] = that.Db.Get(column.GetString("link"), "id,"+column.GetString("value"), Map{"id": v})
//是角色表则取下角色值
if column.GetString("link") == "role" {
re[column.GetString("link")] = that.Db.Get(column.GetString("link"), "id,auth,"+column.GetString("value"), Map{"id": v})
} else {
re[column.GetString("link")] = that.Db.Get(column.GetString("link"), "id,"+column.GetString("value"), Map{"id": v})
}
} }
} }

View File

@ -14,7 +14,13 @@ var Config = Map{
//{"label": "测试表格", "table": "table", "icon": "el-icon-suitcase"}, //{"label": "测试表格", "table": "table", "icon": "el-icon-suitcase"},
//{"label": "系统管理", "name": "setting", "icon": "el-icon-setting", //{"label": "系统管理", "name": "setting", "icon": "el-icon-setting",
// "menus": []Map{ // "menus": []Map{
// {"label": "用户管理", "table": "user"}, // {"label": "用户管理", "table": "user",
// "default": {
// "path": "info",
// "id": "1"
// },
// "auth": ["show","edit","info","add","delete"],
// },
// {"label": "组织管理", "table": "organization"}, // {"label": "组织管理", "table": "organization"},
// {"label": "地区管理", "table": "area"}, // {"label": "地区管理", "table": "area"},
// {"label": "角色管理", "table": "role"}, // {"label": "角色管理", "table": "role"},

View File

@ -141,7 +141,7 @@ func (that *MakeCode) Db2JSON(name string, path string, db *db.HoTimeDB, makeCod
that.TableConfig[v.GetString("name")] = Map{ that.TableConfig[v.GetString("name")] = Map{
"label": v.GetString("label"), "label": v.GetString("label"),
"table": v.GetString("name"), "table": v.GetString("name"),
"auth": []string{"add", "delete", "edit", "info"}, "auth": []string{"show", "add", "delete", "edit", "info"},
"columns": []Map{}, "columns": []Map{},
"search": []Map{ "search": []Map{

File diff suppressed because it is too large Load Diff