index.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. //---------------------------------------溯源模块------------------------------农场管理----------------------
  12. const FarmUserManger = () => import('@/Pages/symanger/farm/User')
  13. const FarmFieldsManger = () => import('@/Pages/symanger/farm/Fields')
  14. const FarmBaseManger = () => import( /* webpackChunkName: "syFarmBase" */ '@/Pages/symanger/farm/Base')
  15. const FarmAddBase = () => import( /* webpackChunkName: "syFarmBase" */ '@/Pages/symanger/farm/AddBase')
  16. const FarmEditBase = () => import( /* webpackChunkName: "syFarmBase" */ '@/Pages/symanger/farm/EditBase')
  17. //---------------------------------------溯源模块------------------------------溯源信息----------------------
  18. const ResultInfoList = () => import( /* webpackChunkName: "resultInfo" */ '@/Pages/symanger/resultInfo/resultInfoList')
  19. const ResultInfoEdit = () => import( /* webpackChunkName: "resultInfo" */ '@/Pages/symanger/resultInfo/resultInfoEdit')
  20. const TracebackDetail = () => import( /* webpackChunkName: "resultInfo" */ '@/Pages/symanger/resultInfo/tracebackDetail')
  21. const TracebackDetailApp = () => import( /* webpackChunkName: "resultInfo" */ '@/Pages/symanger/resultInfo/tracebackDetailApp')
  22. //---------------------------------------溯源模块------------------------------农事管理----------------------
  23. const FarmThingPlant = () => import('@/Pages/symanger/farmThing/plant')
  24. const FarmThingspray = () => import('@/Pages/symanger/farmThing/spray')
  25. const FarmThingApplyFertilizer = () => import('@/Pages/symanger/farmThing/applyFertilizer')
  26. const FarmThingWatering = () => import('@/Pages/symanger/farmThing/watering')
  27. const FarmThingHarvest = () => import('@/Pages/symanger/farmThing/harvest')
  28. const FarmThingMore = () => import('@/Pages/symanger/farmThing/more')
  29. const FarmThingStockIn = () => import('@/Pages/symanger/farmThing/stockIn')
  30. const FarmThingStockOut = () => import('@/Pages/symanger/farmThing/stockOut')
  31. const FarmThingStock = () => import('@/Pages/symanger/farmThing/stock')
  32. const FarmThingSale = () => import('@/Pages/symanger/farmThing/sale')
  33. const FarmThingTransport = () => import('@/Pages/symanger/farmThing/transport')
  34. Vue.use(Router)
  35. export default new Router({
  36. routes: [{
  37. path: '',
  38. redirect: '/index/farmBaseManger'
  39. },
  40. {
  41. path: '/login',
  42. component: Login
  43. },
  44. {
  45. path: '/index',
  46. component: Index,
  47. children: [{
  48. path: '',
  49. redirect: '/index/farmBaseManger'
  50. },
  51. {
  52. path: 'home',
  53. component: Home01
  54. },
  55. //-------------------溯源模块-----------农场管理----------
  56. {
  57. path: 'farmUserManger',
  58. component: FarmUserManger
  59. },
  60. {
  61. path: 'farmFieldsManger',
  62. component: FarmFieldsManger
  63. },
  64. {
  65. path: 'farmBaseManger',
  66. component: FarmBaseManger
  67. },
  68. {
  69. path: 'farmAddBase',
  70. component: FarmAddBase
  71. },
  72. {
  73. path: 'farmEditBase',
  74. component: FarmEditBase
  75. },
  76. //-------------------溯源模块-----------溯源信息----------
  77. {
  78. path: 'resultInfoList',
  79. component: ResultInfoList
  80. },
  81. {
  82. path: 'resultInfoEdit',
  83. component: ResultInfoEdit
  84. },
  85. //-------------------溯源模块-----------农事管理----------
  86. {
  87. path: 'farmThingPlant',
  88. component: FarmThingPlant
  89. },
  90. {
  91. path: 'farmThingspray',
  92. component: FarmThingspray
  93. },
  94. {
  95. path: 'farmThingApplyFerti',
  96. component: FarmThingApplyFertilizer
  97. },
  98. {
  99. path: 'farmThingWatering',
  100. component: FarmThingWatering
  101. },
  102. {
  103. path: 'farmThingHarvest',
  104. component: FarmThingHarvest
  105. },
  106. {
  107. path: 'farmThingMore',
  108. component: FarmThingMore
  109. },
  110. {
  111. path: 'farmThingStockIn',
  112. component: FarmThingStockIn
  113. },
  114. {
  115. path: 'farmThingStockOut',
  116. component: FarmThingStockOut
  117. },
  118. {
  119. path: 'farmThingStock',
  120. component: FarmThingStock
  121. },
  122. {
  123. path: 'farmThingSale',
  124. component: FarmThingSale
  125. },
  126. {
  127. path: 'farmThingTransport',
  128. component: FarmThingTransport
  129. },
  130. ]
  131. },
  132. //-------------------溯源模块-----------溯源中心----------
  133. {
  134. path: '/tracebackDetail/:backcode',
  135. component: TracebackDetail,
  136. },
  137. {
  138. path: '/tracebackDetailApp/:backcode',
  139. component: TracebackDetailApp,
  140. meta: {
  141. login_require: false,
  142. }
  143. },
  144. ],
  145. // mode:'history'
  146. })