index.ts 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. import Vue from "vue";
  2. import Router from "vue-router";
  3. import Layout from "@/layout/index.vue";
  4. Vue.use(Router);
  5. /*
  6. redirect: 如果设置为“noredirect”,则单击面包屑时不会触发重定向操作
  7. meta: {
  8. title: 'title' 子菜单和面包屑中显示的名称(推荐)
  9. icon: 'svg-name' 侧边栏中显示的图标
  10. breadcrumb: false 如果为false,则项目将隐藏在breadcrumb中(默认值为true)
  11. hidden: true 如果为true,此路由将不会显示在侧边栏中(默认为false)
  12. }
  13. */
  14. export default new Router({
  15. mode: "history",
  16. scrollBehavior: (to, from, savedPosition) => {
  17. if (savedPosition) {
  18. return savedPosition;
  19. } else {
  20. return { x: 0, y: 0 };
  21. }
  22. },
  23. base: process.env.BASE_URL,
  24. routes: [
  25. {
  26. path: "/login",
  27. component: () =>
  28. import(
  29. /* webpackChunkName: "login" */ "@/views/login/index.vue"
  30. ),
  31. meta: { hidden: true }
  32. },
  33. {
  34. path: "/",
  35. redirect: "/project/index",
  36. component: Layout,
  37. children: [
  38. {
  39. path: "project/index",
  40. component: () =>
  41. import(
  42. /* webpackChunkName: "project" */ "@/views/project/index.vue"
  43. ),
  44. meta: {
  45. title: "项目管理",
  46. icon: "icon-xiangmuguanli"
  47. }
  48. }
  49. ]
  50. },
  51. {
  52. path: "/allDetails",
  53. component: Layout,
  54. meta: {
  55. hidden: true
  56. },
  57. children: [
  58. {
  59. path: "index",
  60. component: () =>
  61. import(
  62. /* webpackChunkName: "allDetails" */ "@/layout/components/Navbar/MessageSever/MsgAllDetails.vue"
  63. ),
  64. meta: {
  65. title: "消息中心"
  66. }
  67. }
  68. ]
  69. },
  70. {
  71. path: "/manage",
  72. component: Layout,
  73. meta: {
  74. title: "文件管理",
  75. icon: "icon-wenjianguanli"
  76. },
  77. children: [
  78. {
  79. path: "build",
  80. component: () =>
  81. import(
  82. /* webpackChunkName: "build" */ "@/views/manage/build/index.vue"
  83. ),
  84. meta: {
  85. title: "建筑楼层管理"
  86. // icon: "tree"
  87. }
  88. },
  89. {
  90. path: "model",
  91. component: () =>
  92. import(
  93. /* webpackChunkName: "model" */ "@/views/manage/model/index.vue"
  94. ),
  95. meta: {
  96. title: "模型修改任务"
  97. // icon: "table"
  98. }
  99. },
  100. {
  101. path: "path",
  102. component: () =>
  103. import(
  104. /* webpackChunkName: "path" */ "@/views/manage/path/index.vue"
  105. ),
  106. meta: {
  107. hidden: true,
  108. title: "模型后台处理监控"
  109. }
  110. }
  111. ]
  112. },
  113. {
  114. path: "/maintain",
  115. component: Layout,
  116. redirect: "/maintain/device",
  117. meta: {
  118. title: "数据维护",
  119. icon: "icon-shujuweihu"
  120. },
  121. children: [
  122. {
  123. path: "device",
  124. component: () =>
  125. import(
  126. /* webpackChunkName: "device" */ "@/views/maintain/device/index.vue"
  127. ),
  128. meta: { title: "设备" }
  129. },
  130. {
  131. path: "space",
  132. component: () =>
  133. import(
  134. /* webpackChunkName: "space" */ "@/views/maintain/space/index.vue"
  135. ),
  136. meta: { title: "空间" }
  137. },
  138. {
  139. path: "system",
  140. component: () =>
  141. import(
  142. /* webpackChunkName: "system" */ "@/views/maintain/system/index.vue"
  143. ),
  144. meta: { title: "系统" }
  145. },
  146. {
  147. path: "relationship",
  148. component: () =>
  149. import(
  150. /* webpackChunkName: "relationship" */ "@/views/maintain/relationship/index.vue"
  151. ),
  152. meta: { title: "关系" },
  153. }, {
  154. path: "relation",
  155. component: () =>
  156. import(
  157. /* webpackChunkName: "relation" */ "@/views/maintain/relationship/relation/index.vue"
  158. ),
  159. meta: { title: "关系", hidden: true },
  160. }
  161. ]
  162. },
  163. {
  164. path: "/scene",
  165. component: Layout,
  166. redirect: "/scene/tiepoint",
  167. meta: {
  168. title: "现场实施",
  169. icon: "icon-xianchangshishi"
  170. },
  171. children: [
  172. {
  173. path: "tiepoint",
  174. component: () =>
  175. import(
  176. /* webpackChunkName: "tiepoint" */ "@/views/scene/tiepoint/index.vue"
  177. ),
  178. meta: { title: "绑点" }
  179. },
  180. {
  181. path: "system",
  182. component: () =>
  183. import(
  184. /* webpackChunkName: "system" */ "@/views/scene/system/index.vue"
  185. ),
  186. meta: { title: "系统图" }
  187. },
  188. {
  189. path: "plane",
  190. component: () =>
  191. import(
  192. /* webpackChunkName: "plane" */ "@/views/scene/plane/index.vue"
  193. ),
  194. meta: { title: "平面图" }
  195. },
  196. ]
  197. },
  198. {
  199. path: "/tools",
  200. component: Layout,
  201. meta: {
  202. title: "一致性检查工具",
  203. icon: "icon-yizhixingjianchagongju"
  204. }
  205. },
  206. {
  207. path: "/model-tool",
  208. component: Layout,
  209. meta: {
  210. title: "模型检查工具",
  211. icon: "icon-moxingjianchagongju"
  212. }
  213. },
  214. {
  215. path: "/management",
  216. component: Layout,
  217. redirect: "/management/mapping",
  218. meta: {
  219. title: "综合管理与其他",
  220. icon: "icon-zongheguanliyuqita",
  221. alwaysShow: true
  222. },
  223. children: [
  224. {
  225. path: "mapping",
  226. component: () =>
  227. import(
  228. /* webpackChunkName: "mapping" */ "@/views/management/mapping/index.vue"
  229. ),
  230. meta: { title: "映射关系维护" }
  231. }
  232. ]
  233. },
  234. {
  235. path: "/error",
  236. component: Layout,
  237. redirect: "noredirect",
  238. meta: {
  239. title: "错误页面",
  240. icon: "icon-weihubangzhu"
  241. },
  242. children: [
  243. {
  244. path: "401",
  245. component: () =>
  246. import(
  247. /* webpackChunkName: "error-page-401" */ "@/views/error-page/401.vue"
  248. ),
  249. name: "Page401",
  250. meta: {
  251. title: "401",
  252. noCache: true
  253. }
  254. },
  255. {
  256. path: "404",
  257. component: () =>
  258. import(
  259. /* webpackChunkName: "error-page-404" */ "@/views/error-page/404.vue"
  260. ),
  261. name: "404",
  262. meta: {
  263. title: "404",
  264. noCache: true
  265. }
  266. },
  267. {
  268. path: "demo",
  269. component: () =>
  270. import(
  271. /* webpackChunkName: "error-page-demo" */ "@/views/error-page/demo.vue"
  272. ),
  273. name: "demo",
  274. meta: {
  275. title: "demo",
  276. noCache: true
  277. }
  278. }
  279. ]
  280. },
  281. {
  282. path: "*",
  283. redirect: "/404",
  284. meta: { hidden: true }
  285. }
  286. ]
  287. });