staticRouter.ts 2.8 KB

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