From df7d33c2689768d6aa5d63c13d02ef6652c5aae2 Mon Sep 17 00:00:00 2001 From: VIVIMAN Date: Mon, 19 Dec 2022 17:42:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E7=BD=AEswagger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + conf/app.conf | 6 +- controllers/vivib/LiCaiController.go | 96 +----- routers/commentsRouter_.go | 370 --------------------- routers/commentsRouter_controllers.go | 415 ------------------------ routers/说明.md | 8 + web/src/api/vivib/licai.js | 44 +-- web/src/views/dashboard/BarChart.vue | 2 - web/src/views/dashboard/BarChartT.vue | 2 - web/src/views/vivib/licai/index.vue | 95 +----- web/src/views/vivib/licai/licaiCss.scss | 15 + web/src/views/vivib/licai/licaiJs.js | 173 ++-------- 12 files changed, 62 insertions(+), 1165 deletions(-) delete mode 100644 routers/commentsRouter_.go delete mode 100644 routers/commentsRouter_controllers.go create mode 100644 routers/说明.md create mode 100644 web/src/views/vivib/licai/licaiCss.scss diff --git a/.gitignore b/.gitignore index df39b11..38edf8f 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ yshop.tar.gz go.sum lastupdate.tmp /static/upload/ +/routers/commentsRouter_controllers.go diff --git a/conf/app.conf b/conf/app.conf index d67af79..a2808c3 100644 --- a/conf/app.conf +++ b/conf/app.conf @@ -1,6 +1,6 @@ appname = yshop httpport = 8080 -runmode = dev +runmode = prod autorender = false copyrequestbody = true EnableDocs = true @@ -32,11 +32,11 @@ jwt_token = 1BD6C43CA0BBF4B7ABA5E486D6A5AA2D [prod] #数据库配置 -mysqluser = "beego" +mysqluser = "hy_qggwy" mysqlpass = "Asdfghjklm123." mysqlhost = "nas.viviman.top" mysqlport = 35017 -mysqldb = "beego_demo01" +mysqldb = "viviman" db_max_idle_conn = 30 db_max_open_open = 100 maxmemory = 1<<22 diff --git a/controllers/vivib/LiCaiController.go b/controllers/vivib/LiCaiController.go index 17a4c33..d7b400c 100644 --- a/controllers/vivib/LiCaiController.go +++ b/controllers/vivib/LiCaiController.go @@ -1,12 +1,8 @@ package vivib import ( - "encoding/json" - "github.com/beego/beego/v2/core/logs" - "github.com/beego/beego/v2/core/validation" "strconv" "viviman.top/controllers" - "viviman.top/dto" "viviman.top/models" "viviman.top/vo" ) @@ -17,11 +13,8 @@ type LiCaiController struct { } func (c *LiCaiController) URLMapping() { - c.Mapping("Post", c.Post) - c.Mapping("CpPost", c.CpPost) c.Mapping("GetAll", c.GetAll) - c.Mapping("Put", c.Put) - c.Mapping("Delete", c.Delete) + c.Mapping("GetOne", c.GetOne) } // GetOne @Title获取单个财务记录 @@ -46,90 +39,3 @@ func (c *LiCaiController) GetAll() { c.Data["json"] = controllers.SuccessData(vo.ResultList{Content: list, TotalElements: total}) _ = c.ServeJSON() } - -// CpPost @Title财务记录复制 -// @Description 角色添加 -// @Success 200 {object} controllers.Result -// @router / [post] -func (c *LiCaiController) CpPost() { - -} - -// Post @Title角色添加 -// @Description 角色添加 -// @Success 200 {object} controllers.Result -// @router / [post] -func (c *LiCaiController) Post() { - var model models.SysRole - valid := validation.Validation{} - json.Unmarshal(c.Ctx.Input.RequestBody, &model) - b, _ := valid.Valid(&model) - if !b { - for _, err := range valid.Errors { - c.Data["json"] = controllers.ErrMsg(err.Message) - } - } - _, e := models.AddRole(&model) - if e != nil { - c.Data["json"] = controllers.ErrMsg(e.Error()) - } - c.Data["json"] = controllers.SuccessData("操作成功") - _ = c.ServeJSON() -} - -// Put -// @router / [put] -func (c *LiCaiController) Put() { - var model models.SysRole - valid := validation.Validation{} - json.Unmarshal(c.Ctx.Input.RequestBody, &model) - b, _ := valid.Valid(&model) - if !b { - for _, err := range valid.Errors { - c.Data["json"] = controllers.ErrMsg(err.Message) - } - } - e := models.UpdateByRole(&model) - if e != nil { - c.Data["json"] = controllers.ErrMsg(e.Error()) - } - c.Data["json"] = controllers.SuccessData("操作成功") - _ = c.ServeJSON() -} - -// Delete @Title角色删除 -// @Description 角色删除 -// @Success 200 {object} controllers.Result -// @router / [delete] -func (c *LiCaiController) Delete() { - var ids []int64 - json.Unmarshal(c.Ctx.Input.RequestBody, &ids) - logs.Info(ids) - e := models.DelByRole(ids) - if e != nil { - c.Data["json"] = controllers.ErrMsg(e.Error()) - } - c.Data["json"] = controllers.SuccessData("操作成功") - _ = c.ServeJSON() -} - -// Menu @Title角色菜单更新 -// @Description 角色菜单更新 -// @Success 200 {object} controllers.Result -// @router /menu [put] -func (c *LiCaiController) Menu() { - var model dto.RoleMenu - valid := validation.Validation{} - json.Unmarshal(c.Ctx.Input.RequestBody, &model) - logs.Info("=======menu======") - logs.Info(model) - b, _ := valid.Valid(&model) - if !b { - for _, err := range valid.Errors { - c.Data["json"] = controllers.ErrMsg(err.Message) - } - } - models.BatchRoleMenuAdd(model) - c.Data["json"] = controllers.SuccessData("操作成功") - _ = c.ServeJSON() -} diff --git a/routers/commentsRouter_.go b/routers/commentsRouter_.go deleted file mode 100644 index 3f34008..0000000 --- a/routers/commentsRouter_.go +++ /dev/null @@ -1,370 +0,0 @@ -package routers - -import ( - beego "github.com/beego/beego/v2/server/web" - "github.com/beego/beego/v2/server/web/context/param" -) - -func init() { - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DeptController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DeptController"], - beego.ControllerComments{ - Method: "GetAll", - Router: "/", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DeptController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DeptController"], - beego.ControllerComments{ - Method: "Post", - Router: "/", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DeptController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DeptController"], - beego.ControllerComments{ - Method: "Put", - Router: "/", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DeptController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DeptController"], - beego.ControllerComments{ - Method: "Delete", - Router: "/", - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DictController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DictController"], - beego.ControllerComments{ - Method: "GetAll", - Router: "/", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DictController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DictController"], - beego.ControllerComments{ - Method: "Post", - Router: "/", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DictController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DictController"], - beego.ControllerComments{ - Method: "Put", - Router: "/", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DictController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DictController"], - beego.ControllerComments{ - Method: "Delete", - Router: "/:id", - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DictDetailController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DictDetailController"], - beego.ControllerComments{ - Method: "GetAll", - Router: "/", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DictDetailController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DictDetailController"], - beego.ControllerComments{ - Method: "Post", - Router: "/", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DictDetailController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DictDetailController"], - beego.ControllerComments{ - Method: "Put", - Router: "/", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DictDetailController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DictDetailController"], - beego.ControllerComments{ - Method: "Delete", - Router: "/:id", - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:JobController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:JobController"], - beego.ControllerComments{ - Method: "GetAll", - Router: "/", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:JobController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:JobController"], - beego.ControllerComments{ - Method: "Post", - Router: "/", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:JobController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:JobController"], - beego.ControllerComments{ - Method: "Put", - Router: "/", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:JobController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:JobController"], - beego.ControllerComments{ - Method: "Delete", - Router: "/", - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:LoginController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:LoginController"], - beego.ControllerComments{ - Method: "Captcha", - Router: "/captcha", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:LoginController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:LoginController"], - beego.ControllerComments{ - Method: "Info", - Router: "/info", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:LoginController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:LoginController"], - beego.ControllerComments{ - Method: "Login", - Router: "/login", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:LoginController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:LoginController"], - beego.ControllerComments{ - Method: "Logout", - Router: "/logout", - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"], - beego.ControllerComments{ - Method: "GetAll", - Router: "/", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"], - beego.ControllerComments{ - Method: "Post", - Router: "/", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"], - beego.ControllerComments{ - Method: "Put", - Router: "/", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"], - beego.ControllerComments{ - Method: "Delete", - Router: "/", - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"], - beego.ControllerComments{ - Method: "Build", - Router: "/build", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"], - beego.ControllerComments{ - Method: "GetTree", - Router: "/tree", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"], - beego.ControllerComments{ - Method: "GetAll", - Router: "/", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"], - beego.ControllerComments{ - Method: "Post", - Router: "/", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"], - beego.ControllerComments{ - Method: "Put", - Router: "/", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"], - beego.ControllerComments{ - Method: "Delete", - Router: "/", - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"], - beego.ControllerComments{ - Method: "GetOne", - Router: "/:id", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"], - beego.ControllerComments{ - Method: "Menu", - Router: "/menu", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:ToolsController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:ToolsController"], - beego.ControllerComments{ - Method: "Post", - Router: "/", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"], - beego.ControllerComments{ - Method: "GetAll", - Router: "/", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"], - beego.ControllerComments{ - Method: "Post", - Router: "/", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"], - beego.ControllerComments{ - Method: "Put", - Router: "/", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"], - beego.ControllerComments{ - Method: "Delete", - Router: "/", - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"], - beego.ControllerComments{ - Method: "Center", - Router: "/center", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"], - beego.ControllerComments{ - Method: "Avatar", - Router: "/updateAvatar", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"], - beego.ControllerComments{ - Method: "Pass", - Router: "/updatePass", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - -} diff --git a/routers/commentsRouter_controllers.go b/routers/commentsRouter_controllers.go deleted file mode 100644 index 1bcd714..0000000 --- a/routers/commentsRouter_controllers.go +++ /dev/null @@ -1,415 +0,0 @@ -package routers - -import ( - beego "github.com/beego/beego/v2/server/web" - "github.com/beego/beego/v2/server/web/context/param" -) - -func init() { - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DeptController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DeptController"], - beego.ControllerComments{ - Method: "GetAll", - Router: "/", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DeptController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DeptController"], - beego.ControllerComments{ - Method: "Post", - Router: "/", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DeptController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DeptController"], - beego.ControllerComments{ - Method: "Put", - Router: "/", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DeptController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DeptController"], - beego.ControllerComments{ - Method: "Delete", - Router: "/", - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DictController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DictController"], - beego.ControllerComments{ - Method: "GetAll", - Router: "/", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DictController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DictController"], - beego.ControllerComments{ - Method: "Post", - Router: "/", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DictController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DictController"], - beego.ControllerComments{ - Method: "Put", - Router: "/", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DictController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DictController"], - beego.ControllerComments{ - Method: "Delete", - Router: "/:id", - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DictDetailController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DictDetailController"], - beego.ControllerComments{ - Method: "GetAll", - Router: "/", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DictDetailController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DictDetailController"], - beego.ControllerComments{ - Method: "Post", - Router: "/", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DictDetailController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DictDetailController"], - beego.ControllerComments{ - Method: "Put", - Router: "/", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:DictDetailController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:DictDetailController"], - beego.ControllerComments{ - Method: "Delete", - Router: "/:id", - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:JobController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:JobController"], - beego.ControllerComments{ - Method: "GetAll", - Router: "/", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:JobController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:JobController"], - beego.ControllerComments{ - Method: "Post", - Router: "/", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:JobController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:JobController"], - beego.ControllerComments{ - Method: "Put", - Router: "/", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:JobController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:JobController"], - beego.ControllerComments{ - Method: "Delete", - Router: "/", - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:LoginController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:LoginController"], - beego.ControllerComments{ - Method: "Captcha", - Router: "/captcha", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:LoginController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:LoginController"], - beego.ControllerComments{ - Method: "Info", - Router: "/info", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:LoginController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:LoginController"], - beego.ControllerComments{ - Method: "Login", - Router: "/login", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:LoginController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:LoginController"], - beego.ControllerComments{ - Method: "Logout", - Router: "/logout", - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"], - beego.ControllerComments{ - Method: "GetAll", - Router: "/", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"], - beego.ControllerComments{ - Method: "Post", - Router: "/", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"], - beego.ControllerComments{ - Method: "Put", - Router: "/", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"], - beego.ControllerComments{ - Method: "Delete", - Router: "/", - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"], - beego.ControllerComments{ - Method: "Build", - Router: "/build", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:MenuController"], - beego.ControllerComments{ - Method: "GetTree", - Router: "/tree", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"], - beego.ControllerComments{ - Method: "GetAll", - Router: "/", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"], - beego.ControllerComments{ - Method: "Post", - Router: "/", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"], - beego.ControllerComments{ - Method: "Delete", - Router: "/", - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"], - beego.ControllerComments{ - Method: "GetOne", - Router: "/:id", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:RoleController"], - beego.ControllerComments{ - Method: "Menu", - Router: "/menu", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"], - beego.ControllerComments{ - Method: "GetAll", - Router: "/", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"], - beego.ControllerComments{ - Method: "Post", - Router: "/", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"], - beego.ControllerComments{ - Method: "Put", - Router: "/", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"], - beego.ControllerComments{ - Method: "Delete", - Router: "/", - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"], - beego.ControllerComments{ - Method: "Center", - Router: "/center", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"], - beego.ControllerComments{ - Method: "Avatar", - Router: "/updateAvatar", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/admin:UserController"], - beego.ControllerComments{ - Method: "Pass", - Router: "/updatePass", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/vivib:LiCaiController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/vivib:LiCaiController"], - beego.ControllerComments{ - Method: "GetAll", - Router: "/", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/vivib:LiCaiController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/vivib:LiCaiController"], - beego.ControllerComments{ - Method: "CpPost", - Router: "/", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/vivib:LiCaiController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/vivib:LiCaiController"], - beego.ControllerComments{ - Method: "Post", - Router: "/", - AllowHTTPMethods: []string{"post"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/vivib:LiCaiController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/vivib:LiCaiController"], - beego.ControllerComments{ - Method: "Put", - Router: "/", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/vivib:LiCaiController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/vivib:LiCaiController"], - beego.ControllerComments{ - Method: "Delete", - Router: "/", - AllowHTTPMethods: []string{"delete"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/vivib:LiCaiController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/vivib:LiCaiController"], - beego.ControllerComments{ - Method: "GetOne", - Router: "/:id", - AllowHTTPMethods: []string{"get"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - - beego.GlobalControllerRouter["viviman.top/controllers/vivib:LiCaiController"] = append(beego.GlobalControllerRouter["viviman.top/controllers/vivib:LiCaiController"], - beego.ControllerComments{ - Method: "Menu", - Router: "/menu", - AllowHTTPMethods: []string{"put"}, - MethodParams: param.Make(), - Filters: nil, - Params: nil}) - -} diff --git a/routers/说明.md b/routers/说明.md new file mode 100644 index 0000000..8f40b4e --- /dev/null +++ b/routers/说明.md @@ -0,0 +1,8 @@ + +手动配置 swagger + +#### 代码启动 +```shell +# 重写controllers +bee run -gendoc=true -downdoc=true +``` \ No newline at end of file diff --git a/web/src/api/vivib/licai.js b/web/src/api/vivib/licai.js index eef71fb..51a09c4 100644 --- a/web/src/api/vivib/licai.js +++ b/web/src/api/vivib/licai.js @@ -3,48 +3,16 @@ import request from '@/utils/request' // 获取所有的Role export function getAll() { return request({ - url: 'admin/roles', - method: 'get' + url: 'vivib/licai', + method: 'GetAll' }) } -export function add(data) { +export function getOne(id) { return request({ - url: 'admin/roles', - method: 'post', - data + url: 'vivib/licai/' + id, + method: 'GetOne' }) } -export function get(id) { - return request({ - url: 'admin/roles/' + id, - method: 'get' - }) -} - -export function del(ids) { - return request({ - url: 'admin/roles', - method: 'delete', - data: ids - }) -} - -export function edit(data) { - return request({ - url: 'admin/roles', - method: 'put', - data - }) -} - -export function editMenu(data) { - return request({ - url: 'admin/roles/menu', - method: 'put', - data - }) -} - -export default { add, edit, del, get, editMenu } +export default { getAll, getOne } diff --git a/web/src/views/dashboard/BarChart.vue b/web/src/views/dashboard/BarChart.vue index 817c98d..4f3b268 100644 --- a/web/src/views/dashboard/BarChart.vue +++ b/web/src/views/dashboard/BarChart.vue @@ -61,8 +61,6 @@ export default { num.push(item.num) }) - console.log(day, num) - this.chart.setOption({ tooltip: { trigger: 'axis', diff --git a/web/src/views/dashboard/BarChartT.vue b/web/src/views/dashboard/BarChartT.vue index 3008845..2569788 100644 --- a/web/src/views/dashboard/BarChartT.vue +++ b/web/src/views/dashboard/BarChartT.vue @@ -64,8 +64,6 @@ export default { num.push(item.num) }) - console.log(day, num) - this.chart.setOption({ tooltip: { trigger: 'axis', diff --git a/web/src/views/vivib/licai/index.vue b/web/src/views/vivib/licai/index.vue index 852b7c1..c1f4b11 100644 --- a/web/src/views/vivib/licai/index.vue +++ b/web/src/views/vivib/licai/index.vue @@ -1,94 +1,13 @@ - + diff --git a/web/src/views/vivib/licai/licaiCss.scss b/web/src/views/vivib/licai/licaiCss.scss new file mode 100644 index 0000000..0ea0505 --- /dev/null +++ b/web/src/views/vivib/licai/licaiCss.scss @@ -0,0 +1,15 @@ +.li-cai { + + .role-span { + font-weight: bold; + color: #303133; + font-size: 15px; + } + + .el-input-number { + .el-input__inner { + text-align: left; + } + } +} + diff --git a/web/src/views/vivib/licai/licaiJs.js b/web/src/views/vivib/licai/licaiJs.js index d8bfcc5..f08938a 100644 --- a/web/src/views/vivib/licai/licaiJs.js +++ b/web/src/views/vivib/licai/licaiJs.js @@ -1,32 +1,8 @@ -import crudRoles from '@/api/system/role' -import {getDepts} from '@/api/system/dept' -import {getMenusTree} from '@/api/system/menu' -import CRUD, {crud, form, header, presenter} from '@crud/crud' -import rrOperation from '@crud/RR.operation' -import crudOperation from '@crud/CRUD.operation' -import udOperation from '@crud/UD.operation' -import pagination from '@crud/Pagination' -import Treeselect from '@riophae/vue-treeselect' -import '@riophae/vue-treeselect/dist/vue-treeselect.css' - -// crud交由presenter持有 -const defaultCrud = CRUD({title: '角色', url: 'admin/roles', sort: 'level,asc', crudMethod: {...crudRoles}}) -const defaultForm = {id: null, name: null, depts: [], remark: null, dataScope: '全部', level: 3, permission: null} export default { name: 'LiCai', - components: {Treeselect, pagination, crudOperation, rrOperation, udOperation}, - mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()], + components: {}, data() { return { - defaultProps: {children: 'children', label: 'label'}, - dateScopes: ['全部', '本级', '自定义'], level: 3, - currentId: 0, menuLoading: false, showButton: false, - menus: [], menuIds: [], depts: [], - permission: { - add: ['admin', 'roles:add'], - edit: ['admin', 'roles:edit'], - del: ['admin', 'roles:del'] - }, rules: { name: [ {required: true, message: '请输入名称', trigger: 'blur'} @@ -34,137 +10,30 @@ export default { permission: [ {required: true, message: '请输入权限', trigger: 'blur'} ] - } + }, + tableData: [{ + date: '2016-05-02', + name: '王小虎', + address: '上海市普陀区金沙江路 1518 弄' + }, { + date: '2016-05-04', + name: '王小虎', + address: '上海市普陀区金沙江路 1517 弄' + }, { + date: '2016-05-01', + name: '王小虎', + address: '上海市普陀区金沙江路 1519 弄' + }, { + date: '2016-05-03', + name: '王小虎', + address: '上海市普陀区金沙江路 1516 弄' + }] } }, created() { - this.getMenus() - this.$nextTick(() => { - this.crud.toQuery() - }) + }, methods: { - [CRUD.HOOK.afterRefresh]() { - this.$refs.menu.setCheckedKeys([]) - }, - // 编辑前 - [CRUD.HOOK.beforeToEdit](crud, form) { - if (form.dataScope === '自定义') { - this.getDepts() - } - const depts = [] - form.depts.forEach(function (dept, index) { - depts.push(dept.id) - }) - form.depts = depts - }, - // 提交前做的操作 - [CRUD.HOOK.afterValidateCU](crud) { - if (crud.form.dataScope === '自定义' && crud.form.depts.length === 0) { - this.$message({ - message: '自定义数据权限不能为空', - type: 'warning' - }) - return false - } else if (crud.form.dataScope === '自定义') { - const depts = [] - crud.form.depts.forEach(function (data, index) { - const dept = {id: data} - depts.push(dept) - }) - crud.form.depts = depts - } else { - crud.form.depts = [] - } - return true - }, - [CRUD.HOOK.afterAddError](crud) { - this.afterErrorMethod(crud) - }, - [CRUD.HOOK.afterEditError](crud) { - this.afterErrorMethod(crud) - }, - afterErrorMethod(crud) { - const depts = [] - crud.form.depts.forEach(function (dept, index) { - depts.push(dept.id) - }) - crud.form.depts = depts - }, - // 获取所有菜单 - getMenus() { - getMenusTree().then(res => { - this.menus = res.data - }) - }, - // 触发单选 - handleCurrentChange(val) { - if (val) { - const _this = this - // 清空菜单的选中 - this.$refs.menu.setCheckedKeys([]) - // 保存当前的角色id - this.currentId = val.id - this.showButton = val.level > 0 - // 初始化 - this.menuIds = [] - // 菜单数据需要特殊处理 - val.menus.forEach(function (data, index) { - if (data.pid != 0) { - _this.menuIds.push(data.id) - } - }) - } - }, - // 保存菜单 - saveMenu() { - this.menuLoading = true - const role = {id: this.currentId, menus: []} - // 得到半选的父节点数据,保存起来 - this.$refs.menu.getHalfCheckedNodes().forEach(function (data, index) { - const menu = {id: data.id} - role.menus.push(menu) - }) - // 得到已选中的 key 值 - this.$refs.menu.getCheckedKeys().forEach(function (data, index) { - const menu = {id: data} - role.menus.push(menu) - }) - crudRoles.editMenu(role).then(res => { - this.crud.notify('保存成功', CRUD.NOTIFICATION_TYPE.SUCCESS) - this.menuLoading = false - this.update() - }).catch(err => { - this.menuLoading = false - console.log(err.response.data.message) - }) - }, - // 改变数据 - update() { - // 无刷新更新 表格数据 - crudRoles.get(this.currentId).then(res => { - for (let i = 0; i < this.crud.data.length; i++) { - if (res.data.id === this.crud.data[i].id) { - this.crud.data[i] = res.data - break - } - } - }) - }, - // 获取部门数据 - getDepts() { - getDepts({enabled: true}).then(res => { - this.depts = res.content - }) - }, - // 如果数据权限为自定义则获取部门数据 - changeScope() { - if (this.form.dataScope === '自定义') { - this.getDepts() - } - }, - checkboxT(row, rowIndex) { - return row.level >= this.level - } + } }