index.ts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. import vueRouter, { NavigationFailure, RouteRecordRaw, createRouter, createWebHistory } from 'vue-router'
  2. const iot = {
  3. path: '/iot',
  4. name: '物联网',
  5. meta: {
  6. title: '物联网'
  7. },
  8. component: () => import('@/layout/layout.vue'),
  9. redirect: '/dashboard',
  10. children: [
  11. {
  12. path: '/dashboard',
  13. name: '系统概览',
  14. icon: 'DashboardOutlined',
  15. component: () => import('@/pages/iot/dashboard/deviceAccess/index.vue')
  16. },
  17. {
  18. path: '/product',
  19. name: '产品模型',
  20. redirect: '/product/index',
  21. icon: 'AppstoreOutlined',
  22. children: [
  23. {
  24. path: '/product/index',
  25. name: '产品模型',
  26. component: () => import('@/pages/iot/model/index.vue')
  27. },
  28. {
  29. path: '/product/models',
  30. name: '产品模型库',
  31. component: () => import('@/pages/iot/model/models.vue')
  32. },
  33. {
  34. path: '/product/detail',
  35. name: '产品模型详情',
  36. hidden: true,
  37. component: () => import('@/pages/iot/model/detail.vue')
  38. }
  39. ]
  40. },
  41. {
  42. path: '/device',
  43. name: '设备管理',
  44. redirect: '/device/index',
  45. icon: 'RobotOutlined',
  46. children: [
  47. {
  48. path: '/device/index',
  49. name: '所有设备',
  50. component: () => import('@/pages/iot/device/index.vue')
  51. },
  52. {
  53. path: '/device/detail',
  54. name: '设备详情',
  55. hidden: true,
  56. component: () => import('@/pages/iot/device/detail.vue')
  57. },
  58. {
  59. path: '/device/group',
  60. name: '设备群组',
  61. component: () => import('@/pages/iot/device/group.vue')
  62. },
  63. {
  64. path: '/device/topology',
  65. name: '设备拓扑',
  66. component: () => import('@/pages/iot/device/topology.vue')
  67. },
  68. {
  69. path: '/device/analysis',
  70. name: '设备分析',
  71. component: () => import('@/pages/iot/device/analysis.vue')
  72. }
  73. ]
  74. },
  75. {
  76. path: '/rule',
  77. name: '数据规则',
  78. redirect: '/rule/forward',
  79. icon: 'AimOutlined',
  80. children: [
  81. {
  82. path: '/rule/forward',
  83. name: '转发规则',
  84. component: () => import('@/pages/iot/rule/forwardRule.vue')
  85. },
  86. {
  87. path: '/rule/link',
  88. name: '联动规则',
  89. component: () => import('@/pages/iot/rule/linkRules.vue')
  90. }
  91. ]
  92. },
  93. {
  94. path: '/devOps',
  95. name: '监控运维',
  96. redirect: '/devOps/report',
  97. icon: 'CodeOutlined',
  98. children: [
  99. {
  100. path: '/devOps/report',
  101. name: '数据监控',
  102. component: () => import('@/pages/iot/devOps/statistReport.vue')
  103. },
  104. {
  105. path: '/devOps/onlineTest',
  106. name: '在线调试',
  107. component: () => import('@/pages/iot/devOps/onlineTest.vue')
  108. },
  109. {
  110. path: '/devOps/mt',
  111. name: '消息追踪',
  112. component: () => import('@/pages/iot/devOps/msgTracking.vue')
  113. },
  114. {
  115. path: '/devOps/nowAlert',
  116. name: '当前告警',
  117. component: () => import('@/pages/iot/devOps/nowAlert.vue')
  118. },
  119. {
  120. path: '/devOps/nowNotice',
  121. name: '当前提醒',
  122. component: () => import('@/pages/iot/devOps/nowNotice.vue')
  123. }
  124. ]
  125. },
  126. {
  127. path: '/dataServer',
  128. name: '数据服务',
  129. icon: 'DatabaseOutlined',
  130. children: [
  131. {
  132. path: '/dataServer/history',
  133. name: '历史数据',
  134. component: () => import('@/pages/iot/dataServer/history.vue')
  135. },
  136. {
  137. path: '/dataServer/openApi',
  138. name: '开放接口',
  139. component: () => import('@/pages/iot/dataServer/openApi.vue')
  140. }
  141. ]
  142. },
  143. {
  144. path: '/task',
  145. name: '任务中心',
  146. redirect: '/task/manage',
  147. // <container-outlined />
  148. icon: 'ContainerOutlined',
  149. children: [
  150. {
  151. path: '/task/manage',
  152. name: '任务管理',
  153. component: () => import('@/pages/iot/task/manage.vue')
  154. },
  155. {
  156. path: '/task/track',
  157. name: '任务追踪',
  158. component: () => import('@/pages/iot/task/track.vue')
  159. }
  160. ]
  161. },
  162. {
  163. path: '/ota',
  164. name: 'OTA程序包',
  165. icon: 'FolderAddOutlined',
  166. component: () => import('@/pages/iot/ota/index.vue')
  167. },
  168. {
  169. path: '/sys',
  170. name: '系统设置',
  171. redirect: '/sys/noticeway',
  172. icon: 'DatabaseOutlined',
  173. children: [
  174. {
  175. path: '/sys/noticeway',
  176. name: '通知方式',
  177. component: () => import('@/pages/iot/sys/noticeway.vue')
  178. },
  179. {
  180. path: '/sys/notice',
  181. name: '通知设置',
  182. component: () => import('@/pages/iot/sys/notice.vue')
  183. }
  184. ]
  185. },
  186. {
  187. path: '/doc',
  188. name: '使用文档',
  189. redirect: '',
  190. icon: 'SnippetsOutlined',
  191. children: [
  192. {
  193. path: '/deviceDoc',
  194. name: '设备接入文档',
  195. component: () => import('@/pages/iot/doc/deviceDoc.vue'),
  196. icon: 'BookOutlined'
  197. },
  198. {
  199. path: '/dataDoc',
  200. name: '数据服务文档',
  201. component: () => import('@/pages/iot/doc/dataDoc.vue'),
  202. icon: 'CoffeeOutlined'
  203. }
  204. ]
  205. }
  206. ]
  207. }
  208. const schedule = {
  209. path: '/schedule',
  210. name: '数据中台',
  211. meta: {
  212. title: '数据中台'
  213. },
  214. component: () => import('@/layout/layout.vue'),
  215. redirect: '/dataSource',
  216. children: [
  217. {
  218. path: '/dataSource',
  219. name: '数据源',
  220. icon: 'DatabaseOutlined',
  221. redirect: '/dataSource/manage',
  222. children: [
  223. {
  224. path: '/dataSource/manage',
  225. name: '数据源管理',
  226. component: () => import('@/pages/schedule/dataSource/manage/index.vue')
  227. },
  228. {
  229. path: '/dataSource/metaTool',
  230. name: '元数据管理',
  231. component: () => import('@/pages/schedule/dataSource/metaTool/index.vue')
  232. }
  233. ]
  234. },
  235. {
  236. path: '/dataLake',
  237. name: '数据湖',
  238. icon: 'LaptopOutlined',
  239. redirect: '/dataLake/dataTool',
  240. children: [
  241. {
  242. path: '/dataLake/dataTool',
  243. name: '数据湖工具',
  244. component: () => import('@/pages/schedule/dataLake/dataTool/index.vue')
  245. },
  246. {
  247. path: '/dataLake/dataIsland',
  248. name: '数据岛',
  249. component: () => import('@/pages/schedule/dataLake/dataTool/index.vue')
  250. }
  251. ]
  252. }
  253. // {
  254. // path: '/APICenter',
  255. // name: '数据服务',
  256. // icon: 'ApiOutlined',
  257. // component: () => import('@/pages/schedule/APICenter/index.vue')
  258. // }
  259. ]
  260. }
  261. const view = {
  262. path: 'http://cloudview.jiaolongcloud.com/',
  263. name: '可视化',
  264. meta: {
  265. title: '可视化'
  266. },
  267. link: true
  268. }
  269. // const lowcode = {
  270. // path: 'http://49.232.161.110:5556',
  271. // name: '低代码',
  272. // meta: {
  273. // title: '低代码'
  274. // },
  275. // link: true
  276. // }
  277. //
  278. // const user = {
  279. // path: '/user',
  280. // name: '用户群组',
  281. // meta: {
  282. // title: '用户群组'
  283. // },
  284. // component: () => import('@/layout/layout.vue'),
  285. // redirect: '/manage',
  286. // children: [
  287. // {
  288. // path: '/manage',
  289. // name: '用户管理',
  290. // icon: 'TeamOutlined',
  291. // component: () => import('@/pages/user/manage/index.vue')
  292. // },
  293. // {
  294. // path: '/resource',
  295. // name: '资源管理',
  296. // icon: 'FolderOpenOutlined',
  297. // component: () => import('@/pages/user/resource/index.vue')
  298. // }
  299. // ]
  300. // }
  301. const login = {
  302. path: '/login',
  303. name: '登录',
  304. meta: {
  305. title: '登录'
  306. },
  307. component: () => import('@/pages/login/index.vue')
  308. }
  309. const cvs = {
  310. path: '/cvs',
  311. name: '视联网',
  312. meta: {
  313. title: '视联网'
  314. },
  315. component: () => import('@/layout/layout.vue'),
  316. redirect: '/cvs/video/space',
  317. children: [
  318. {
  319. path: '/cvs/csys',
  320. name: '系统概览 ',
  321. icon: '',
  322. component: () => import('@/pages/cvs/csys/index.vue')
  323. },
  324. {
  325. path: '/cvs/video',
  326. name: '视频接入',
  327. icon: '',
  328. redirect: '/cvs/video/space',
  329. children: [
  330. {
  331. path: '/cvs/video/space',
  332. name: '空间',
  333. icon: '',
  334. component: () => import('@/pages/cvs/video/space.vue')
  335. },
  336. {
  337. path: '/cvs/video/device',
  338. name: '设备',
  339. icon: '',
  340. component: () => import('@/pages/cvs/video/device.vue')
  341. }
  342. ]
  343. },
  344. {
  345. path: '/cvs/project',
  346. name: '项目管理',
  347. icon: '',
  348. component: () => import('@/pages/cvs/project/index.vue')
  349. },
  350. {
  351. path: '/cvs/operator',
  352. name: '算子仓库',
  353. icon: '',
  354. redirect: '/cvs/operator/manage',
  355. children: [
  356. {
  357. path: '/cvs/operator/manage',
  358. name: '算子管理',
  359. icon: '',
  360. component: () => import('@/pages/cvs/operator/manage.vue')
  361. },
  362. {
  363. path: '/cvs/operator/version',
  364. name: '算子版本',
  365. icon: '',
  366. hidden: true,
  367. component: () => import('@/pages/cvs/operator/version.vue')
  368. }
  369. ]
  370. },
  371. {
  372. path: '/cvs/cvsSever',
  373. name: '数据管理',
  374. icon: '',
  375. children: [
  376. {
  377. path: '/cvs/cvsSever/template',
  378. name: '模版管理',
  379. icon: '',
  380. component: () => import('@/pages/cvs/dataServer/template.vue')
  381. }
  382. ]
  383. },
  384. {
  385. path: '/cvs/edge',
  386. name: '边缘设备',
  387. icon: '',
  388. children: [
  389. {
  390. path: '/cvs/edge/task',
  391. name: '任务管理',
  392. icon: '',
  393. component: () => import('@/pages/cvs/edge/task.vue')
  394. },
  395. {
  396. path: '/cvs/dataSever/video',
  397. name: '视频管理',
  398. icon: '',
  399. component: () => import('@/pages/cvs/edge/video.vue')
  400. }
  401. ]
  402. },
  403. {
  404. path: '/cvs/nodes',
  405. name: '节点管理 ',
  406. icon: '',
  407. component: () => import('@/pages/cvs/nodes/index.vue')
  408. }
  409. ]
  410. }
  411. const _routes = [iot, cvs, schedule, view] as any
  412. if (_routes[0].link) {
  413. window.open(_routes[0].path)
  414. }
  415. const redirectRoutes = {
  416. path: '/',
  417. name: '',
  418. meta: {
  419. title: ''
  420. },
  421. redirect: _routes[0].redirect
  422. }
  423. export const routes: Array<ROUTER.RoutesProps> = [redirectRoutes, ..._routes, login]
  424. const router = createRouter({
  425. history: createWebHistory(process.env.BASE_URL),
  426. routes: routes.map(item => {
  427. const _item = item.link
  428. ? {
  429. ...item,
  430. path: '/' + item.path
  431. }
  432. : item
  433. return _item
  434. })
  435. })
  436. // router.push = async function (to: vueRouter.RouteLocationRaw): Promise<void | NavigationFailure | undefined> {
  437. // router.push(to)
  438. // }
  439. export default router