router.config.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. import { UserLayout, TabLayout, RouteView, BlankLayout, PageView } from '@/components/layouts'
  2. /**
  3. * 走菜单,走权限控制
  4. * @type {[null,null]}
  5. */
  6. export const asyncRouterMap = [
  7. {
  8. path: '/',
  9. name: 'dashboard',
  10. component: TabLayout,
  11. meta: { title: '首页' },
  12. redirect: '/dashboard/analysis',
  13. children: [
  14. // // dashboard
  15. // {
  16. // path: '/dashboard',
  17. // name: 'dashboard',
  18. // redirect: '/dashboard/workplace',
  19. // component: RouteView,
  20. // meta: { title: '仪表盘', icon: 'dashboard', permission: [ 'dashboard' ] },
  21. // children: [
  22. // {
  23. // path: '/dashboard/analysis',
  24. // name: 'Analysis',
  25. // component: () => import('@/views/dashboard/Analysis'),
  26. // meta: { title: '分析页', permission: [ 'dashboard' ] }
  27. // },
  28. // {
  29. // path: '/dashboard/monitor',
  30. // name: 'Monitor',
  31. // hidden: true,
  32. // component: () => import('@/views/dashboard/Monitor'),
  33. // meta: { title: '监控页', permission: [ 'dashboard' ] }
  34. // },
  35. // {
  36. // path: '/dashboard/workplace',
  37. // name: 'Workplace',
  38. // component: () => import('@/views/dashboard/Workplace'),
  39. // meta: { title: '工作台', permission: [ 'dashboard' ] }
  40. // }
  41. // ]
  42. // },
  43. //
  44. // // forms
  45. // {
  46. // path: '/form',
  47. // redirect: '/form/basic-form',
  48. // component: PageView,
  49. // meta: { title: '表单页', icon: 'form', permission: [ 'form' ] },
  50. // children: [
  51. // {
  52. // path: '/form/base-form',
  53. // name: 'BaseForm',
  54. // component: () => import('@/views/form/BasicForm'),
  55. // meta: { title: '基础表单', permission: [ 'form' ] }
  56. // },
  57. // {
  58. // path: '/form/step-form',
  59. // name: 'StepForm',
  60. // component: () => import('@/views/form/stepForm/StepForm'),
  61. // meta: { title: '分步表单', permission: [ 'form' ] }
  62. // },
  63. // {
  64. // path: '/form/advanced-form',
  65. // name: 'AdvanceForm',
  66. // component: () => import('@/views/form/advancedForm/AdvancedForm'),
  67. // meta: { title: '高级表单', permission: [ 'form' ] }
  68. // }
  69. // ]
  70. // },
  71. //
  72. // // list
  73. // {
  74. // path: '/list',
  75. // name: 'list',
  76. // component: PageView,
  77. // redirect: '/list/query-list',
  78. // meta: { title: '列表页', icon: 'table', permission: [ 'table' ] },
  79. // children: [
  80. // {
  81. // path: '/list/query-list',
  82. // name: 'QueryList',
  83. // component: () => import('@/views/list/TableList'),
  84. // meta: { title: '查询表格', permission: [ 'table' ] }
  85. // },
  86. // {
  87. // path: '/list/edit-table',
  88. // name: 'EditList',
  89. // component: () => import('@/views/list/TableInnerEditList'),
  90. // meta: { title: '内联编辑表格', permission: [ 'table' ] }
  91. // },
  92. // {
  93. // path: '/list/user-list',
  94. // name: 'UserList',
  95. // component: () => import('@/views/list/UserList'),
  96. // meta: { title: '用户列表', permission: [ 'table' ] }
  97. // },
  98. // {
  99. // path: '/list/role-list',
  100. // name: 'RoleList',
  101. // component: () => import('@/views/list/RoleList'),
  102. // meta: { title: '角色列表', permission: [ 'table' ] }
  103. // },
  104. // {
  105. // path: '/list/permission-list',
  106. // name: 'PermissionList',
  107. // component: () => import('@/views/list/PermissionList'),
  108. // meta: { title: '权限列表', permission: [ 'table' ] }
  109. // },
  110. // {
  111. // path: '/list/basic-list',
  112. // name: 'BasicList',
  113. // component: () => import('@/views/list/StandardList'),
  114. // meta: { title: '标准列表', permission: [ 'table' ] }
  115. // },
  116. // {
  117. // path: '/list/card',
  118. // name: 'CardList',
  119. // component: () => import('@/views/list/CardList'),
  120. // meta: { title: '卡片列表', permission: [ 'table' ] }
  121. // },
  122. // {
  123. // path: '/list/search',
  124. // name: 'SearchList',
  125. // component: () => import('@/views/list/search/SearchLayout'),
  126. // redirect: '/list/search/article',
  127. // meta: { title: '搜索列表', permission: [ 'table' ] },
  128. // children: [
  129. // {
  130. // path: '/list/search/article',
  131. // name: 'SearchArticles',
  132. // component: () => import('../views/list/TableList'),
  133. // meta: { title: '搜索列表(文章)', permission: [ 'table' ] }
  134. // },
  135. // {
  136. // path: '/list/search/project',
  137. // name: 'SearchProjects',
  138. // component: () => import('../views/list/TableList'),
  139. // meta: { title: '搜索列表(项目)', permission: [ 'table' ] }
  140. // },
  141. // {
  142. // path: '/list/search/application',
  143. // name: 'SearchApplications',
  144. // component: () => import('../views/list/TableList'),
  145. // meta: { title: '搜索列表(应用)', permission: [ 'table' ] }
  146. // },
  147. // ]
  148. // },
  149. // ]
  150. // },
  151. //
  152. // // profile
  153. // {
  154. // path: '/profile',
  155. // name: 'profile',
  156. // component: RouteView,
  157. // redirect: '/profile/basic',
  158. // meta: { title: '详情页', icon: 'profile', permission: [ 'profile' ] },
  159. // children: [
  160. // {
  161. // path: '/profile/basic',
  162. // name: 'ProfileBasic',
  163. // component: () => import('@/views/profile/basic/Index'),
  164. // meta: { title: '基础详情页', permission: [ 'profile' ] }
  165. // },
  166. // {
  167. // path: '/profile/advanced',
  168. // name: 'ProfileAdvanced',
  169. // component: () => import('@/views/profile/advanced/Advanced'),
  170. // meta: { title: '高级详情页', permission: [ 'profile' ] }
  171. // }
  172. // ]
  173. // },
  174. //
  175. // // result
  176. // {
  177. // path: '/result',
  178. // name: 'result',
  179. // component: PageView,
  180. // redirect: '/result/success',
  181. // meta: { title: '结果页', icon: 'check-circle-o', permission: [ 'result' ] },
  182. // children: [
  183. // {
  184. // path: '/result/success',
  185. // name: 'ResultSuccess',
  186. // component: () => import(/* webpackChunkName: "result" */ '@/views/result/Success'),
  187. // meta: { title: '成功', hiddenHeaderContent: true, permission: [ 'result' ] }
  188. // },
  189. // {
  190. // path: '/result/fail',
  191. // name: 'ResultFail',
  192. // component: () => import(/* webpackChunkName: "result" */ '@/views/result/Error'),
  193. // meta: { title: '失败', hiddenHeaderContent: true, permission: [ 'result' ] }
  194. // }
  195. // ]
  196. // },
  197. //
  198. // // Exception
  199. // {
  200. // path: '/exception',
  201. // name: 'exception',
  202. // component: RouteView,
  203. // redirect: '/exception/403',
  204. // meta: { title: '异常页', icon: 'warning', permission: [ 'exception' ] },
  205. // children: [
  206. // {
  207. // path: '/exception/403',
  208. // name: 'Exception403',
  209. // component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/403'),
  210. // meta: { title: '403', permission: [ 'exception' ] }
  211. // },
  212. // {
  213. // path: '/exception/404',
  214. // name: 'Exception404',
  215. // component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404'),
  216. // meta: { title: '404', permission: [ 'exception' ] }
  217. // },
  218. // {
  219. // path: '/exception/500',
  220. // name: 'Exception500',
  221. // component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/500'),
  222. // meta: { title: '500', permission: [ 'exception' ] }
  223. // }
  224. // ]
  225. // },
  226. //
  227. // // account
  228. // {
  229. // path: '/account',
  230. // component: RouteView,
  231. // name: 'account',
  232. // meta: { title: '个人页', icon: 'user', keepAlive: true, permission: [ 'user' ] },
  233. // children: [
  234. // {
  235. // path: '/account/center',
  236. // name: 'center',
  237. // component: () => import('@/views/account/center/Index'),
  238. // meta: { title: '个人中心', keepAlive: true, permission: [ 'user' ] }
  239. // },
  240. // {
  241. // path: '/account/settings',
  242. // name: 'settings',
  243. // component: () => import('@/views/account/settings/Index'),
  244. // meta: { title: '个人设置', hideHeader: true, keepAlive: true, permission: [ 'user' ] },
  245. // redirect: '/account/settings/base',
  246. // alwaysShow: true,
  247. // children: [
  248. // {
  249. // path: '/account/settings/base',
  250. // name: 'BaseSettings',
  251. // component: () => import('@/views/account/settings/BaseSetting'),
  252. // meta: { title: '基本设置', hidden: true, keepAlive: true, permission: [ 'user' ] }
  253. // },
  254. // {
  255. // path: '/account/settings/security',
  256. // name: 'SecuritySettings',
  257. // component: () => import('@/views/account/settings/Security'),
  258. // meta: { title: '安全设置', hidden: true, keepAlive: true, permission: [ 'user' ] }
  259. // },
  260. // {
  261. // path: '/account/settings/custom',
  262. // name: 'CustomSettings',
  263. // component: () => import('@/views/account/settings/Custom'),
  264. // meta: { title: '个性化设置', hidden: true, keepAlive: true, permission: [ 'user' ] }
  265. // },
  266. // {
  267. // path: '/account/settings/binding',
  268. // name: 'BindingSettings',
  269. // component: () => import('@/views/account/settings/Binding'),
  270. // meta: { title: '账户绑定', hidden: true, keepAlive: true, permission: [ 'user' ] }
  271. // },
  272. // {
  273. // path: '/account/settings/notification',
  274. // name: 'NotificationSettings',
  275. // component: () => import('@/views/account/settings/Notification'),
  276. // meta: { title: '新消息通知', hidden: true, keepAlive: true, permission: [ 'user' ] }
  277. // },
  278. // ]
  279. // },
  280. // ]
  281. // }
  282. ]
  283. },
  284. {
  285. path: '*', redirect: '/404', hidden: true
  286. }
  287. ]
  288. /**
  289. * 基础路由
  290. * @type { *[] }
  291. */
  292. export const constantRouterMap = [
  293. {
  294. path: '/user',
  295. component: UserLayout,
  296. redirect: '/user/login',
  297. hidden: true,
  298. children: [
  299. {
  300. path: 'login',
  301. name: 'login',
  302. component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
  303. },
  304. {
  305. path: 'register',
  306. name: 'register',
  307. component: () => import(/* webpackChunkName: "user" */ '@/views/user/register/Register')
  308. },
  309. {
  310. path: 'register-result',
  311. name: 'registerResult',
  312. component: () => import(/* webpackChunkName: "user" */ '@/views/user/register/RegisterResult')
  313. },
  314. {
  315. path: 'alteration',
  316. name: 'alteration',
  317. component: () => import(/* webpackChunkName: "user" */ '@/views/user/alteration/Alteration')
  318. },
  319. ]
  320. },
  321. // {
  322. // path: '/',
  323. // name: 'index',
  324. // component: TabLayout,
  325. // meta: {title: '首页'},
  326. // redirect: '/dashboard/workplace',
  327. // children: [
  328. // {
  329. // path: '/online',
  330. // name: 'online',
  331. // redirect: '/online',
  332. // component: RouteView,
  333. // meta: {title: '在线开发', icon: 'dashboard', permission: ['dashboard']},
  334. // children: [
  335. // {
  336. // path: '/online/auto/:code',
  337. // name: 'report',
  338. // component: () => import('@/views/modules/online/cgreport/OnlCgreportAutoList')
  339. // },
  340. // ]
  341. // },
  342. // ]
  343. // },
  344. {
  345. // OAuth2 APP页面路由
  346. path: '/oauth2-app',
  347. component: BlankLayout,
  348. redirect: '/oauth2-app/login',
  349. children: [
  350. {
  351. // OAuth2 登录路由
  352. path: 'login',
  353. name: 'oauth2-app-login',
  354. component: () => import(/* webpackChunkName: "oauth2-app.login" */ '@/views/user/oauth2/OAuth2Login')
  355. },
  356. ]
  357. },
  358. {
  359. path: '/test',
  360. component: BlankLayout,
  361. redirect: '/test/home',
  362. children: [
  363. {
  364. path: 'home',
  365. name: 'TestHome',
  366. component: () => import('@/views/Home')
  367. }
  368. ]
  369. },
  370. {
  371. path: '/404',
  372. component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  373. },
  374. /* 不带左上的页面,oa引用 */
  375. {
  376. path: '/reportFormsSimple/fabricLossesSummary',
  377. component: () => import(/* 面损表列表" */ '@/views/cost-allocation-total/fabricLossesSummary')
  378. },
  379. {
  380. path: '/reportFormsSimple/fabricLossTable',
  381. component: () => import(/* 面损表" */ '@/views/reportForms/fabric-loss-table')
  382. },
  383. ]