index.js 2.9 KB

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