index.ts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  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. const user = {
  278. path: '/user',
  279. name: '用户群组',
  280. meta: {
  281. title: '用户群组'
  282. },
  283. component: () => import('@/layout/layout.vue'),
  284. redirect: '/manage',
  285. children: [
  286. {
  287. path: '/manage',
  288. name: '用户管理',
  289. icon: 'TeamOutlined',
  290. component: () => import('@/pages/user/manage/index.vue')
  291. },
  292. {
  293. path: '/resource',
  294. name: '资源管理',
  295. icon: 'FolderOpenOutlined',
  296. component: () => import('@/pages/user/resource/index.vue')
  297. }
  298. ]
  299. }
  300. const login = {
  301. path: '/login',
  302. name: '登录',
  303. meta: {
  304. title: '登录'
  305. },
  306. component: () => import('@/pages/login/index.vue')
  307. }
  308. const cvs = {
  309. path: '/cvs',
  310. name: '视联网',
  311. meta: {
  312. title: '视联网'
  313. },
  314. component: () => import('@/layout/layout.vue'),
  315. redirect: '/cvs/video/space',
  316. children: [
  317. {
  318. path: '/cvs/video',
  319. name: '视频接入',
  320. icon: '',
  321. redirect: '/cvs/video/space',
  322. children: [
  323. {
  324. path: '/cvs/video/space',
  325. name: '空间',
  326. icon: '',
  327. component: () => import('@/pages/cvs/video/space.vue')
  328. },
  329. {
  330. path: '/cvs/video/device',
  331. name: '设备',
  332. icon: '',
  333. component: () => import('@/pages/cvs/video/device.vue')
  334. }
  335. ]
  336. },
  337. {
  338. path: '/cvs/project',
  339. name: '项目管理',
  340. icon: '',
  341. component: () => import('@/pages/cvs/project/index.vue')
  342. },
  343. {
  344. path: '/cvs/operator',
  345. name: '算子仓库',
  346. icon: '',
  347. redirect: '/cvs/operator/manage',
  348. children: [
  349. {
  350. path: '/cvs/operator/manage',
  351. name: '算子管理',
  352. icon: '',
  353. component: () => import('@/pages/cvs/operator/manage.vue')
  354. },
  355. {
  356. path: '/cvs/operator/version',
  357. name: '算子版本',
  358. icon: '',
  359. hidden: true,
  360. component: () => import('@/pages/cvs/operator/version.vue')
  361. }
  362. ]
  363. },
  364. {
  365. path: '/cvs/cvsSever',
  366. name: '数据管理',
  367. icon: '',
  368. children: [
  369. {
  370. path: '/cvs/cvsSever/template',
  371. name: '模版管理',
  372. icon: '',
  373. component: () => import('@/pages/cvs/dataServer/template.vue')
  374. }
  375. ]
  376. },
  377. {
  378. path: '/cvs/edge',
  379. name: '边缘设备',
  380. icon: '',
  381. children: [
  382. // {
  383. // path: '/cvs/edge/task',
  384. // name: '任务管理',
  385. // icon: '',
  386. // component: () => import('@/pages/cvs/edge/task.vue')
  387. // },
  388. {
  389. path: '/cvs/dataSever/video',
  390. name: '视频管理',
  391. icon: '',
  392. component: () => import('@/pages/cvs/edge/video.vue')
  393. }
  394. ]
  395. },
  396. {
  397. path: '/cvs/csys',
  398. name: '系统概览 ',
  399. icon: '',
  400. component: () => import('@/pages/cvs/csys/index.vue')
  401. }
  402. ]
  403. }
  404. // }HQDZKE6BBJCJB0412
  405. const demo = {
  406. path: '/demo',
  407. name: 'demo',
  408. icon: 'ProfileOutlined',
  409. component: () => import('@/pages/demo/index.vue')
  410. }
  411. const _routes = [iot, schedule, view, lowcode, user, cvs] 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