route.ts 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. import {RouteRecordRaw} from 'vue-router';
  2. /**
  3. * 建议:路由 path 路径与文件夹名称相同,找文件可浏览器地址找,方便定位文件位置
  4. *
  5. * 路由meta对象参数说明
  6. * meta: {
  7. * title: 菜单栏及 tagsView 栏、菜单搜索名称(国际化)
  8. * isLink: 是否超链接菜单,开启外链条件,`1、isLink: 链接地址不为空 2、isIframe:false`
  9. * isHide: 是否隐藏此路由
  10. * isKeepAlive: 是否缓存组件状态
  11. * isAffix: 是否固定在 tagsView 栏上
  12. * isIframe: 是否内嵌窗口,开启条件,`1、isIframe:true 2、isLink:链接地址不为空`
  13. * roles: 当前路由权限标识,取角色管理。控制路由显示、隐藏。超级管理员:admin 普通角色:common
  14. * icon: 菜单、tagsView 图标,阿里:加 `iconfont xxx`,fontawesome:加 `fa xxx`
  15. * }
  16. */
  17. // 扩展 RouteMeta 接口
  18. declare module 'vue-router' {
  19. interface RouteMeta {
  20. title?: string;
  21. isLink?: string;
  22. isHide?: boolean;
  23. isKeepAlive?: boolean;
  24. isAffix?: boolean;
  25. isIframe?: boolean;
  26. roles?: string[];
  27. icon?: string;
  28. }
  29. }
  30. /**
  31. * 定义404、401界面
  32. * @link 参考:https://next.router.vuejs.org/zh/guide/essentials/history-mode.html#netlify
  33. */
  34. export const notFoundAndNoPower = [
  35. {
  36. path: '/:path(.*)*',
  37. name: 'notFound',
  38. component: () => import('/@/views/error/404.vue'),
  39. meta: {
  40. title: 'message.staticRoutes.notFound',
  41. isHide: true,
  42. },
  43. },
  44. {
  45. path: '/401',
  46. name: 'noPower',
  47. component: () => import('/@/views/error/401.vue'),
  48. meta: {
  49. title: 'message.staticRoutes.noPower',
  50. isHide: true,
  51. },
  52. },
  53. ];
  54. /**
  55. * 前端路由
  56. * 此路由不要动,前端添加路由的话,请在 `dynamicRoutes 数组` 中添加
  57. * @description 前端控制直接改 dynamicRoutes 中的路由,后端控制不需要修改,请求接口路由数据时,会覆盖 dynamicRoutes 第一个顶级 children 的内容(全屏,不包含 layout 中的路由出口)
  58. * @returns 返回路由菜单数据
  59. */
  60. export const staticRoutes: Array<RouteRecordRaw> = [
  61. {
  62. path: '/login',
  63. name: 'login',
  64. component: () => import('/@/views/login/index.vue'),
  65. meta: {
  66. title: '登录',
  67. },
  68. },
  69. ];
  70. /**
  71. * 管理后台的路由 },
  72. */
  73. export const adminRoutes: Array<RouteRecordRaw> = [
  74. {
  75. path: '/',
  76. name: 'admin',
  77. component: () => import('/@/layout/index.vue'),
  78. redirect: '/home',
  79. meta: {
  80. isKeepAlive: true,
  81. title: 'iWash管理后台'
  82. },
  83. children: [
  84. {
  85. path: '/home',
  86. name: 'adminHome1',
  87. component: () => import('/@/views/admin/index.vue'),
  88. meta: {
  89. title: '信息总览',
  90. isLink: '',
  91. isHide: false,
  92. isKeepAlive: true,
  93. isAffix: false,
  94. isIframe: false,
  95. icon: 'ele-Monitor',
  96. color: 'yellow'
  97. // perm:'admin'
  98. }
  99. },
  100. // {
  101. // path: '/kanban',
  102. // name: 'adminKanban',
  103. // component: () => import('/@/views/admin/kanban/index.vue'),
  104. // meta: {
  105. // title: '数据看板',
  106. // isLink: '',
  107. // isHide: false,
  108. // isKeepAlive: true,
  109. // isAffix: false,
  110. // isIframe: false,
  111. // icon: 'ele-PictureRounded',
  112. // perm:"kanban.list",
  113. // }
  114. // },
  115. {
  116. path: '/station',
  117. name: 'adminStation',
  118. component: () => import('/@/layout/routerView/parent.vue'),
  119. redirect: '/station/list',
  120. meta: {
  121. title: '洗车站',
  122. isLink: '',
  123. isHide: false,
  124. isKeepAlive: true,
  125. isAffix: false,
  126. isIframe: false,
  127. icon: 'ele-MapLocation',
  128. perm:"equipment.list,station.list,stationStatMonth.list,statement.list",
  129. },
  130. children: [
  131. {
  132. path: '/station/list',
  133. name: 'adminStationList',
  134. component: () => import('/@/views/admin/station/list/index.vue'),
  135. meta: {
  136. title: '网点清单',
  137. isLink: '',
  138. isHide: false,
  139. isKeepAlive: true,
  140. isAffix: false,
  141. isIframe: false,
  142. perm:"station.list",
  143. icon: 'ele-OfficeBuilding',
  144. },
  145. },
  146. {
  147. path: '/station/device/:id',
  148. name: 'adminStationDevice',
  149. component: () => import('/@/views/admin/station/device/index.vue'),
  150. meta: {
  151. title: '洗车机',
  152. isLink: '',
  153. isHide: false,
  154. isKeepAlive: true,
  155. isAffix: false,
  156. isIframe: false,
  157. perm:"equipment.list",
  158. icon: 'ele-User',
  159. },
  160. },
  161. // {
  162. // path: '/station/statMonth',
  163. // name: 'adminStationStatMonth',
  164. // component: () => import('/@/views/admin/station/stat/index.vue'),
  165. // meta: {
  166. // title: '站点月表',
  167. // isLink: '',
  168. // isHide: false,
  169. // isKeepAlive: true,
  170. // isAffix: false,
  171. // isIframe: false,
  172. // perm:"stationStatMonth.list",
  173. // icon: 'ele-Histogram',
  174. // },
  175. // },
  176. // {
  177. // path: '/station/statement',
  178. // name: 'adminStatement',
  179. // component: () => import('/@/views/admin/station/statment/index.vue'),
  180. // meta: {
  181. // title: '对账单',
  182. // isLink: '',
  183. // isHide: false,
  184. // isKeepAlive: true,
  185. // isAffix: false,
  186. // isIframe: false,
  187. // perm:"statement.list",
  188. // icon: 'ele-CreditCard',
  189. // },
  190. // },
  191. ]
  192. },
  193. // {
  194. // path: '/investor',
  195. // name: 'adminInvestor',
  196. // component: () => import('/@/views/admin/investor/index.vue'),
  197. // meta: {
  198. // title: '投资者/物业',
  199. // isLink: '',
  200. // isHide: false,
  201. // isKeepAlive: true,
  202. // isAffix: false,
  203. // isIframe: false,
  204. // icon: 'ele-Avatar',
  205. // perm:"investor.list",
  206. // }
  207. // },
  208. {
  209. path: '/banner',
  210. name: 'adminBanner',
  211. component: () => import('/@/views/admin/banner/index.vue'),
  212. meta: {
  213. title: '横幅广告',
  214. isLink: '',
  215. isHide: false,
  216. isKeepAlive: true,
  217. isAffix: false,
  218. isIframe: false,
  219. icon: 'ele-PictureRounded',
  220. perm:"banner.list",
  221. }
  222. },
  223. {
  224. path: '/ordering',
  225. name: 'adminOrdering',
  226. component: () => import('/@/views/admin/ordering/index.vue'),
  227. meta: {
  228. title: '订单管理',
  229. isLink: '',
  230. isHide: false,
  231. isKeepAlive: true,
  232. isAffix: false,
  233. isIframe: false,
  234. icon: 'ele-Money',
  235. perm:"order.list",
  236. }
  237. },
  238. {
  239. path: '/account',
  240. name: 'adminAccount',
  241. component: () => import('/@/views/admin/account/index.vue'),
  242. meta: {
  243. title: '用户列表',
  244. isLink: '',
  245. isHide: false,
  246. isKeepAlive: true,
  247. isAffix: false,
  248. isIframe: false,
  249. icon: 'ele-User',
  250. perm:"account.list",
  251. }
  252. },
  253. {
  254. path: '/finance',
  255. name: 'adminFinance',
  256. component: () => import('/@/views/admin/finance/index.vue'),
  257. meta: {
  258. title: '充值记录',
  259. isLink: '',
  260. isHide: false,
  261. isKeepAlive: true,
  262. isAffix: false,
  263. isIframe: false,
  264. icon: 'ele-Wallet',
  265. perm:"recharge.list",
  266. },
  267. },
  268. {
  269. path: '/org',
  270. name: 'adminOrg',
  271. component: () => import('/@/layout/routerView/parent.vue'),
  272. redirect: '/admin/org/department',
  273. meta: {
  274. title: '系统配置',
  275. isLink: '',
  276. isHide: false,
  277. isKeepAlive: true,
  278. isAffix: false,
  279. isIframe: false,
  280. icon: 'ele-Tools',
  281. perm:"user.list,role.list,dict.list",
  282. },
  283. children: [
  284. {
  285. path: '/org/user',
  286. name: 'orgUser',
  287. component: () => import('/@/views/admin/user/index.vue'),
  288. meta: {
  289. title: '运维用户',
  290. isLink: '',
  291. isHide: false,
  292. isKeepAlive: true,
  293. isAffix: false,
  294. isIframe: false,
  295. perm:"user.list",
  296. icon: 'ele-User',
  297. },
  298. },
  299. {
  300. path: '/org/role',
  301. name: 'orgRole',
  302. component: () => import('/@/views/admin/role/index.vue'),
  303. meta: {
  304. title: '角色权限',
  305. isLink: '',
  306. isHide: false,
  307. isKeepAlive: true,
  308. isAffix: false,
  309. isIframe: false,
  310. perm:"role.list",
  311. icon: 'ele-Compass',
  312. },
  313. },
  314. {
  315. path: '/org/dict',
  316. name: 'orgDict',
  317. component: () => import('/@/views/admin/dict/index.vue'),
  318. meta: {
  319. title: '数据字典',
  320. isLink: '',
  321. isHide: false,
  322. isKeepAlive: true,
  323. isAffix: false,
  324. isIframe: false,
  325. perm:"dict.list",
  326. icon: 'ele-Collection',
  327. },
  328. },
  329. {
  330. path: '/org/faq',
  331. name: 'adminFaq',
  332. component: () => import('/@/views/admin/faq/index.vue'),
  333. meta: {
  334. title: '常见问题',
  335. isLink: '',
  336. isHide: false,
  337. isKeepAlive: true,
  338. isAffix: false,
  339. isIframe: false,
  340. icon: 'ele-Tickets',
  341. perm:"",
  342. },
  343. },
  344. {
  345. path: '/org/feedback',
  346. name: 'adminFeedback',
  347. component: () => import('/@/views/admin/feedback/index.vue'),
  348. meta: {
  349. title: '反馈上报',
  350. isLink: '',
  351. isHide: false,
  352. isKeepAlive: true,
  353. isAffix: false,
  354. isIframe: false,
  355. icon: 'ele-Tickets',
  356. perm:"",
  357. },
  358. },
  359. ]
  360. },
  361. /* {
  362. path: '/optList',
  363. name: 'adminOptList',
  364. component: () => import('/@/views/admin/log/opt/index.vue'),
  365. meta: {
  366. title: '操作日志',
  367. isLink: '',
  368. isHide: false,
  369. isKeepAlive: true,
  370. isAffix: false,
  371. isIframe: false,
  372. icon: 'ele-Cpu',
  373. }
  374. },*/
  375. ],
  376. },
  377. ]