config.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. /* Layout */
  2. import Layout from '@/layout'
  3. export const asyncRouterMap = [
  4. {
  5. path: '/',
  6. component: Layout,
  7. redirect: '/dashboard',
  8. children: [
  9. {
  10. path: 'dashboard',
  11. name: 'Dashboard',
  12. component: () => import('@/views/dashboard'),
  13. meta: { title: 'Dashboard', icon: 'dashboard' }
  14. }
  15. ]
  16. },
  17. {
  18. path: '/recipe',
  19. component: Layout,
  20. children: [
  21. {
  22. path: '',
  23. name: '菜谱列表',
  24. component: () => import('@/views/recipe/index'),
  25. meta: { title: '菜谱列表', icon: 'recipe', admin: true }
  26. },
  27. {
  28. path: ':id/food',
  29. name: '食物管理',
  30. component: () => import('@/views/recipe/food'),
  31. meta: { title: '食物管理' },
  32. hidden: true
  33. },
  34. {
  35. path: ':id/step',
  36. name: '步骤管理',
  37. component: () => import('@/views/recipe/step'),
  38. meta: { title: '步骤管理' },
  39. hidden: true
  40. }
  41. ]
  42. },
  43. {
  44. path: '/food',
  45. component: Layout,
  46. name: '食物列表',
  47. meta: { title: '食物列表', icon: 'food' },
  48. children: [
  49. {
  50. path: '',
  51. name: '全部',
  52. component: () => import('@/views/food/index'),
  53. meta: { title: '全部', admin: true }
  54. },
  55. {
  56. path: 'entry',
  57. name: '录入',
  58. component: () => import('@/views/food/index'),
  59. meta: { title: '录入' }
  60. },
  61. {
  62. path: 'cfct',
  63. name: 'CFCT',
  64. component: () => import('@/views/food/index'),
  65. meta: { title: 'CFCT', admin: true }
  66. },
  67. {
  68. path: 'create',
  69. name: '食物创建',
  70. component: () => import('@/views/food/create'),
  71. meta: { title: '食物创建', icon: 'food' },
  72. hidden: true
  73. },
  74. {
  75. path: 'edit/:id',
  76. name: '食物编辑',
  77. component: () => import('@/views/food/edit'),
  78. meta: { title: '食物编辑', icon: 'food' },
  79. hidden: true
  80. },
  81. {
  82. path: ':id/nutrient',
  83. name: '营养素关联',
  84. component: () => import('@/views/food/nutrient'),
  85. meta: { title: '营养素关联', icon: 'food' },
  86. hidden: true
  87. },
  88. {
  89. path: ':id/unit',
  90. name: '单位管理',
  91. component: () => import('@/views/food/unit'),
  92. meta: { title: '单位管理' },
  93. hidden: true
  94. },
  95. {
  96. path: ':id/modifier',
  97. name: '规格管理',
  98. component: () => import('@/views/foodModifier/index'),
  99. meta: { title: '规格管理' },
  100. hidden: true
  101. },
  102. {
  103. path: ':id/modifier/create',
  104. name: '新建食物规格',
  105. component: () => import('@/views/foodModifier/create'),
  106. meta: { title: '新建食物规格' },
  107. hidden: true
  108. },
  109. {
  110. path: ':id/modifier/:modifierId/edit',
  111. name: '编辑食物规格',
  112. component: () => import('@/views/foodModifier/edit'),
  113. meta: { title: '编辑食物规格' },
  114. hidden: true
  115. }
  116. ]
  117. },
  118. {
  119. path: '/nutrient',
  120. component: Layout,
  121. children: [
  122. {
  123. path: '',
  124. name: '营养素列表',
  125. component: () => import('@/views/nutrient/index'),
  126. meta: { title: '营养素列表', icon: 'nutrient', admin: true }
  127. }
  128. ]
  129. },
  130. {
  131. path: '/unit',
  132. component: Layout,
  133. children: [
  134. {
  135. path: '',
  136. name: '单位列表',
  137. component: () => import('@/views/unit/index'),
  138. meta: { title: '单位列表', icon: 'unit', admin: true }
  139. }
  140. ]
  141. },
  142. {
  143. path: '/user',
  144. component: Layout,
  145. meta: { admin: true },
  146. children: [
  147. {
  148. path: '',
  149. name: '用户列表',
  150. component: () => import('@/views/user/index'),
  151. meta: { title: '用户列表', icon: 'user', admin: true }
  152. }
  153. ]
  154. },
  155. {
  156. path: '/nutrient-template',
  157. component: Layout,
  158. children: [
  159. {
  160. path: '',
  161. name: '营养素模板列表',
  162. component: () => import('@/views/nutrientTemplate/index'),
  163. meta: { title: '营养素模板列表', icon: 'template' }
  164. },
  165. {
  166. path: ':id/detail',
  167. name: '模板营养素管理',
  168. component: () => import('@/views/nutrientTemplate/detail'),
  169. meta: { title: '模板营养素管理' },
  170. hidden: true
  171. }
  172. ]
  173. },
  174. {
  175. path: '/food-category',
  176. component: Layout,
  177. children: [
  178. {
  179. path: '',
  180. name: '食物种类管理',
  181. component: () => import('@/views/foodCategory/index'),
  182. meta: { title: '食物种类管理', icon: 'category', admin: true }
  183. }
  184. ]
  185. },
  186. // 404 page must be placed at the end !!!
  187. { path: '*', redirect: '/404', hidden: true }
  188. ]
  189. /**
  190. * 基础路由
  191. * @type { *[] }
  192. */
  193. export const constantRouterMap = [
  194. {
  195. path: '/404',
  196. hidden: true,
  197. component: () => import('@/views/404')
  198. },
  199. {
  200. path: '/login',
  201. component: () => import('@/views/login/index'),
  202. hidden: true
  203. }
  204. ]