index.js 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. import Layout from '@/layouts'
  4. import EmptyLayout from '@/layouts/EmptyLayout'
  5. import { publicPath, routerMode } from '@/config'
  6. Vue.use(VueRouter)
  7. export const constantRoutes = [
  8. {
  9. path: '/login',
  10. component: () => import('@/views/login/index'),
  11. hidden: true,
  12. },
  13. {
  14. path: '/register',
  15. component: () => import('@/views/register/index'),
  16. hidden: true,
  17. },
  18. {
  19. path: '/401',
  20. name: '401',
  21. component: () => import('@/views/401'),
  22. hidden: true,
  23. },
  24. {
  25. path: '/404',
  26. name: '404',
  27. component: () => import('@/views/404'),
  28. hidden: true,
  29. },
  30. ]
  31. export const asyncRoutes = [
  32. {
  33. path: '/',
  34. component: Layout,
  35. redirect: '/index',
  36. children: [
  37. {
  38. path: 'index',
  39. name: 'Index',
  40. component: () => import('@/views/index/index'),
  41. meta: {
  42. title: '计划电量',
  43. icon: 'home',
  44. affix: true,
  45. },
  46. },
  47. ],
  48. },
  49. {
  50. path: "/indicators",
  51. component: Layout,
  52. redirect: "noRedirect",
  53. children: [
  54. {
  55. path: "indicators",
  56. name: "indicators",
  57. component: () => import("@/views/indicators/index"),
  58. meta: {
  59. title: "指标录入",
  60. icon: "marker",
  61. permissions: ["admin"],
  62. },
  63. },
  64. ],
  65. },
  66. {
  67. path: '/stationConfiguration',
  68. component: Layout,
  69. redirect: 'noRedirect',
  70. name: 'stationConfiguration',
  71. meta: { title: '场站配置', icon: 'tools', permissions: ['admin'] },
  72. children: [
  73. {
  74. path: 'company',
  75. name: 'company',
  76. component: () =>
  77. import('@/views/stationConfiguration/company/index'),
  78. meta: { title: '公司管理' },
  79. },
  80. {
  81. path: 'area',
  82. name: 'area',
  83. component: () =>
  84. import('@/views/stationConfiguration/area/index'),
  85. meta: { title: '区域管理' },
  86. },
  87. {
  88. path: 'station',
  89. name: 'station',
  90. component: () =>
  91. import('@/views/stationConfiguration/station/index'),
  92. meta: { title: '场站管理' },
  93. },
  94. {
  95. path: 'period',
  96. name: 'period',
  97. component: () =>
  98. import('@/views/stationConfiguration/period/index'),
  99. meta: { title: '期次管理' },
  100. },
  101. {
  102. path: 'line',
  103. name: 'line',
  104. component: () =>
  105. import('@/views/stationConfiguration/line/index'),
  106. meta: { title: '线路管理' },
  107. },
  108. {
  109. path: 'windterbin',
  110. name: 'windterbin',
  111. component: () =>
  112. import('@/views/stationConfiguration/windterbin/index'),
  113. meta: { title: '风机管理' },
  114. },
  115. {
  116. path: 'equipmentmodel',
  117. name: 'equipmentmodel',
  118. component: () =>
  119. import('@/views/stationConfiguration/equipmentmodel/index'),
  120. meta: { title: '设备型号' },
  121. },
  122. {
  123. path: 'manufacturer',
  124. name: 'manufacturer',
  125. component: () =>
  126. import('@/views/stationConfiguration/manufacturer/index'),
  127. meta: { title: '设备厂商' },
  128. },
  129. {
  130. path: 'modelpower',
  131. name: 'modelpower',
  132. component: () =>
  133. import('@/views/stationConfiguration/modelpower/index'),
  134. meta: { title: '设备类型' },
  135. },
  136. {
  137. path: 'windsubstation',
  138. name: 'windsubstation',
  139. component: () =>
  140. import('@/views/stationConfiguration/windsubstation/index'),
  141. meta: { title: '变电所' },
  142. },
  143. {
  144. path: 'projectstudy',
  145. name: 'projectstudy',
  146. component: () =>
  147. import('@/views/stationConfiguration/projectstudy/index'),
  148. meta: { title: '可研电量' },
  149. },
  150. {
  151. path: 'admlist',
  152. name: 'admlist',
  153. component: () =>
  154. import('@/views/stationConfiguration/admlist/index'),
  155. meta: { title: '装机量管理' },
  156. },
  157. ],
  158. },
  159. {
  160. path: "/meterpoint",
  161. component: Layout,
  162. redirect: "noRedirect",
  163. children: [
  164. {
  165. path: "meterpoint",
  166. name: "meterpoint",
  167. component: () => import("@/views/meterpoint/index"),
  168. meta: {
  169. title: "电计量配置",
  170. icon: "allergies",
  171. permissions: ["admin"],
  172. },
  173. },
  174. ],
  175. },
  176. {
  177. path: "/realDatabaseConfig",
  178. component: Layout,
  179. redirect: "noRedirect",
  180. children: [
  181. {
  182. path: "realDatabaseConfig",
  183. name: "realDatabaseConfig",
  184. component: () => import("@/views/realDatabaseConfig/index"),
  185. meta: {
  186. title: "实时数据库配置",
  187. icon: "allergies",
  188. permissions: ["admin"],
  189. },
  190. },
  191. ],
  192. },
  193. // {
  194. // path: "/equipmentAllocation",
  195. // component: Layout,
  196. // redirect: "noRedirect",
  197. // children: [
  198. // {
  199. // path: "equipmentAllocation",
  200. // name: "equipmentAllocation",
  201. // component: () => import("@/views/pointConfiguration/equipmentAllocation/index"),
  202. // meta: {
  203. // title: "设备点表配置",
  204. // icon: "marker",
  205. // permissions: ["admin"],
  206. // },
  207. // },
  208. // ],
  209. // },
  210. // {
  211. // path: "/stationAllocation",
  212. // component: Layout,
  213. // redirect: "noRedirect",
  214. // children: [
  215. // {
  216. // path: "stationAllocation",
  217. // name: "stationAllocation",
  218. // component: () => import("@/views/pointConfiguration/stationAllocation/index"),
  219. // meta: {
  220. // title: "场站点表配置",
  221. // icon: "marker",
  222. // permissions: ["admin"],
  223. // },
  224. // },
  225. // ],
  226. // },
  227. // {
  228. // path: '/personnelManagement',
  229. // component: Layout,
  230. // redirect: 'noRedirect',
  231. // name: 'PersonnelManagement',
  232. // meta: { title: '配置', icon: 'users-cog', permissions: ['admin'] },
  233. // children: [
  234. // {
  235. // path: 'userManagement',
  236. // name: 'UserManagement',
  237. // component: () =>
  238. // import('@/views/personnelManagement/userManagement/index'),
  239. // meta: { title: '用户管理' },
  240. // },
  241. // {
  242. // path: 'roleManagement',
  243. // name: 'RoleManagement',
  244. // component: () =>
  245. // import('@/views/personnelManagement/roleManagement/index'),
  246. // meta: { title: '角色管理' },
  247. // },
  248. // {
  249. // path: 'menuManagement',
  250. // name: 'MenuManagement',
  251. // component: () =>
  252. // import('@/views/personnelManagement/menuManagement/index'),
  253. // meta: { title: '菜单管理' },
  254. // },
  255. // ],
  256. // },
  257. // {
  258. // path: '/error',
  259. // component: EmptyLayout,
  260. // redirect: 'noRedirect',
  261. // name: 'Error',
  262. // meta: { title: '错误页', icon: 'bug' },
  263. // children: [
  264. // {
  265. // path: '401',
  266. // name: 'Error401',
  267. // component: () => import('@/views/401'),
  268. // meta: { title: '401' },
  269. // },
  270. // {
  271. // path: '404',
  272. // name: 'Error404',
  273. // component: () => import('@/views/404'),
  274. // meta: { title: '404' },
  275. // },
  276. // ],
  277. // },
  278. ]
  279. const router = new VueRouter({
  280. base: publicPath,
  281. mode: routerMode,
  282. scrollBehavior: () => ({
  283. y: 0,
  284. }),
  285. routes: constantRoutes,
  286. })
  287. export function resetRouter() {
  288. location.reload()
  289. }
  290. export default router