dynamic-routes.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  1. import { basicRouteMap } from './router-modules.js'
  2. import { AccessEnum } from '~@/utils/constant'
  3. export default [
  4. {
  5. path: '/dashboard',
  6. redirect: '/dashboard/analysis',
  7. name: 'Dashboard',
  8. meta: {
  9. title: '仪表盘',
  10. icon: 'DashboardOutlined',
  11. },
  12. component: basicRouteMap.RouteView,
  13. children: [
  14. {
  15. path: '/dashboard/analysis',
  16. name: 'DashboardAnalysis',
  17. component: () => import('~/pages/dashboard/analysis/index.vue'),
  18. meta: {
  19. title: '分析页',
  20. },
  21. },
  22. {
  23. path: '/dashboard/monitor',
  24. name: 'DashboardMonitor',
  25. component: () => import('~/pages/dashboard/monitor/index.vue'),
  26. meta: {
  27. title: '监控页',
  28. },
  29. },
  30. {
  31. path: '/dashboard/workplace',
  32. name: 'DashboardWorkplace',
  33. component: () => import('~/pages/dashboard/workplace/index.vue'),
  34. meta: {
  35. title: '监控页',
  36. },
  37. },
  38. ],
  39. },
  40. {
  41. path: '/form',
  42. redirect: '/form/basic-form',
  43. name: 'Form',
  44. meta: {
  45. title: '表单页',
  46. icon: 'FormOutlined',
  47. },
  48. component: basicRouteMap.RouteView,
  49. children: [
  50. {
  51. path: '/form/basic-form',
  52. name: 'FormBasic',
  53. component: () => import('~/pages/form/basic-form/index.vue'),
  54. meta: {
  55. title: '基础表单',
  56. locale: 'menu.form.basic-form',
  57. },
  58. },
  59. {
  60. path: '/form/step-form',
  61. name: 'FormStep',
  62. component: () => import('~/pages/form/step-form/index.vue'),
  63. meta: {
  64. title: '分步表单',
  65. locale: 'menu.form.step-form',
  66. },
  67. },
  68. {
  69. path: '/form/advanced-form',
  70. name: 'FormAdvanced',
  71. component: () => import('~/pages/form/advanced-form/index.vue'),
  72. meta: {
  73. title: '高级表单',
  74. locale: 'menu.form.advanced-form',
  75. },
  76. },
  77. ],
  78. },
  79. {
  80. path: '/log',
  81. redirect: '/log/log',
  82. name: 'Log',
  83. meta: {
  84. title: '日志管理',
  85. icon: 'ProfileOutlined',
  86. },
  87. component: basicRouteMap.RouteView,
  88. children: [
  89. {
  90. path: '/log/log',
  91. name: 'LogLog',
  92. component: () => import('~/pages/log/log.vue'),
  93. meta: {
  94. title: '日志',
  95. },
  96. },
  97. {
  98. path: '/log/waflog',
  99. name: 'LogWafLog',
  100. component: () => import('~/pages/log/waflog.vue'),
  101. meta: {
  102. title: 'WAF日志',
  103. },
  104. },
  105. {
  106. path: '/log/log-info/:id',
  107. name: 'LogLogInfo',
  108. component: () => import('~/pages/log/log-info.vue'),
  109. meta: {
  110. title: '日志详情',
  111. hidden: true, // 不在菜单中显示
  112. activeMenu: '/log/log' // 高亮父菜单
  113. },
  114. },
  115. ],
  116. },
  117. {
  118. path: '/link',
  119. redirect: '/link/iframe',
  120. name: 'Link',
  121. meta: {
  122. title: '链接',
  123. icon: 'LinkOutlined',
  124. },
  125. component: basicRouteMap.RouteView,
  126. children: [
  127. {
  128. path: '/link/iframe',
  129. name: 'LinkIframe',
  130. component: basicRouteMap.Iframe,
  131. meta: {
  132. title: 'AntDesign',
  133. url: 'https://ant.design/',
  134. },
  135. },
  136. {
  137. path: '/link/antdv',
  138. name: 'LinkAntdv',
  139. component: basicRouteMap.Iframe,
  140. meta: {
  141. title: 'AntDesignVue',
  142. url: 'https://antdv.com/',
  143. },
  144. },
  145. {
  146. path: 'https://www.baidu.com',
  147. name: 'LinkExternal',
  148. meta: {
  149. title: '跳转百度',
  150. // target: '_self',
  151. },
  152. },
  153. ],
  154. },
  155. {
  156. path: '/menu',
  157. redirect: '/menu/menu1',
  158. name: 'Menu',
  159. meta: {
  160. title: '网关组',
  161. icon: 'BarsOutlined',
  162. },
  163. component: basicRouteMap.RouteView,
  164. children: [
  165. {
  166. path: '/menu/menu1',
  167. name: 'MenuMenu11',
  168. component: () => import('~/pages/menu/menu1.vue'),
  169. meta: {
  170. title: '网关IP管理',
  171. },
  172. },
  173. {
  174. path: '/menu/menu2',
  175. name: 'MenuMenu12',
  176. component: () => import('~/pages/menu/menu2.vue'),
  177. meta: {
  178. title: '菜单2',
  179. },
  180. },
  181. {
  182. path: '/menu/menu3',
  183. redirect: '/menu/menu3/menu1',
  184. name: 'MenuMenu1-1',
  185. meta: {
  186. title: '菜单1-1',
  187. },
  188. children: [
  189. {
  190. path: '/menu/menu3/menu1',
  191. name: 'MenuMenu111',
  192. component: () => import('~/pages/menu/menu-1-1/menu1.vue'),
  193. meta: {
  194. title: '菜单1-1-1',
  195. },
  196. },
  197. {
  198. path: '/menu/menu3/menu2',
  199. name: 'MenuMenu112',
  200. component: () => import('~/pages/menu/menu-1-1/menu2.vue'),
  201. meta: {
  202. title: '菜单1-1-2',
  203. },
  204. },
  205. ],
  206. },
  207. {
  208. path: '/menu/menu4',
  209. redirect: '/menu/menu4/menu1',
  210. name: 'MenuMenu2-1',
  211. meta: {
  212. title: '菜单2-1',
  213. },
  214. children: [
  215. {
  216. path: '/menu/menu4/menu1',
  217. name: 'MenuMenu211',
  218. component: () => import('~/pages/menu/menu-2-1/menu1.vue'),
  219. meta: {
  220. title: '菜单2-1-1',
  221. },
  222. },
  223. {
  224. path: '/menu/menu4/menu2',
  225. name: 'MenuMenu212',
  226. component: () => import('~/pages/menu/menu-2-1/menu2.vue'),
  227. meta: {
  228. title: '菜单2-1-2',
  229. },
  230. },
  231. ],
  232. },
  233. ],
  234. },
  235. {
  236. path: '/profile',
  237. name: 'profile',
  238. redirect: '/profile/basic',
  239. meta: {
  240. title: 'menu.profile',
  241. icon: 'ProfileOutlined',
  242. locale: 'menu.profile',
  243. },
  244. component: basicRouteMap.RouteView,
  245. children: [
  246. {
  247. path: '/profile/basic',
  248. name: 'ProfileBasic',
  249. component: () => import('~/pages/profile/basic/index.vue'),
  250. meta: {
  251. title: 'menu.profile.basic',
  252. locale: 'menu.profile.basic',
  253. },
  254. },
  255. ],
  256. },
  257. {
  258. path: '/access',
  259. redirect: '/access/common',
  260. name: 'Access',
  261. meta: {
  262. title: '权限模块',
  263. icon: 'ClusterOutlined',
  264. },
  265. children: [
  266. {
  267. path: '/access/common',
  268. name: 'AccessCommon',
  269. component: () => import('~/pages/access/common.vue'),
  270. meta: {
  271. title: '通用权限',
  272. },
  273. },
  274. {
  275. path: '/access/admin',
  276. name: 'AccessAdmin',
  277. component: () => import('~/pages/access/admin.vue'),
  278. meta: {
  279. title: '管理员',
  280. access: [AccessEnum.ADMIN],
  281. },
  282. },
  283. ],
  284. },
  285. {
  286. path: '/exception',
  287. redirect: '/exception/403',
  288. name: 'Exception',
  289. meta: {
  290. title: '异常页',
  291. icon: 'WarningOutlined',
  292. locale: 'menu.exception',
  293. },
  294. children: [
  295. {
  296. path: '/exception/403',
  297. name: 'Exception403',
  298. component: () => import('~/pages/exception/403.vue'),
  299. meta: {
  300. title: '403',
  301. locale: 'menu.exception.not-permission',
  302. },
  303. },
  304. {
  305. path: '/exception/404',
  306. name: 'Exception404',
  307. component: () => import('~/pages/exception/404.vue'),
  308. meta: {
  309. title: '404',
  310. locale: 'menu.exception.not-find',
  311. },
  312. },
  313. {
  314. path: '/exception/500',
  315. name: 'Exception500',
  316. component: () => import('~/pages/exception/500.vue'),
  317. meta: {
  318. title: '500',
  319. locale: 'menu.exception.server-error',
  320. },
  321. },
  322. ],
  323. },
  324. // 结果页
  325. {
  326. path: '/result',
  327. redirect: '/result/success',
  328. name: 'Result',
  329. meta: {
  330. title: '结果页',
  331. icon: 'CheckCircleOutlined',
  332. locale: 'menu.result',
  333. },
  334. component: basicRouteMap.RouteView,
  335. children: [
  336. {
  337. path: '/result/success',
  338. name: 'ResultSuccess',
  339. component: () => import('~/pages/result/success.vue'),
  340. meta: {
  341. title: '成功页',
  342. locale: 'menu.result.success',
  343. },
  344. },
  345. {
  346. path: '/result/fail',
  347. name: 'ResultFail',
  348. component: () => import('~/pages/result/fail.vue'),
  349. meta: {
  350. title: '失败页',
  351. locale: 'menu.result.fail',
  352. },
  353. },
  354. ],
  355. },
  356. {
  357. path: '/list',
  358. redirect: '/list/card-list',
  359. name: 'List',
  360. meta: {
  361. title: '列表页',
  362. icon: 'TableOutlined',
  363. locale: 'menu.list',
  364. },
  365. component: basicRouteMap.RouteView,
  366. children: [
  367. {
  368. path: '/list/card-list',
  369. name: 'CardList',
  370. component: () => import('~/pages/list/card-list.vue'),
  371. meta: {
  372. title: '卡片列表',
  373. locale: 'menu.list.card-list',
  374. },
  375. },
  376. {
  377. path: '/list/table-list',
  378. name: 'ConsultTable',
  379. component: () => import('~/pages/list/table-list.vue'),
  380. meta: {
  381. title: '查询表格',
  382. locale: 'menu.list.consult-table',
  383. },
  384. },
  385. {
  386. path: '/list/crud-table',
  387. name: 'CrudTable',
  388. component: () => import('~/pages/list/crud-table.vue'),
  389. meta: {
  390. title: '增删改查表格',
  391. locale: 'menu.list.crud-table',
  392. },
  393. },
  394. {
  395. path: '/list/basic-list',
  396. name: 'BasicList',
  397. component: () => import('~/pages/list/basic-list.vue'),
  398. meta: {
  399. title: '标准列表',
  400. locale: 'menu.list.basic-list',
  401. },
  402. },
  403. {
  404. path: '/list/search-list',
  405. name: 'SearchList',
  406. component: () => import('~/pages/list/search-list/index.vue'),
  407. meta: {
  408. title: '搜索列表',
  409. locale: 'menu.list.search-list',
  410. },
  411. redirect: '/list/search-list/articles',
  412. children: [
  413. {
  414. path: '/list/search-list/articles',
  415. name: 'SearchListArticles',
  416. component: () => import('~/pages/list/search-list/articles.vue'),
  417. meta: {
  418. title: '搜索列表(文章)',
  419. locale: 'menu.list.search-list.articles',
  420. },
  421. },
  422. {
  423. path: '/list/search-list/projects',
  424. name: 'SearchListProjects',
  425. component: () => import('~/pages/list/search-list/projects.vue'),
  426. meta: {
  427. title: '搜索列表(项目)',
  428. locale: 'menu.list.search-list.projects',
  429. },
  430. },
  431. {
  432. path: '/list/search-list/applications',
  433. name: 'SearchListApplications',
  434. component: () => import('~/pages/list/search-list/applications.vue'),
  435. meta: {
  436. title: '搜索列表(应用)',
  437. locale: 'menu.list.search-list.applications',
  438. },
  439. },
  440. ],
  441. },
  442. ],
  443. },
  444. {
  445. path: '/account',
  446. redirect: '/account/center',
  447. name: 'Account',
  448. meta: {
  449. title: '个人页',
  450. icon: 'UserOutlined',
  451. locale: 'menu.account',
  452. },
  453. component: basicRouteMap.RouteView,
  454. children: [
  455. {
  456. path: '/account/center',
  457. name: 'AccountCenter',
  458. component: () => import('~/pages/account/center.vue'),
  459. meta: {
  460. title: '个人主页',
  461. locale: 'menu.account.center',
  462. },
  463. },
  464. {
  465. path: '/account/settings',
  466. name: 'AccountSettings',
  467. component: () => import('~/pages/account/settings.vue'),
  468. meta: {
  469. title: '个人设置',
  470. locale: 'menu.account.settings',
  471. },
  472. },
  473. {
  474. path: '/account/settings/:id',
  475. name: 'AccountSettings1',
  476. component: () => import('~/pages/account/settings.vue'),
  477. meta: {
  478. title: '个人设置1',
  479. locale: 'menu.account.settings',
  480. hideInMenu: true,
  481. parentKeys: ['/account/settings'],
  482. },
  483. },
  484. ],
  485. },
  486. ]