sys_menu.go 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. package model
  2. import (
  3. model2 "Medical_OAuth/common/model"
  4. )
  5. type SysMenu struct {
  6. model2.Model
  7. ParentId int `json:"parentId" gorm:"size:11;"` // 父id
  8. ServiceMenuId int `json:"serviceMenuId" gorm:"size:4;not null;comment:服务菜单ID"` //服务菜单ID
  9. ServiceId int `json:"serviceId" gorm:"size:4;not null;comment:服务ID"` // 服务ID
  10. Sort int `json:"sort" gorm:"size:4;"` // 排序
  11. Visible string `json:"visible" gorm:"size:1;"` // 1-显示 0-隐藏
  12. MenuPath string `json:"paths" gorm:"size:128;" swaggerignore:"true"` //
  13. Name string `json:"name" gorm:"-"` // 菜单名称
  14. MenuType string `json:"menuType" gorm:"-"` // 菜单类型
  15. Icon string `json:"icon" gorm:"-"` // 图标
  16. Component string `json:"component" gorm:"-"` // 组件路径
  17. IsFrame string `json:"isFrame" gorm:"-"` // 是否外链 1-是 2-否
  18. Path string `json:"path" gorm:"-"` // 外链路由地址
  19. Permission string `json:"permission" gorm:"-"` // 权限标识
  20. Children []SysMenu `json:"children,omitempty" gorm:"-"`
  21. model2.ControlBy
  22. model2.ModelTime
  23. }
  24. type SysMenuSlice []SysMenu
  25. func (x SysMenuSlice) Len() int { return len(x) }
  26. func (x SysMenuSlice) Less(i, j int) bool { return x[i].Sort < x[j].Sort }
  27. func (x SysMenuSlice) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
  28. func (SysMenu) TableName() string {
  29. return "sys_menu"
  30. }
  31. func (e *SysMenu) Generate() model2.ActiveRecord {
  32. o := *e
  33. return &o
  34. }
  35. func (e *SysMenu) GetId() interface{} {
  36. return e.Id
  37. }
  38. var (
  39. NoDeptMenu = `[
  40. {
  41. "path": "/usermanagement",
  42. "name": "usermanagement",
  43. "icon": "icon-icon-",
  44. "component": "@/views/usermanagement/index.vue",
  45. "redirect": "/usermanagement/user",
  46. "meta": {
  47. "roles": false,
  48. "title": "用户管理"
  49. },
  50. "children": [
  51. {
  52. "path": "/usermanagement/user",
  53. "name": "user",
  54. "icon": "icon-icon-",
  55. "component": "@/views/usermanagement/user/index.vue",
  56. "meta": {
  57. "roles": false,
  58. "title": "用户管理"
  59. }
  60. },
  61. {
  62. "path": "/usermanagement/company",
  63. "name": "company",
  64. "icon": "icon-zhuye1",
  65. "component": "@/views/usermanagement/company/index.vue",
  66. "meta": {
  67. "roles": false,
  68. "title": "公司管理"
  69. }
  70. }
  71. ]
  72. }
  73. ]`
  74. HaveDeptMenu = `[
  75. {
  76. "path": "/home",
  77. "name": "home",
  78. "icon": "icon-shouye_zhuyehui",
  79. "component": "@/views/home/index.vue",
  80. "meta": {
  81. "roles": false,
  82. "title": "工作台"
  83. }
  84. },
  85. {
  86. "path": "/essentialinfo",
  87. "name": "essentialinfo",
  88. "icon": "icon-zhuye1",
  89. "component": "@/views/essentialinfo/index.vue",
  90. "meta": {
  91. "roles": false,
  92. "title": "基本信息"
  93. }
  94. },
  95. {
  96. "path": "/usermanagement",
  97. "name": "usermanagement",
  98. "icon": "icon-icon-",
  99. "component": "@/views/usermanagement/index.vue",
  100. "redirect": "/usermanagement/user",
  101. "meta": {
  102. "roles": false,
  103. "title": "用户管理"
  104. },
  105. "children": [
  106. {
  107. "path": "/usermanagement/user",
  108. "name": "user",
  109. "icon": "icon-icon-",
  110. "component": "@/views/usermanagement/user/index.vue",
  111. "meta": {
  112. "roles": false,
  113. "title": "用户管理"
  114. }
  115. },
  116. {
  117. "path": "/usermanagement/company",
  118. "name": "company",
  119. "icon": "icon-zhuye1",
  120. "component": "@/views/usermanagement/company/index.vue",
  121. "meta": {
  122. "roles": false,
  123. "title": "公司管理"
  124. }
  125. }
  126. ]
  127. },
  128. {
  129. "path": "/stockcontrol",
  130. "name": "stockcontrol",
  131. "icon": "icon-_kucun",
  132. "component": "@/views/stockcontrol/index.vue",
  133. "redirect": "/stockcontrol/storagePut",
  134. "meta": {
  135. "roles": false,
  136. "title": "库存管理"
  137. },
  138. "children": [
  139. {
  140. "path": "/stockcontrol/storagePut",
  141. "name": "storagePut",
  142. "icon": "icon-_kucun",
  143. "component": "@/views/stockcontrol/storagePut/index.vue",
  144. "meta": {
  145. "roles": false,
  146. "title": "入库管理"
  147. }
  148. },
  149. {
  150. "path": "/stockcontrol/storageFrom",
  151. "name": "storageFrom",
  152. "icon": "icon-ruku",
  153. "component": "@/views/stockcontrol/storageFrom/index.vue",
  154. "meta": {
  155. "roles": false,
  156. "title": "出库管理"
  157. }
  158. },
  159. {
  160. "path": "/stockcontrol/storageInquire",
  161. "name": "storageInquire",
  162. "icon": "icon-fenxixiangmuku",
  163. "component": "@/views/stockcontrol/storageInquire/index.vue",
  164. "meta": {
  165. "roles": false,
  166. "title": "库存查询"
  167. }
  168. },
  169. {
  170. "path": "/stockcontrol/transmitReceive",
  171. "name": "transmitReceive",
  172. "icon": "icon-ruku",
  173. "component": "@/views/stockcontrol/transmitReceive/index.vue",
  174. "meta": {
  175. "roles": false,
  176. "title": "收发记录"
  177. }
  178. }
  179. ]
  180. },
  181. {
  182. "path": "/salesmanagement",
  183. "name": "salesmanagement",
  184. "icon": "icon-chukuliucheng",
  185. "component": "@/views/salesmanagement/index.vue",
  186. "redirect": "/salesmanagement/sellManage",
  187. "meta": {
  188. "roles": false,
  189. "title": "销售管理"
  190. },
  191. "children": [
  192. {
  193. "path": "/salesmanagement/sellManage",
  194. "name": "sellManage",
  195. "icon": "icon-chukuliucheng",
  196. "component": "@/views/salesmanagement/sellManage/index.vue",
  197. "meta": {
  198. "roles": false,
  199. "title": "销售管理"
  200. }
  201. },
  202. {
  203. "path": "/salesmanagement/storageOrderGoods",
  204. "name": "storageOrderGoods",
  205. "icon": "icon-dingdan",
  206. "component": "@/views/salesmanagement/storageOrderGoods/index.vue",
  207. "meta": {
  208. "roles": false,
  209. "title": "销售订单"
  210. }
  211. }
  212. ]
  213. },
  214. {
  215. "path": "/medicine",
  216. "name": "medicine",
  217. "icon": "icon-yaopin",
  218. "component": "@/views/medicine/index.vue",
  219. "redirect": "/medicine/medicineManage",
  220. "meta": {
  221. "roles": false,
  222. "title": "药品管理"
  223. },
  224. "children": [
  225. {
  226. "path": "/medicine/medicineManage",
  227. "name": "medicineManage",
  228. "icon": "icon-yaopin",
  229. "component": "@/views/medicine/medicineManage/index.vue",
  230. "meta": {
  231. "roles": false,
  232. "title": "药品管理"
  233. }
  234. }
  235. ]
  236. }
  237. ]
  238. `
  239. )