index.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. import Vue from "vue";
  2. import VueRouter from "vue-router";
  3. import modelLibrary from "./modelLibrary"; // 模型库
  4. import algorithmsLibrary from "./algorithmsLibrary"; // 算法库
  5. import sceneLibrary from "./sceneLibrary"; // 场景库
  6. import systemManagement from "./systemManagement"; // 账户管理
  7. import workManagement from "./workManagement"; // 工作管理
  8. import personalInformation from "./personalInformation"
  9. Vue.use(VueRouter);
  10. const routes = [
  11. {
  12. path: "/login",
  13. name: "login",
  14. component: () => import("../views/login.vue")
  15. },
  16. {
  17. path: "/",
  18. name: "index",
  19. meta: {
  20. tabname: "首页"
  21. },
  22. component: () => import('../views/index'),
  23. redirect: '/mainPage',
  24. children: [
  25. {
  26. path: "/mainPage",
  27. name: "mainPage",
  28. // meta: {
  29. // tabname: "首页"
  30. // },
  31. component: () => import("../views/mainPage.vue")
  32. },
  33. {
  34. path: "/modelLibrary",
  35. name: "modelLibrary",
  36. meta: {
  37. tabname: "模型库"
  38. },
  39. component: () => import("@/views/modelLibrary/index"),
  40. redirect: '/index',
  41. children: modelLibrary,
  42. },
  43. {
  44. path: "/algorithmsLibrary",
  45. name: "algorithmsLibrary",
  46. meta: {
  47. tabname: "算法库"
  48. },
  49. component: () => import("@/views/algorithmsLibrary/index"),
  50. redirect: '/index',
  51. children: algorithmsLibrary,
  52. },
  53. {
  54. path: "/sceneLibrary",
  55. name: "sceneLibrary",
  56. meta: {
  57. tabname: "场景库"
  58. },
  59. component: () => import("@/views/sceneLibrary/index"),
  60. redirect: '/index',
  61. children: sceneLibrary,
  62. },
  63. {
  64. path: "/workManagement",
  65. name: "workManagement",
  66. meta: {
  67. tabname: "工作管理"
  68. },
  69. component: () => import("@/views/workManagement/index"),
  70. redirect: '/index',
  71. children: workManagement,
  72. },
  73. {
  74. path: "/systemManagement",
  75. name: "systemManagement",
  76. meta: {
  77. tabname: "系统管理"
  78. },
  79. component: () => import("@/views/systemManagement/index"),
  80. redirect: '/index',
  81. children: systemManagement,
  82. },
  83. {
  84. path: "/personalInformation",
  85. name: "personalInformation",
  86. meta: {
  87. tabname: "个人信息"
  88. },
  89. component: () => import("@/views/personalInformation/personalInformation"),
  90. redirect: '/index',
  91. children: personalInformation,
  92. },
  93. ]
  94. .concat([{
  95. path: "*",
  96. name: "*",
  97. component: () => import("../views/mainPage.vue")
  98. }, ]),
  99. },
  100. ];
  101. // {
  102. // path: "/",
  103. // name: "About",
  104. // // route level code-splitting
  105. // // this generates a separate chunk (about.[hash].js) for this route
  106. // // which is lazy-loaded when the route is visited.
  107. // component: () =>
  108. // import( /* webpackChunkName: "about" */ "../views/About.vue"),
  109. // },
  110. const router = new VueRouter({
  111. mode: "history",
  112. base: process.env.BASE_URL,
  113. routes,
  114. scrollBehavior(to, from, savedPosition) {
  115. return {x: 0, y: 0}
  116. }
  117. });
  118. export default router;