package model import ( model2 "Medical_OAuth/common/model" ) type SysMenu struct { model2.Model ParentId int `json:"parentId" gorm:"size:11;"` // 父id ServiceMenuId int `json:"serviceMenuId" gorm:"size:4;not null;comment:服务菜单ID"` //服务菜单ID ServiceId int `json:"serviceId" gorm:"size:4;not null;comment:服务ID"` // 服务ID Sort int `json:"sort" gorm:"size:4;"` // 排序 Visible string `json:"visible" gorm:"size:1;"` // 1-显示 0-隐藏 MenuPath string `json:"paths" gorm:"size:128;" swaggerignore:"true"` // Name string `json:"name" gorm:"-"` // 菜单名称 MenuType string `json:"menuType" gorm:"-"` // 菜单类型 Icon string `json:"icon" gorm:"-"` // 图标 Component string `json:"component" gorm:"-"` // 组件路径 IsFrame string `json:"isFrame" gorm:"-"` // 是否外链 1-是 2-否 Path string `json:"path" gorm:"-"` // 外链路由地址 Permission string `json:"permission" gorm:"-"` // 权限标识 Children []SysMenu `json:"children,omitempty" gorm:"-"` model2.ControlBy model2.ModelTime } type SysMenuSlice []SysMenu func (x SysMenuSlice) Len() int { return len(x) } func (x SysMenuSlice) Less(i, j int) bool { return x[i].Sort < x[j].Sort } func (x SysMenuSlice) Swap(i, j int) { x[i], x[j] = x[j], x[i] } func (SysMenu) TableName() string { return "sys_menu" } func (e *SysMenu) Generate() model2.ActiveRecord { o := *e return &o } func (e *SysMenu) GetId() interface{} { return e.Id } var ( NoDeptMenu = `[ { "path": "/usermanagement", "name": "usermanagement", "icon": "icon-icon-", "component": "@/views/usermanagement/index.vue", "redirect": "/usermanagement/user", "meta": { "roles": false, "title": "用户管理" }, "children": [ { "path": "/usermanagement/user", "name": "user", "icon": "icon-icon-", "component": "@/views/usermanagement/user/index.vue", "meta": { "roles": false, "title": "用户管理" } }, { "path": "/usermanagement/company", "name": "company", "icon": "icon-zhuye1", "component": "@/views/usermanagement/company/index.vue", "meta": { "roles": false, "title": "公司管理" } } ] } ]` HaveDeptMenu = `[ { "path": "/home", "name": "home", "icon": "icon-shouye_zhuyehui", "component": "@/views/home/index.vue", "meta": { "roles": false, "title": "工作台" } }, { "path": "/essentialinfo", "name": "essentialinfo", "icon": "icon-zhuye1", "component": "@/views/essentialinfo/index.vue", "meta": { "roles": false, "title": "基本信息" } }, { "path": "/usermanagement", "name": "usermanagement", "icon": "icon-icon-", "component": "@/views/usermanagement/index.vue", "redirect": "/usermanagement/user", "meta": { "roles": false, "title": "用户管理" }, "children": [ { "path": "/usermanagement/user", "name": "user", "icon": "icon-icon-", "component": "@/views/usermanagement/user/index.vue", "meta": { "roles": false, "title": "用户管理" } }, { "path": "/usermanagement/company", "name": "company", "icon": "icon-zhuye1", "component": "@/views/usermanagement/company/index.vue", "meta": { "roles": false, "title": "公司管理" } } ] }, { "path": "/stockcontrol", "name": "stockcontrol", "icon": "icon-_kucun", "component": "@/views/stockcontrol/index.vue", "redirect": "/stockcontrol/storagePut", "meta": { "roles": false, "title": "库存管理" }, "children": [ { "path": "/stockcontrol/storagePut", "name": "storagePut", "icon": "icon-_kucun", "component": "@/views/stockcontrol/storagePut/index.vue", "meta": { "roles": false, "title": "入库管理" } }, { "path": "/stockcontrol/storageFrom", "name": "storageFrom", "icon": "icon-ruku", "component": "@/views/stockcontrol/storageFrom/index.vue", "meta": { "roles": false, "title": "出库管理" } }, { "path": "/stockcontrol/storageInquire", "name": "storageInquire", "icon": "icon-fenxixiangmuku", "component": "@/views/stockcontrol/storageInquire/index.vue", "meta": { "roles": false, "title": "库存查询" } }, { "path": "/stockcontrol/transmitReceive", "name": "transmitReceive", "icon": "icon-ruku", "component": "@/views/stockcontrol/transmitReceive/index.vue", "meta": { "roles": false, "title": "收发记录" } } ] }, { "path": "/salesmanagement", "name": "salesmanagement", "icon": "icon-chukuliucheng", "component": "@/views/salesmanagement/index.vue", "redirect": "/salesmanagement/sellManage", "meta": { "roles": false, "title": "销售管理" }, "children": [ { "path": "/salesmanagement/sellManage", "name": "sellManage", "icon": "icon-chukuliucheng", "component": "@/views/salesmanagement/sellManage/index.vue", "meta": { "roles": false, "title": "销售管理" } }, { "path": "/salesmanagement/storageOrderGoods", "name": "storageOrderGoods", "icon": "icon-dingdan", "component": "@/views/salesmanagement/storageOrderGoods/index.vue", "meta": { "roles": false, "title": "销售订单" } } ] }, { "path": "/medicine", "name": "medicine", "icon": "icon-yaopin", "component": "@/views/medicine/index.vue", "redirect": "/medicine/medicineManage", "meta": { "roles": false, "title": "药品管理" }, "children": [ { "path": "/medicine/medicineManage", "name": "medicineManage", "icon": "icon-yaopin", "component": "@/views/medicine/medicineManage/index.vue", "meta": { "roles": false, "title": "药品管理" } } ] } ] ` )