index.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. import { createRouter, createWebHashHistory } from 'vue-router'
  2. const routes = [
  3. {
  4. path: '/',
  5. redirect: '/home'
  6. },
  7. {
  8. name: 'login',
  9. path: '/login',
  10. component: () => import('../views/login'),
  11. meta: {
  12. title: '登录',
  13. },
  14. },
  15. {
  16. name: 'home',
  17. path: '/home',
  18. component: () => import('../views/home'),
  19. meta: {
  20. title: '首页',
  21. },
  22. },
  23. {
  24. name: 'userInfo',
  25. path: '/userInfo',
  26. component: () => import('../views/userInfo'),
  27. meta: {
  28. title: '账号中心',
  29. },
  30. },
  31. {
  32. name: 'repairOnline',
  33. path: '/repairOnline',
  34. component: () => import('../views/repairOnline'),
  35. meta: {
  36. title: '线上报修',
  37. },
  38. },
  39. {
  40. name: 'reviewCheck',
  41. path: '/reviewCheck',
  42. component: () => import('../views/reviewCheck'),
  43. meta: {
  44. title: '巡检记录',
  45. },
  46. },
  47. {
  48. name: 'reduceRecord',
  49. path: '/reduceRecord',
  50. component: () => import('../views/reduceRecord'),
  51. meta: {
  52. title: '扣缴记录',
  53. },
  54. },
  55. {
  56. name: 'deviceAlarm',
  57. path: '/deviceAlarm',
  58. component: () => import('../views/deviceAlarm'),
  59. meta: {
  60. title: '设备异常',
  61. },
  62. },
  63. {
  64. name: 'lackFee',
  65. path: '/lackFee',
  66. component: () => import('../views/lackFee'),
  67. meta: {
  68. title: '欠费待收',
  69. },
  70. },
  71. {
  72. name: 'remoteControl',
  73. path: '/remoteControl',
  74. component: () => import('../views/remoteControl'),
  75. meta: {
  76. title: '远程管控',
  77. },
  78. },
  79. {
  80. name: 'repairList',
  81. path: '/repairList',
  82. component: () => import('../views/repairList'),
  83. meta: {
  84. title: '工单待办',
  85. },
  86. },
  87. {
  88. name: 'repairDetail',
  89. path: '/repairDetail',
  90. component: () => import('../views/repairDetail'),
  91. meta: {
  92. title: '工单详情',
  93. },
  94. },
  95. {
  96. name: 'rentBill',
  97. path: '/rentBill',
  98. component: () => import('../views/rentBill'),
  99. meta: {
  100. title: '租户账单',
  101. },
  102. }
  103. ,
  104. {
  105. name: 'rentBillDetail',
  106. path: '/rentBillDetail',
  107. component: () => import('../views/rentBillDetail'),
  108. meta: {
  109. title: '账单明细',
  110. },
  111. }
  112. ,
  113. {
  114. name: 'checkClock',
  115. path: '/checkClock',
  116. component: () => import('../views/checkClock'),
  117. meta: {
  118. title: '巡检打卡',
  119. },
  120. }
  121. // {
  122. // path: '/alllist',
  123. // name: '全部人员列表',
  124. // component: () => import(/* webpackChunkName: "about" */ '../views/alllist.vue')
  125. // },
  126. ]
  127. const router = createRouter({
  128. history: createWebHashHistory(),
  129. routes
  130. })
  131. // 全局前置守卫,设置页面标题
  132. router.beforeEach((to, from, next) => {
  133. // const title = to.meta && to.meta.title;
  134. // if (title) {
  135. // document.title = title;
  136. // }
  137. document.title = '双碳感知资产运营管理平台';
  138. next(); //必须写
  139. });
  140. export default router