full-routes.ts 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836
  1. /**
  2. * 1. 前端维护的完整路由表, 用于创建"菜单"
  3. * 2. component 是 string,并不是 组件对象。
  4. * 3. 生成菜单,关注的 path,name,component,icon。
  5. * 4. 部分路由组件是菜单不可见的,当访问该路由时,左侧菜单的menu item会失去active状态。需要设置 meta.activeMenu 保持选中状态。
  6. */
  7. import { AppRouteRecordRaw } from './types';
  8. import { getTreeItem } from '@/utils';
  9. import { cloneDeep } from 'lodash-es';
  10. import { RouteRecordRaw } from 'vue-router';
  11. import { PageEnum } from '@/enums/pageEnum';
  12. type RouteRecordString = Omit<AppRouteRecordRaw, 'component'> & { component?: string };
  13. export const RootRoute: RouteRecordString = {
  14. path: '/',
  15. name: 'Root',
  16. redirect: PageEnum.BASE_HOME,
  17. meta: {
  18. title: 'Root',
  19. },
  20. };
  21. export const HOME_PAGE: RouteRecordString = {
  22. // 模板管理
  23. path: '/home',
  24. name: 'HomePage',
  25. component: '/home/PageHome',
  26. meta: {
  27. icon: '',
  28. title: '首页',
  29. },
  30. };
  31. /** 灾害防范的路由 */
  32. export const disasterPreventionRoute = {
  33. children: [
  34. {
  35. component: '/disaster/overview/PageOverview',
  36. id: 1025,
  37. meta: {
  38. activeMenu: null,
  39. alwaysShow: false,
  40. frameSrc: '',
  41. hidden: false,
  42. icon: 'OverviewIcon',
  43. isFrame: 0,
  44. isRoot: false,
  45. noCache: false,
  46. query: '',
  47. title: '总览',
  48. },
  49. name: 'disaster-prevention-overview',
  50. parentId: 1022,
  51. path: 'overview',
  52. redirect: '',
  53. },
  54. {
  55. component: '/disaster/monitor/PageMonitor',
  56. id: 1026,
  57. meta: {
  58. activeMenu: null,
  59. alwaysShow: false,
  60. frameSrc: '',
  61. hidden: false,
  62. icon: 'RiskPointMonitoringIcon',
  63. isFrame: 0,
  64. isRoot: false,
  65. noCache: false,
  66. query: '',
  67. title: '重点区域监测',
  68. },
  69. name: 'risk-point-monitoring',
  70. parentId: 1022,
  71. path: 'risk-point-monitoring',
  72. redirect: '',
  73. },
  74. {
  75. children: [
  76. {
  77. component: '/disaster/disaster-warning/PageWarningInfo',
  78. id: 1035,
  79. meta: {
  80. activeMenu: '/disaster-prevention/disaster-warning',
  81. alwaysShow: false,
  82. frameSrc: '',
  83. hidden: false,
  84. icon: '',
  85. isFrame: 0,
  86. isRoot: false,
  87. noCache: false,
  88. query: '',
  89. title: '预警信息',
  90. },
  91. name: 'disaster-warning-warning-info',
  92. parentId: 1027,
  93. path: 'warning-info',
  94. redirect: '',
  95. },
  96. {
  97. component: '/disaster/disaster-warning/PageDefenseNotice',
  98. id: 1037,
  99. meta: {
  100. activeMenu: null,
  101. alwaysShow: false,
  102. frameSrc: '',
  103. hidden: false,
  104. icon: '',
  105. isFrame: 0,
  106. isRoot: false,
  107. noCache: false,
  108. query: '',
  109. title: '防御通知',
  110. },
  111. name: 'disaster-warning-defense-notice',
  112. parentId: 1027,
  113. path: 'defense-notice',
  114. redirect: '',
  115. },
  116. {
  117. component: '/disaster/disaster-warning/PageDefenseNoticeItem',
  118. id: 1038,
  119. meta: {
  120. activeMenu: null,
  121. alwaysShow: false,
  122. frameSrc: '',
  123. hidden: false,
  124. icon: '',
  125. isFrame: 0,
  126. isRoot: false,
  127. noCache: false,
  128. query: '',
  129. title: '防御通知详情',
  130. },
  131. name: 'defense-notice-item',
  132. parentId: 1027,
  133. path: 'defense-notice-item',
  134. redirect: '',
  135. },
  136. ],
  137. component: '',
  138. id: 1027,
  139. meta: {
  140. activeMenu: null,
  141. alwaysShow: false,
  142. frameSrc: '',
  143. hidden: false,
  144. icon: 'DisasterWarningIcon',
  145. isFrame: 0,
  146. isRoot: false,
  147. noCache: false,
  148. query: '',
  149. title: '灾害预警',
  150. },
  151. name: 'disaster-warning',
  152. parentId: 1022,
  153. path: 'disaster-warning',
  154. redirect: '',
  155. },
  156. {
  157. children: [
  158. {
  159. component: '/disaster/disaster-precaution/PageTaskManagement',
  160. id: 1029,
  161. meta: {
  162. activeMenu: null,
  163. alwaysShow: false,
  164. frameSrc: '',
  165. hidden: false,
  166. icon: '',
  167. isFrame: 0,
  168. isRoot: false,
  169. noCache: false,
  170. query: '',
  171. title: '任务管理',
  172. },
  173. name: 'disaster-precaution-task-management',
  174. parentId: 1028,
  175. path: 'task-management',
  176. redirect: '',
  177. },
  178. {
  179. component: '/disaster/disaster-precaution/PageTaskItem',
  180. id: 1033,
  181. meta: {
  182. activeMenu: null,
  183. alwaysShow: false,
  184. frameSrc: '',
  185. hidden: true,
  186. icon: '',
  187. isFrame: 0,
  188. isRoot: false,
  189. noCache: false,
  190. query: '',
  191. title: '任务列表详情',
  192. },
  193. name: 'disaster-precaution-task-item',
  194. parentId: 1028,
  195. path: 'task-item',
  196. redirect: '',
  197. },
  198. {
  199. component: '/disaster/disaster-precaution/PageTaskExecution',
  200. id: 1030,
  201. meta: {
  202. activeMenu: null,
  203. alwaysShow: false,
  204. frameSrc: '',
  205. hidden: false,
  206. icon: '',
  207. isFrame: 0,
  208. isRoot: false,
  209. noCache: false,
  210. query: '',
  211. title: '任务执行',
  212. },
  213. name: 'disaster-precaution-task-execution',
  214. parentId: 1028,
  215. path: 'task-execution',
  216. redirect: '',
  217. },
  218. {
  219. component: '/disaster/disaster-precaution/PageTaskExecutionDetail',
  220. id: 1034,
  221. meta: {
  222. activeMenu: '/disaster-prevention/disaster-precaution/task-execution',
  223. alwaysShow: false,
  224. frameSrc: '',
  225. hidden: false,
  226. icon: '',
  227. isFrame: 0,
  228. isRoot: false,
  229. noCache: false,
  230. query: '',
  231. title: '任务执行详情',
  232. },
  233. name: 'disaster-precaution-task-execution-detail',
  234. parentId: 1028,
  235. path: 'task-execution-detail/:id',
  236. redirect: '',
  237. },
  238. {
  239. component: '/disaster/disaster-precaution/PageTaskTemplate',
  240. id: 1031,
  241. meta: {
  242. activeMenu: '/disaster-prevention/disaster-precaution/task-execution',
  243. alwaysShow: false,
  244. frameSrc: '',
  245. hidden: false,
  246. icon: '',
  247. isFrame: 0,
  248. isRoot: false,
  249. noCache: false,
  250. query: '',
  251. title: '任务模板',
  252. },
  253. name: 'disaster-precaution-task-template',
  254. parentId: 1028,
  255. path: 'task-template',
  256. redirect: '',
  257. },
  258. {
  259. component: '/todo/todo',
  260. id: 1032,
  261. meta: {
  262. activeMenu: '/disaster-prevention/disaster-precaution/task-template',
  263. alwaysShow: false,
  264. frameSrc: '',
  265. hidden: false,
  266. icon: '',
  267. isFrame: 0,
  268. isRoot: false,
  269. noCache: false,
  270. query: '',
  271. title: '任务模板详情',
  272. },
  273. name: 'disaster-precaution-template-detail',
  274. parentId: 1028,
  275. path: 'template-detail/:id',
  276. redirect: '',
  277. },
  278. ],
  279. component: '',
  280. id: 1028,
  281. meta: {
  282. activeMenu: null,
  283. alwaysShow: false,
  284. frameSrc: '',
  285. hidden: false,
  286. icon: 'DisasterPrecaution',
  287. isFrame: 0,
  288. isRoot: false,
  289. noCache: false,
  290. query: '',
  291. title: '预防检查',
  292. },
  293. name: 'disaster-precaution',
  294. parentId: 1022,
  295. path: 'disaster-precaution',
  296. redirect: '',
  297. },
  298. {
  299. children: [
  300. {
  301. component: '/disaster/disaster-control/PageDisposalManagement',
  302. id: 1038,
  303. meta: {
  304. activeMenu: '',
  305. alwaysShow: false,
  306. frameSrc: '',
  307. hidden: false,
  308. icon: '',
  309. isFrame: 0,
  310. isRoot: false,
  311. noCache: false,
  312. query: '',
  313. title: '处置管理',
  314. },
  315. name: 'disaster-control-disposal-management',
  316. parentId: 1027,
  317. path: 'disposal-management',
  318. redirect: '',
  319. },
  320. {
  321. component: '/disaster/disaster-control/PageDisposalManagementTaskItem',
  322. id: 1041,
  323. meta: {
  324. activeMenu: '/disaster-prevention/disaster-control/disposal-management',
  325. alwaysShow: false,
  326. frameSrc: '',
  327. hidden: false,
  328. icon: '',
  329. isFrame: 0,
  330. isRoot: false,
  331. noCache: false,
  332. query: '',
  333. title: '处置管理详情(任务项)',
  334. },
  335. name: 'disaster-control-disposal-management-task-item',
  336. parentId: 1027,
  337. path: 'disposal-management-task-item',
  338. redirect: '',
  339. },
  340. {
  341. component: '/disaster/disaster-control/PageDisposalManagementItem',
  342. id: 1042,
  343. meta: {
  344. activeMenu: '/disaster-prevention/disaster-control/disposal-management',
  345. alwaysShow: false,
  346. frameSrc: '',
  347. hidden: false,
  348. icon: '',
  349. isFrame: 0,
  350. isRoot: false,
  351. noCache: false,
  352. query: '',
  353. title: '处置管理详情(列表项)',
  354. },
  355. name: 'disaster-control-disposal-management-item',
  356. parentId: 1027,
  357. path: 'disposal-management-item/:id',
  358. redirect: '',
  359. },
  360. {
  361. component: '/disaster/disaster-control/PageLossReport',
  362. id: 1039,
  363. meta: {
  364. activeMenu: '',
  365. alwaysShow: false,
  366. frameSrc: '',
  367. hidden: false,
  368. icon: '',
  369. isFrame: 0,
  370. isRoot: false,
  371. noCache: false,
  372. query: '',
  373. title: '损失上报',
  374. },
  375. name: 'disaster-control-loss-report',
  376. parentId: 1027,
  377. path: 'loss-report',
  378. redirect: '',
  379. },
  380. {
  381. component: '/disaster/disaster-control/PageLossReportItem',
  382. id: 1043,
  383. meta: {
  384. activeMenu: '/disaster-prevention/disaster-control/loss-report',
  385. alwaysShow: false,
  386. frameSrc: '',
  387. hidden: false,
  388. icon: '',
  389. isFrame: 0,
  390. isRoot: false,
  391. noCache: false,
  392. query: '',
  393. title: '创建损失记录',
  394. },
  395. name: 'disaster-control-loss-report-item',
  396. parentId: 1027,
  397. path: 'loss-report-item/:id',
  398. redirect: '',
  399. },
  400. {
  401. component: '/disaster/disaster-control/PageDisposalRectification',
  402. id: 1040,
  403. meta: {
  404. activeMenu: '',
  405. alwaysShow: false,
  406. frameSrc: '',
  407. hidden: false,
  408. icon: '',
  409. isFrame: 0,
  410. isRoot: false,
  411. noCache: false,
  412. query: '',
  413. title: '处置整改',
  414. },
  415. name: 'disaster-control-disposal-rectification',
  416. parentId: 1027,
  417. path: 'disposal-rectification',
  418. redirect: '',
  419. },
  420. {
  421. component: '/disaster/disaster-control/PageDisposalRectificationItem',
  422. id: 1044,
  423. meta: {
  424. activeMenu: '/disaster-prevention/disaster-control/disposal-rectification',
  425. alwaysShow: false,
  426. frameSrc: '',
  427. hidden: false,
  428. icon: '',
  429. isFrame: 0,
  430. isRoot: false,
  431. noCache: false,
  432. query: '',
  433. title: '整改处理',
  434. },
  435. name: 'disaster-control-disposal-rectification-item',
  436. parentId: 1027,
  437. path: 'disposal-rectification-item/:id',
  438. redirect: '',
  439. },
  440. ],
  441. component: '',
  442. id: 1032,
  443. meta: {
  444. activeMenu: null,
  445. alwaysShow: false,
  446. frameSrc: '',
  447. hidden: false,
  448. icon: 'DisasterControlIcon',
  449. isFrame: 0,
  450. isRoot: false,
  451. noCache: false,
  452. query: '',
  453. title: '灾害处置',
  454. },
  455. name: 'disaster-control',
  456. parentId: 1022,
  457. path: 'disaster-control',
  458. redirect: '',
  459. },
  460. ],
  461. component: 'MENU_LAYOUT',
  462. id: 1022,
  463. meta: {
  464. activeMenu: null,
  465. alwaysShow: false,
  466. frameSrc: '',
  467. hidden: false,
  468. icon: 'CameraOutlined',
  469. isFrame: 0,
  470. isRoot: false,
  471. noCache: false,
  472. query: '',
  473. title: '灾害防范',
  474. },
  475. name: 'DisasterPrevention',
  476. parentId: -1,
  477. path: '/disaster-prevention',
  478. redirect: '',
  479. };
  480. /** 平台管理 */
  481. export const platformRoutes = {
  482. path: '/platform',
  483. name: 'Platform',
  484. component: 'MENU_LAYOUT',
  485. meta: {
  486. icon: '',
  487. title: '平台管理',
  488. },
  489. redirect: '',
  490. children: [
  491. {
  492. path: 'user',
  493. name: 'User',
  494. meta: {
  495. icon: 'UserOutlined',
  496. title: '用户管理',
  497. },
  498. children: [
  499. {
  500. // 组织管理
  501. path: 'department',
  502. name: 'UserDepartment',
  503. component: '/auth/dept/dept',
  504. meta: {
  505. icon: '',
  506. title: '组织管理',
  507. },
  508. },
  509. {
  510. // 角色管理
  511. path: 'role',
  512. name: 'UserRole',
  513. component: '/system/role/role',
  514. meta: {
  515. icon: '',
  516. title: '角色管理',
  517. },
  518. },
  519. {
  520. // 账号管理
  521. path: 'account',
  522. name: 'UserAccount',
  523. component: '/system/user/user',
  524. meta: {
  525. icon: '',
  526. title: '账号管理',
  527. },
  528. },
  529. {
  530. // 账号管理
  531. path: 'person',
  532. name: 'Person',
  533. component: '/todo/todo',
  534. meta: {
  535. icon: '',
  536. title: '人员分组',
  537. },
  538. },
  539. ],
  540. },
  541. {
  542. // 菜单管理
  543. path: 'menu',
  544. name: 'SystemMenu',
  545. component: '/system/menu/menu',
  546. meta: {
  547. icon: 'UserOutlined',
  548. title: '菜单管理',
  549. },
  550. },
  551. {
  552. // 权限管理
  553. path: 'permission',
  554. name: 'SystemPermission',
  555. component: '/system/permission/PagePermission',
  556. meta: {
  557. icon: 'UserOutlined',
  558. title: '权限管理',
  559. },
  560. },
  561. {
  562. path: 'dictionary',
  563. name: 'SystemDictionary',
  564. component: '/system/dictionary/dictionary',
  565. meta: {
  566. icon: 'UserOutlined',
  567. title: '字典管理',
  568. },
  569. },
  570. ],
  571. };
  572. export const exceptionRouters =
  573. /**
  574. * 异常页面
  575. */
  576. {
  577. path: '/exception',
  578. name: 'Exception',
  579. component: 'LAYOUT',
  580. redirect: '/exception/403',
  581. meta: {
  582. icon: 'ExclamationCircleOutlined',
  583. title: '异常页面',
  584. ignoreAuth: true,
  585. },
  586. children: [
  587. {
  588. // 403,
  589. path: '403',
  590. name: 'Exception403',
  591. component: '/exception/403',
  592. meta: {
  593. icon: '',
  594. title: '403',
  595. },
  596. },
  597. {
  598. path: '500',
  599. name: 'Exception500',
  600. component: '/exception/500',
  601. meta: {
  602. icon: '',
  603. title: '500',
  604. },
  605. },
  606. ],
  607. };
  608. export const fullRoutes: AppRouteRecordRaw[] = [
  609. disasterPreventionRoute,
  610. // userRoutes,
  611. // systemRoutes,
  612. platformRoutes,
  613. /**
  614. * 消息管理
  615. */
  616. {
  617. path: '/message',
  618. name: 'Message',
  619. component: 'LAYOUT',
  620. meta: {
  621. icon: 'SendOutlined',
  622. title: '消息管理',
  623. },
  624. children: [
  625. {
  626. // 报表推送
  627. path: 'report',
  628. name: 'MessageReport',
  629. component: '/message/reportmessage/ReportMessage',
  630. meta: {
  631. icon: '',
  632. title: '报表推送',
  633. },
  634. },
  635. {
  636. // 报表推送配置。二级页面,菜单不可见!!!
  637. path: 'report-config',
  638. name: 'MessageReportConfig',
  639. component: '/message/reportmessage/ReportOperation',
  640. meta: {
  641. icon: '',
  642. title: '报表推送配置',
  643. activeMenu: 'MessageReport',
  644. },
  645. },
  646. {
  647. // 报警推送
  648. path: 'alarm',
  649. name: 'MessageAlarm',
  650. component: '/message/alarmMessages/alarmMessages',
  651. meta: {
  652. icon: '',
  653. title: '报警推送',
  654. },
  655. },
  656. {
  657. // 报警推送配置 。二级页面,菜单不可见!!!
  658. path: 'alarm-config',
  659. name: 'MessageAlarmConfig',
  660. component: '/message/alarm-config/AlarmConfig',
  661. meta: {
  662. icon: '',
  663. title: '报警推送配置',
  664. activeMenu: 'MessageAlarm',
  665. },
  666. },
  667. {
  668. // 系统通知
  669. path: 'sys-notification',
  670. name: 'MessageSysNotification',
  671. component: '/message/systemNotifications/systemNotifications',
  672. meta: {
  673. icon: '',
  674. title: '系统通知',
  675. },
  676. },
  677. {
  678. // 系统通知配置。二级页面,菜单不可见!!!
  679. path: 'sys-notification-config',
  680. name: 'MessageSysNotificationConfig',
  681. component: '/message/sysnotion-config/SysnotionConfig',
  682. meta: {
  683. icon: '',
  684. title: '系统通知配置',
  685. activeMenu: 'MessageSysNotification',
  686. },
  687. },
  688. {
  689. // 人员分组
  690. path: 'personnel-group',
  691. name: 'MessagePersonnelGroup',
  692. component: '/message/persongroup/UserGroup',
  693. meta: {
  694. icon: '',
  695. title: '人员分组',
  696. },
  697. },
  698. {
  699. // 问题处理通知
  700. path: 'question-notification',
  701. name: 'MessageQuestionNotification',
  702. component: '/message/question-notifications/QuestionNotifications',
  703. meta: {
  704. icon: '',
  705. title: '问题处理通知',
  706. },
  707. },
  708. ],
  709. },
  710. /**
  711. * 数据管理
  712. */
  713. {
  714. path: '/data',
  715. name: 'Data',
  716. component: 'LAYOUT',
  717. meta: {
  718. icon: 'LineChartOutlined',
  719. title: '数据管理',
  720. },
  721. children: [
  722. {
  723. // 平台统计
  724. path: 'platform',
  725. name: 'DataPlatform',
  726. component: '/datamanager/platformdata/PlatformData',
  727. meta: {
  728. icon: '',
  729. title: '平台统计',
  730. },
  731. },
  732. {
  733. // 历史视频 (视频回看)
  734. path: 'playback',
  735. name: 'DataPlayback',
  736. component: '/datamanager/playback/Playback',
  737. meta: {
  738. icon: '',
  739. title: '历史视频',
  740. },
  741. },
  742. {
  743. // 违规问题
  744. path: 'violation',
  745. name: 'DataViolation',
  746. component: '/datamanager/alertformdata/AlertformData',
  747. meta: {
  748. icon: '',
  749. title: '违规问题',
  750. },
  751. },
  752. ],
  753. },
  754. ] as const;
  755. /**
  756. * 类型定义。避免与已有的定义冲突,避免与 vue-router的类型定义冲突,前面加 _ 前缀
  757. */
  758. export interface _RouteViewItem {
  759. label: string;
  760. value: string;
  761. }
  762. export type _RouteView = _RouteViewItem & { children?: _RouteViewItem[] | null };
  763. export type _RouteViewTree = _RouteView[];
  764. /**
  765. * 获取指定 父路由 下的子路由。
  766. * 若 父级路由 未指定,则返回一级路由
  767. */
  768. export function getChildRoutesView(parentRouteName?: string | null): _RouteViewItem[] {
  769. // 未指定 parentRouteName, 则返回 level1 的路由
  770. if (parentRouteName == null) {
  771. return fullRoutes.map((route) => ({
  772. label: route.meta.title as string,
  773. value: route.name,
  774. }));
  775. }
  776. // 获取指定父路由的子路由
  777. const parentRoute: AppRouteRecordRaw = cloneDeep(getTreeItem(fullRoutes, parentRouteName, 'name'));
  778. if (parentRoute.children && parentRoute.children.length > 0) {
  779. return parentRoute.children.map((route) => ({
  780. label: route.meta.title as string,
  781. value: route.name,
  782. }));
  783. } else {
  784. return [];
  785. }
  786. }
  787. /**
  788. * 获取指定的 路由信息
  789. */
  790. export function getRouteByName(routeName: string) {
  791. return cloneDeep(getTreeItem(fullRoutes, routeName, 'name')) as AppRouteRecordRaw;
  792. }
  793. /**
  794. * 转换成 el-tree-select 的数据结构形式
  795. */
  796. export function transformToRouteViewTree(routes?: AppRouteRecordRaw[] | null) {
  797. const tree: _RouteViewTree = [];
  798. if (routes == null) return tree;
  799. for (const route of routes) {
  800. const treeItem: _RouteView = {
  801. value: route.name,
  802. label: route.meta.title as string,
  803. children: null,
  804. };
  805. if (route.children && route.children.length > 0) {
  806. treeItem.children = transformToRouteViewTree(route.children);
  807. tree.push(treeItem);
  808. } else {
  809. tree.push(treeItem);
  810. }
  811. }
  812. return tree;
  813. }
  814. export const routeViewTree = transformToRouteViewTree(fullRoutes);