index.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. // 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
  4. const originalPush = Router.prototype.push
  5. Router.prototype.push = function push(location) {
  6. return originalPush.call(this, location).catch(err => err)
  7. }
  8. const Login = () => import('@/components/Login')
  9. const Index = () => import('@/components/Index')
  10. const Home01 = () => import( /* webpackChunkName: "shouye" */ '@/components/home/Home01')
  11. const UserManger = () => import('@/components/UserManger')
  12. //---------------------------------------溯源模块------------------------------农场管理----------------------
  13. const FarmUserManger = () => import('@/Pages/symanger/farm/User')
  14. const FarmFieldsManger = () => import('@/Pages/symanger/farm/Fields')
  15. const FarmBaseManger = () => import( /* webpackChunkName: "syFarmBase" */ '@/Pages/symanger/farm/Base')
  16. const FarmAddBase = () => import( /* webpackChunkName: "syFarmBase" */ '@/Pages/symanger/farm/AddBase')
  17. const FarmEditBase = () => import( /* webpackChunkName: "syFarmBase" */ '@/Pages/symanger/farm/EditBase')
  18. //---------------------------------------溯源模块------------------------------溯源信息----------------------
  19. const ResultInfoList = () => import( /* webpackChunkName: "resultInfo" */ '@/Pages/symanger/resultInfo/resultInfoList')
  20. const ResultInfoEdit = () => import( /* webpackChunkName: "resultInfo" */ '@/Pages/symanger/resultInfo/resultInfoEdit')
  21. const TracebackDetail = () => import( /* webpackChunkName: "resultInfo" */ '@/Pages/symanger/resultInfo/tracebackDetail')
  22. const TracebackDetailApp = () => import( /* webpackChunkName: "resultInfo" */ '@/Pages/symanger/resultInfo/tracebackDetailApp')
  23. //---------------------------------------溯源模块------------------------------农事管理----------------------
  24. const FarmThingPlant = () => import('@/Pages/symanger/farmThing/plant')
  25. const FarmThingspray = () => import('@/Pages/symanger/farmThing/spray')
  26. const FarmThingApplyFertilizer = () => import('@/Pages/symanger/farmThing/applyFertilizer')
  27. const FarmThingWatering = () => import('@/Pages/symanger/farmThing/watering')
  28. const FarmThingHarvest = () => import('@/Pages/symanger/farmThing/harvest')
  29. const FarmThingMore = () => import('@/Pages/symanger/farmThing/more')
  30. const FarmThingStockIn = () => import('@/Pages/symanger/farmThing/stockIn')
  31. const FarmThingStockOut = () => import('@/Pages/symanger/farmThing/stockOut')
  32. const FarmThingStock = () => import('@/Pages/symanger/farmThing/stock')
  33. const FarmThingSale = () => import('@/Pages/symanger/farmThing/sale')
  34. const FarmThingTransport = () => import('@/Pages/symanger/farmThing/transport')
  35. Vue.use(Router)
  36. export default new Router({
  37. routes: [{
  38. path: '',
  39. redirect: '/index/farmBaseManger'
  40. },
  41. {
  42. path: '/login',
  43. component: Login
  44. },
  45. {
  46. path: '/index',
  47. component: Index,
  48. children: [{
  49. path: '',
  50. redirect: '/index/farmBaseManger'
  51. },
  52. {
  53. path: 'home',
  54. component: Home01
  55. },
  56. //-------------------溯源模块-----------农场管理----------
  57. {
  58. path: 'farmUserManger',
  59. component: FarmUserManger
  60. },
  61. {
  62. path: 'farmFieldsManger',
  63. component: FarmFieldsManger
  64. },
  65. {
  66. path: 'farmBaseManger',
  67. component: FarmBaseManger
  68. },
  69. {
  70. path: 'farmAddBase',
  71. component: FarmAddBase
  72. },
  73. {
  74. path: 'farmEditBase',
  75. component: FarmEditBase
  76. },
  77. //-------------------溯源模块-----------溯源信息----------
  78. {
  79. path: 'resultInfoList',
  80. component: ResultInfoList
  81. },
  82. {
  83. path: 'resultInfoEdit',
  84. component: ResultInfoEdit
  85. },
  86. //-------------------溯源模块-----------农事管理----------
  87. {
  88. path: 'farmThingPlant',
  89. component: FarmThingPlant
  90. },
  91. {
  92. path: 'farmThingspray',
  93. component: FarmThingspray
  94. },
  95. {
  96. path: 'farmThingApplyFerti',
  97. component: FarmThingApplyFertilizer
  98. },
  99. {
  100. path: 'farmThingWatering',
  101. component: FarmThingWatering
  102. },
  103. {
  104. path: 'farmThingHarvest',
  105. component: FarmThingHarvest
  106. },
  107. {
  108. path: 'farmThingMore',
  109. component: FarmThingMore
  110. },
  111. {
  112. path: 'farmThingStockIn',
  113. component: FarmThingStockIn
  114. },
  115. {
  116. path: 'farmThingStockOut',
  117. component: FarmThingStockOut
  118. },
  119. {
  120. path: 'farmThingStock',
  121. component: FarmThingStock
  122. },
  123. {
  124. path: 'farmThingSale',
  125. component: FarmThingSale
  126. },
  127. {
  128. path: 'farmThingTransport',
  129. component: FarmThingTransport
  130. },
  131. {
  132. path: 'userManger',
  133. component: UserManger
  134. },
  135. ]
  136. },
  137. //-------------------溯源模块-----------溯源中心----------
  138. {
  139. path: '/tracebackDetail/:backcode',
  140. name:'TracebackDetail',
  141. component: TracebackDetail,
  142. },
  143. {
  144. path: '/tracebackDetailApp/:backcode',
  145. name:'TracebackDetailApp',
  146. component: TracebackDetailApp,
  147. },
  148. ],
  149. // mode:'history'
  150. })