index.ts 11 KB

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