route.ts 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731
  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. * 菜单分组说明:
  74. * 信息总览 — 首页仪表盘
  75. * 站点管理 — 站点清单、设备、站点账户、故障订阅
  76. * 用户管理 — 用户列表、用户资金流
  77. * 订单管理 — 订单记录
  78. * 财务管理 — 充值、退款、提现、结算、分账、线下充值
  79. * 营销管理 — 横幅广告、专属优惠活动
  80. * 平台配置 — 平台费率、设备配置、充值配置
  81. * 系统管理 — 运维用户、角色权限、数据字典、操作日志
  82. * 运营管理 — 公告、消息、模板、FAQ、反馈
  83. */
  84. export const adminRoutes: Array<RouteRecordRaw> = [
  85. {
  86. path: '/',
  87. name: 'admin',
  88. component: () => import('/@/layout/index.vue'),
  89. redirect: '/home',
  90. meta: {
  91. isKeepAlive: true,
  92. title: 'Yeswash管理后台'
  93. },
  94. children: [
  95. // ==================== 1. 信息总览 ====================
  96. {
  97. path: '/home',
  98. name: 'adminHome1',
  99. component: () => import('/@/views/admin/index.vue'),
  100. meta: {
  101. title: '信息总览',
  102. isLink: '',
  103. isHide: false,
  104. isKeepAlive: true,
  105. isAffix: false,
  106. isIframe: false,
  107. icon: 'ele-Monitor',
  108. }
  109. },
  110. // ==================== 2. 站点管理 ====================
  111. {
  112. path: '/station',
  113. name: 'adminStation',
  114. component: () => import('/@/layout/routerView/parent.vue'),
  115. redirect: '/station/list',
  116. meta: {
  117. title: '站点管理',
  118. isLink: '',
  119. isHide: false,
  120. isKeepAlive: true,
  121. isAffix: false,
  122. isIframe: false,
  123. icon: 'ele-MapLocation',
  124. perm: "washDevice.list,washStation.list,faultSubscriber.list,faultRecord.list",
  125. },
  126. children: [
  127. {
  128. path: '/station/list',
  129. name: 'adminStationList',
  130. component: () => import('/@/views/admin/station/list/index.vue'),
  131. meta: {
  132. title: '站点清单',
  133. isLink: '',
  134. isHide: false,
  135. isKeepAlive: true,
  136. isAffix: false,
  137. isIframe: false,
  138. perm: "washStation.list",
  139. icon: 'ele-OfficeBuilding',
  140. },
  141. },
  142. {
  143. path: '/station/device/:id',
  144. name: 'adminStationDevice',
  145. component: () => import('/@/views/admin/station/device/index.vue'),
  146. meta: {
  147. title: '设备清单',
  148. isLink: '',
  149. isHide: false,
  150. isKeepAlive: true,
  151. isAffix: false,
  152. isIframe: false,
  153. perm: "washDevice.list",
  154. icon: 'ele-Cpu',
  155. },
  156. },
  157. {
  158. path: '/station/account',
  159. name: 'adminStationAccount',
  160. component: () => import('/@/views/admin/station/account/index.vue'),
  161. meta: {
  162. title: '站点账户',
  163. isLink: '',
  164. isHide: false,
  165. isKeepAlive: true,
  166. isAffix: false,
  167. isIframe: false,
  168. perm: "washDevice.list",
  169. icon: 'ele-Wallet',
  170. },
  171. },
  172. {
  173. path: '/station/fault',
  174. name: 'adminStationFault',
  175. component: () => import('/@/views/admin/station/fault/index.vue'),
  176. meta: {
  177. title: '故障订阅',
  178. isLink: '',
  179. isHide: false,
  180. isKeepAlive: true,
  181. isAffix: false,
  182. isIframe: false,
  183. perm: "faultSubscriber.list",
  184. icon: 'ele-Bell',
  185. },
  186. },
  187. ]
  188. },
  189. // ==================== 3. 用户管理 ====================
  190. {
  191. path: '/user',
  192. name: 'adminUser',
  193. component: () => import('/@/layout/routerView/parent.vue'),
  194. redirect: '/account',
  195. meta: {
  196. title: '用户管理',
  197. isLink: '',
  198. isHide: false,
  199. isKeepAlive: true,
  200. isAffix: false,
  201. isIframe: false,
  202. icon: 'ele-User',
  203. perm: "account.list",
  204. },
  205. children: [
  206. {
  207. path: '/account',
  208. name: 'adminAccount',
  209. component: () => import('/@/views/admin/account/index.vue'),
  210. meta: {
  211. title: '用户列表',
  212. isLink: '',
  213. isHide: false,
  214. isKeepAlive: true,
  215. isAffix: false,
  216. isIframe: false,
  217. icon: 'ele-List',
  218. perm: "account.list",
  219. }
  220. },
  221. {
  222. path: '/walletFlow',
  223. name: 'adminFinanceWalletFlow',
  224. component: () => import('/@/views/admin/finance/wallet-flow.vue'),
  225. meta: {
  226. title: '用户资金流',
  227. isLink: '',
  228. isHide: false,
  229. isKeepAlive: true,
  230. isAffix: false,
  231. isIframe: false,
  232. icon: 'ele-Money',
  233. perm: "",
  234. },
  235. },
  236. ]
  237. },
  238. // ==================== 4. 订单管理 ====================
  239. {
  240. path: '/ordering',
  241. name: 'adminOrdering',
  242. component: () => import('/@/views/admin/ordering/index.vue'),
  243. meta: {
  244. title: '订单管理',
  245. isLink: '',
  246. isHide: false,
  247. isKeepAlive: true,
  248. isAffix: false,
  249. isIframe: false,
  250. icon: 'ele-Document',
  251. perm: "washOrder.list",
  252. }
  253. },
  254. // ==================== 5. 财务管理 ====================
  255. {
  256. path: '/finance',
  257. name: 'adminFinance',
  258. component: () => import('/@/layout/routerView/parent.vue'),
  259. redirect: '/finance/recharge',
  260. meta: {
  261. title: '财务管理',
  262. isLink: '',
  263. isHide: false,
  264. isKeepAlive: true,
  265. isAffix: false,
  266. isIframe: false,
  267. icon: 'ele-Money',
  268. perm: "recharge.list,refundLog.list,withdrawnRecord.list,settlement.list,offlineRecharge",
  269. },
  270. children: [
  271. {
  272. path: '/finance/recharge',
  273. name: 'adminFinanceRecharge',
  274. component: () => import('/@/views/admin/finance/index.vue'),
  275. meta: {
  276. title: '充值记录',
  277. isLink: '',
  278. isHide: false,
  279. isKeepAlive: true,
  280. isAffix: false,
  281. isIframe: false,
  282. icon: 'ele-Finished',
  283. perm: "recharge.list",
  284. },
  285. },
  286. {
  287. path: '/offlineRecharge',
  288. name: 'adminOfflineRecharge',
  289. component: () => import('/@/views/admin/finance/offline-recharge.vue'),
  290. meta: {
  291. title: '线下充值',
  292. isLink: '',
  293. isHide: false,
  294. isKeepAlive: true,
  295. isAffix: false,
  296. isIframe: false,
  297. icon: 'ele-Sell',
  298. perm: "offlineRecharge",
  299. },
  300. },
  301. {
  302. path: '/refund',
  303. name: 'adminFinanceRefund',
  304. component: () => import('/@/views/admin/finance/refund.vue'),
  305. meta: {
  306. title: '退款清单',
  307. isLink: '',
  308. isHide: false,
  309. isKeepAlive: true,
  310. isAffix: false,
  311. isIframe: false,
  312. icon: 'ele-Warning',
  313. perm: "refundLog.list",
  314. },
  315. },
  316. {
  317. path: '/withdraw',
  318. name: 'adminFinanceWithdraw',
  319. component: () => import('/@/views/admin/finance/withdraw.vue'),
  320. meta: {
  321. title: '提现记录',
  322. isLink: '',
  323. isHide: false,
  324. isKeepAlive: true,
  325. isAffix: false,
  326. isIframe: false,
  327. icon: 'ele-Wallet',
  328. perm: "withdrawnRecord.list",
  329. },
  330. },
  331. {
  332. path: '/finance/settlement',
  333. name: 'adminFinanceSettlement',
  334. component: () => import('/@/views/admin/finance/settlement.vue'),
  335. meta: {
  336. title: '结算记录',
  337. isLink: '',
  338. isHide: false,
  339. isKeepAlive: true,
  340. isAffix: false,
  341. isIframe: false,
  342. icon: 'ele-Calendar',
  343. perm: "settlement.list",
  344. },
  345. },
  346. {
  347. path: '/financeSR',
  348. name: 'adminSplitRecord',
  349. component: () => import('/@/views/admin/finance/splitRecord.vue'),
  350. meta: {
  351. title: '分账记录',
  352. isLink: '',
  353. isHide: false,
  354. isKeepAlive: true,
  355. isAffix: false,
  356. isIframe: false,
  357. icon: 'ele-Connection',
  358. perm: "recharge.list",
  359. },
  360. },
  361. ]
  362. },
  363. // ==================== 6. 数据统计 ====================
  364. {
  365. path: '/statistics',
  366. name: 'adminStatistics',
  367. component: () => import('/@/layout/routerView/parent.vue'),
  368. redirect: '/statistics/dailyStat',
  369. meta: {
  370. title: '数据统计',
  371. isLink: '',
  372. isHide: false,
  373. isKeepAlive: true,
  374. isAffix: false,
  375. isIframe: false,
  376. icon: 'ele-DataAnalysis',
  377. perm: "dailyStat.list,monthStat.list",
  378. },
  379. children: [
  380. {
  381. path: '/statistics/dailyStat',
  382. name: 'adminStatisticsDailyStat',
  383. component: () => import('/@/views/admin/statistics/daily-stat.vue'),
  384. meta: {
  385. title: '日统计',
  386. isLink: '',
  387. isHide: false,
  388. isKeepAlive: true,
  389. isAffix: false,
  390. isIframe: false,
  391. icon: 'ele-DataLine',
  392. perm: "dailyStat.list",
  393. },
  394. },
  395. {
  396. path: '/statistics/monthStat',
  397. name: 'adminStatisticsMonthStat',
  398. component: () => import('/@/views/admin/statistics/month-stat.vue'),
  399. meta: {
  400. title: '月统计',
  401. isLink: '',
  402. isHide: false,
  403. isKeepAlive: true,
  404. isAffix: false,
  405. isIframe: false,
  406. icon: 'ele-PieChart',
  407. perm: "monthStat.list",
  408. },
  409. },
  410. ]
  411. },
  412. // ==================== 7. 营销管理 ====================
  413. {
  414. path: '/marketing',
  415. name: 'adminMarketing',
  416. component: () => import('/@/layout/routerView/parent.vue'),
  417. redirect: '/banner',
  418. meta: {
  419. title: '营销管理',
  420. isLink: '',
  421. isHide: false,
  422. isKeepAlive: true,
  423. isAffix: false,
  424. isIframe: false,
  425. icon: 'ele-Promotion',
  426. perm: "banner.list,promotion.list,parkingCouponRecord.list",
  427. },
  428. children: [
  429. {
  430. path: '/banner',
  431. name: 'adminBanner',
  432. component: () => import('/@/views/admin/banner/index.vue'),
  433. meta: {
  434. title: '横幅广告',
  435. isLink: '',
  436. isHide: false,
  437. isKeepAlive: true,
  438. isAffix: false,
  439. isIframe: false,
  440. icon: 'ele-PictureRounded',
  441. perm: "banner.list",
  442. }
  443. },
  444. {
  445. path: '/platform/rechargePromotion',
  446. name: 'adminPlatformRechargePromotion',
  447. component: () => import('/@/views/admin/platform/rechargePromotion/index.vue'),
  448. meta: {
  449. title: '专属优惠活动',
  450. isLink: '',
  451. isHide: false,
  452. isKeepAlive: true,
  453. isAffix: false,
  454. isIframe: false,
  455. perm: "promotion.list",
  456. icon: 'ele-Present',
  457. },
  458. },
  459. {
  460. path: '/marketing/parkingCouponRecord',
  461. name: 'adminParkingCouponRecord',
  462. component: () => import('/@/views/admin/parking-coupon-record/index.vue'),
  463. meta: {
  464. title: '停车券发放记录',
  465. isLink: '',
  466. isHide: false,
  467. isKeepAlive: true,
  468. isAffix: false,
  469. isIframe: false,
  470. perm: "parkingCouponRecord.list",
  471. icon: 'ele-Tickets',
  472. },
  473. },
  474. ]
  475. },
  476. // ==================== 7. 平台配置 ====================
  477. {
  478. path: '/platform',
  479. name: 'adminPlatform',
  480. component: () => import('/@/layout/routerView/parent.vue'),
  481. redirect: '/platform/rate',
  482. meta: {
  483. title: '平台配置',
  484. isLink: '',
  485. isHide: false,
  486. isKeepAlive: true,
  487. isAffix: false,
  488. isIframe: false,
  489. icon: 'ele-Setting',
  490. perm: "platformFeeRate.list,rechargeConfig.list",
  491. },
  492. children: [
  493. {
  494. path: '/platform/rate',
  495. name: 'adminPlatformRate',
  496. component: () => import('/@/views/admin/platform/rate/index.vue'),
  497. meta: {
  498. title: '平台费率',
  499. isLink: '',
  500. isHide: false,
  501. isKeepAlive: true,
  502. isAffix: false,
  503. isIframe: false,
  504. perm: "platformFeeRate.list",
  505. icon: 'ele-Money',
  506. },
  507. },
  508. {
  509. path: '/platform/deviceConfig',
  510. name: 'adminPlatformDeviceConfig',
  511. component: () => import('/@/views/admin/platform/deviceConfig/index.vue'),
  512. meta: {
  513. title: '设备配置',
  514. isLink: '',
  515. isHide: false,
  516. isKeepAlive: true,
  517. isAffix: false,
  518. isIframe: false,
  519. perm: "platformFeeRate.list",
  520. icon: 'ele-Cpu',
  521. },
  522. },
  523. {
  524. path: '/platform/rechargeConfig',
  525. name: 'adminPlatformRechargeConfig',
  526. component: () => import('/@/views/admin/platform/rechargeConfig/index.vue'),
  527. meta: {
  528. title: '充值配置',
  529. isLink: '',
  530. isHide: false,
  531. isKeepAlive: true,
  532. isAffix: false,
  533. isIframe: false,
  534. perm: "rechargeConfig.list",
  535. icon: 'ele-Tickets',
  536. },
  537. },
  538. ]
  539. },
  540. // ==================== 8. 系统管理 ====================
  541. {
  542. path: '/system',
  543. name: 'adminSystem',
  544. component: () => import('/@/layout/routerView/parent.vue'),
  545. redirect: '/org/user',
  546. meta: {
  547. title: '系统管理',
  548. isLink: '',
  549. isHide: false,
  550. isKeepAlive: true,
  551. isAffix: false,
  552. isIframe: false,
  553. icon: 'ele-Tools',
  554. perm: "user.list,role.list,dict.list",
  555. },
  556. children: [
  557. {
  558. path: '/org/user',
  559. name: 'orgUser',
  560. component: () => import('/@/views/admin/user/index.vue'),
  561. meta: {
  562. title: '运维用户',
  563. isLink: '',
  564. isHide: false,
  565. isKeepAlive: true,
  566. isAffix: false,
  567. isIframe: false,
  568. perm: "user.list",
  569. icon: 'ele-User',
  570. },
  571. },
  572. {
  573. path: '/org/role',
  574. name: 'orgRole',
  575. component: () => import('/@/views/admin/role/index.vue'),
  576. meta: {
  577. title: '角色权限',
  578. isLink: '',
  579. isHide: false,
  580. isKeepAlive: true,
  581. isAffix: false,
  582. isIframe: false,
  583. perm: "role.list",
  584. icon: 'ele-Compass',
  585. },
  586. },
  587. {
  588. path: '/org/dict',
  589. name: 'orgDict',
  590. component: () => import('/@/views/admin/dict/index.vue'),
  591. meta: {
  592. title: '数据字典',
  593. isLink: '',
  594. isHide: false,
  595. isKeepAlive: true,
  596. isAffix: false,
  597. isIframe: false,
  598. perm: "dict.list",
  599. icon: 'ele-Collection',
  600. },
  601. },
  602. {
  603. path: '/org/log',
  604. name: 'adminLog',
  605. component: () => import('/@/views/admin/log/opt/index.vue'),
  606. meta: {
  607. title: '操作日志',
  608. isLink: '',
  609. isHide: false,
  610. isKeepAlive: true,
  611. isAffix: false,
  612. isIframe: false,
  613. icon: 'ele-Document',
  614. perm: "",
  615. },
  616. },
  617. ]
  618. },
  619. // ==================== 9. 运营管理 ====================
  620. {
  621. path: '/operation',
  622. name: 'adminOperation',
  623. component: () => import('/@/layout/routerView/parent.vue'),
  624. redirect: '/org/notice',
  625. meta: {
  626. title: '运营管理',
  627. isLink: '',
  628. isHide: false,
  629. isKeepAlive: true,
  630. isAffix: false,
  631. isIframe: false,
  632. icon: 'ele-Notification',
  633. perm: "",
  634. },
  635. children: [
  636. {
  637. path: '/org/notice',
  638. name: 'adminNotice',
  639. component: () => import('/@/views/admin/notice/index.vue'),
  640. meta: {
  641. title: '系统公告',
  642. isLink: '',
  643. isHide: false,
  644. isKeepAlive: true,
  645. isAffix: false,
  646. isIframe: false,
  647. icon: 'ele-Bell',
  648. perm: "",
  649. },
  650. },
  651. {
  652. path: '/org/message',
  653. name: 'adminMessage',
  654. component: () => import('/@/views/admin/message/index.vue'),
  655. meta: {
  656. title: '消息管理',
  657. isLink: '',
  658. isHide: false,
  659. isKeepAlive: true,
  660. isAffix: false,
  661. isIframe: false,
  662. icon: 'ele-Message',
  663. perm: "",
  664. },
  665. },
  666. {
  667. path: '/org/template',
  668. name: 'adminTemplate',
  669. component: () => import('/@/views/admin/template/index.vue'),
  670. meta: {
  671. title: '消息模板',
  672. isLink: '',
  673. isHide: false,
  674. isKeepAlive: true,
  675. isAffix: false,
  676. isIframe: false,
  677. icon: 'ele-Files',
  678. perm: "",
  679. },
  680. },
  681. {
  682. path: '/org/faq',
  683. name: 'adminFaq',
  684. component: () => import('/@/views/admin/faq/index.vue'),
  685. meta: {
  686. title: '常见问题',
  687. isLink: '',
  688. isHide: false,
  689. isKeepAlive: true,
  690. isAffix: false,
  691. isIframe: false,
  692. icon: 'ele-Tickets',
  693. perm: "",
  694. },
  695. },
  696. {
  697. path: '/org/feedback',
  698. name: 'adminFeedback',
  699. component: () => import('/@/views/admin/feedback/index.vue'),
  700. meta: {
  701. title: '反馈上报',
  702. isLink: '',
  703. isHide: false,
  704. isKeepAlive: true,
  705. isAffix: false,
  706. isIframe: false,
  707. icon: 'ele-ChatLineSquare',
  708. perm: "",
  709. },
  710. },
  711. ]
  712. },
  713. ],
  714. },
  715. ]