staticRouter.ts 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. import { RouteRecordRaw } from 'vue-router'
  2. export const staticRouter: RouteRecordRaw[] = [
  3. {
  4. path: '/',
  5. redirect: '/index'
  6. },
  7. {
  8. path: '/index',
  9. name: 'Index',
  10. component: () => import('@/views/Index.vue'),
  11. redirect: '/home',
  12. meta: {
  13. title: '起始页'
  14. },
  15. children: [
  16. {
  17. path: '/home',
  18. name: 'Home',
  19. component: () => import('@/views/home/Home.vue'),
  20. meta: {
  21. title: '首页'
  22. }
  23. },
  24. {
  25. path: '/saleMange',
  26. name: 'SaleMange',
  27. component: () => import('@/views/storehouse/sales/index.vue'),
  28. redirect: '/contract',
  29. meta: {
  30. routerView: true,
  31. title: '销售管理'
  32. },
  33. children: [
  34. {
  35. path: '/contractDetail/:id/:type',
  36. name: 'ContractDetail',
  37. component: () => import('@/views/storehouse/sales/ContractDetail.vue'),
  38. meta: {
  39. title: '合同详情'
  40. }
  41. }
  42. ]
  43. },
  44. {
  45. path: '/inventoryMange',
  46. name: 'InventoryMange',
  47. component: () => import('@/views/storehouse/inventory/index.vue'),
  48. redirect: '/contract',
  49. meta: {
  50. routerView: true,
  51. title: '库存管理'
  52. },
  53. children: [
  54. {
  55. path: '/inStorageDetail/:id',
  56. name: 'InStorageDetail',
  57. component: () => import('@/views/storehouse/inventory/InStorageDetail.vue'),
  58. meta: {
  59. title: '入库详情'
  60. }
  61. },
  62. {
  63. path: '/receiveOutStock',
  64. name: 'ReceiveOutStock',
  65. component: () => import('@/views/storehouse/outStock/ReceiveOutStock.vue'),
  66. meta: {
  67. title: '领料出库'
  68. }
  69. },
  70. {
  71. path: '/saleOutStock',
  72. name: 'SaleOutStock',
  73. component: () => import('@/views/storehouse/outStock/SaleOutStock.vue'),
  74. meta: {
  75. title: '销售出库'
  76. }
  77. },
  78. {
  79. path: '/outStockDetail/:number',
  80. name: 'OutStockDetail',
  81. component: () => import('@/views/storehouse/outStock/OutStockDetail.vue'),
  82. meta: {
  83. title: '出库详情'
  84. }
  85. }
  86. ]
  87. },
  88. {
  89. path: '/user',
  90. name: 'User',
  91. component: () => import('@/views/home/User.vue'),
  92. meta: {
  93. title: '个人中心'
  94. }
  95. }
  96. ]
  97. },
  98. {
  99. path: '/login',
  100. name: 'login',
  101. component: () => import('@/views/Login.vue'),
  102. meta: {
  103. title: '登录'
  104. }
  105. }
  106. ]
  107. export const errorRouter = [
  108. {
  109. path: '/404',
  110. name: '404',
  111. component: () => import('@/components/ErrorMessage/404.vue'),
  112. meta: {
  113. title: '404页面'
  114. }
  115. }
  116. ]
  117. /**
  118. * notFoundRouter(找不到路由)
  119. */
  120. export const notFoundRouter = {
  121. path: '/:pathMatch(.*)*',
  122. name: 'notFound',
  123. redirect: { name: '404' }
  124. }