index.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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 Index = () => import('@/components/Index')
  9. const Home = () => import('@/components/Home')
  10. // --------------------------------------个人中心 --------------------------------------------------
  11. const PersonMsg = () => import( /* webpackChunkName: "shouye" */ '@/pages/personage/personMsg')
  12. // --------------------------------------测报模块---------------------------测报灯-----------------------
  13. const Cbd = () => import( /* webpackChunkName: "qxz" */ '@/Pages/forecasting/cbd/Cbd')
  14. const CbdDataDetails = () => import( /* webpackChunkName: "qxz" */ '@/Pages/forecasting/cbd/DataDetails')
  15. const cbdDataPhotos = () => import( /* webpackChunkName: "qxz" */ '@/Pages/forecasting/cbd/CbdDataPhotos')
  16. const CbdHistoryData = () => import( /* webpackChunkName: "qxz" */ '@/Pages/forecasting/cbd/HistoryData')
  17. const PestsStats = () => import( /* webpackChunkName: "qxz" */ '@/Pages/forecasting/cbd/PestsStats')
  18. const MessageWarn = () => import( /* webpackChunkName: "qxz" */ '@/Pages/forecasting/cbd/MessageWarn')
  19. //---------------------------------------测报模块-----------------------------孢子仪-------------------------
  20. const Bzy = () => import( /* webpackChunkName: "bzy" */ '@/Pages/forecasting/bzy/Bzy')
  21. const BzyPhotos = () => import( /* webpackChunkName: "bzy" */ '@/Pages/forecasting/bzy/BzyPhotos')
  22. const DataDetail = () => import( /* webpackChunkName: "bzy" */ '@/Pages/forecasting/bzy/DataDetail')
  23. //---------------------------------------测报模块-----------------------------性诱测报-------------------------
  24. const Xycb = () => import( /* webpackChunkName: "xycb" */ '@/Pages/forecasting/xycb/Xycb')
  25. const xycbDataPhotos = () => import( /* webpackChunkName: "xycb" */ '@/Pages/forecasting/xycb/XycbDataPhotos')
  26. const xycbDataDetail = () => import( /* webpackChunkName: "xycb" */ '@/Pages/forecasting/xycb/XycbDataDetail')
  27. //---------------------------------------防治模块---------------------------杀虫灯-------------------------
  28. const Scd = () => import( /* webpackChunkName: "scd" */ '@/Pages/cure/scd/scd')
  29. const ScdDetail = () => import( /* webpackChunkName: "scd" */ '@/Pages/cure/scd/scdDetail')
  30. Vue.use(Router)
  31. export default new Router({
  32. routes: [{
  33. path:'',
  34. component: Home,
  35. },{
  36. path: '/index',
  37. component: Index,
  38. children: [{
  39. path: 'personMsg',
  40. component: PersonMsg
  41. },
  42. // -----------------测报模块------------测报灯------------
  43. {
  44. path: 'cbd',
  45. component: Cbd
  46. },
  47. {
  48. path: 'cbdDataDetails/:e_id/:d_id',
  49. component: CbdDataDetails
  50. },
  51. {
  52. path: 'cbdDataPhotos/:id',
  53. component: cbdDataPhotos
  54. },
  55. {
  56. path: 'cbdhistorydata',
  57. component: CbdHistoryData
  58. },
  59. {
  60. path: 'pestsStats/:id',
  61. component: PestsStats
  62. },
  63. {
  64. path: 'messageWarn/:id',
  65. component: MessageWarn
  66. },
  67. //------------------测报模块-------------孢子仪-------------
  68. {
  69. path: 'bzy',
  70. component: Bzy
  71. },
  72. {
  73. path: 'bzyPhotos/:id',
  74. component: BzyPhotos
  75. },
  76. {
  77. path: 'dataDetail/:e_id/:d_id',
  78. component: DataDetail
  79. },
  80. //------------------测报模块-------------性诱测报-------------
  81. {
  82. path: 'xycb',
  83. component: Xycb
  84. },
  85. {
  86. path: 'xycbDataPhotos/:id',
  87. component: xycbDataPhotos
  88. },
  89. {
  90. path: 'xycbDataDetail/:e_id/:d_id',
  91. component: xycbDataDetail
  92. },
  93. //------------------防治模块-------------杀虫灯-------------
  94. {
  95. path: 'scd',
  96. component: Scd
  97. },
  98. {
  99. path: 'scdDetail/:e_id/:d_id',
  100. component: ScdDetail
  101. },
  102. ]
  103. }, ],
  104. // mode:'history'
  105. })