index.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. Vue.use(Router)
  4. /* Layout */
  5. import Layout from '@/layout'
  6. /* Home */
  7. import Home from '@/views/home/index'
  8. /**
  9. * Note: sub-menu only appear when route children.length >= 1
  10. * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
  11. *
  12. * hidden: true if set true, item will not show in the sidebar(default is false)
  13. * alwaysShow: true if set true, will always show the root menu
  14. * if not set alwaysShow, when item has more than one children route,
  15. * it will becomes nested mode, otherwise not show the root menu
  16. * redirect: noRedirect if set noRedirect will no redirect in the breadcrumb
  17. * name:'router-name' the name is used by <keep-alive> (must set!!!)
  18. * meta : {
  19. roles: ['admin','editor'] control the page roles (you can set multiple roles)
  20. title: 'title' the name show in sidebar and breadcrumb (recommend set)
  21. icon: 'svg-name' the icon show in the sidebar
  22. breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
  23. activeMenu: '/example/list' if set path, the sidebar will highlight the path you set
  24. }
  25. */
  26. /**
  27. * constantRoutes
  28. * a base page that does not have permission requirements
  29. * all roles can be accessed
  30. */
  31. export const constantRoutes = [
  32. {
  33. path: '/login',
  34. component: () => import('@/views/login/index'),
  35. hidden: true
  36. },
  37. {
  38. path: '/404',
  39. component: () => import('@/views/404'),
  40. hidden: true
  41. },
  42. {
  43. path: '/',
  44. component: Home,
  45. hidden: true
  46. },
  47. {
  48. path: '/home',
  49. component: Home,
  50. name: '首页',
  51. hidden: true
  52. },
  53. // {
  54. // path: '/home',
  55. // component: Layout,
  56. // redirect: '/dashboard',
  57. // children: [{
  58. // path: 'dashboard',
  59. // name: 'Dashboard',
  60. // component: () => import('@/views/dashboard/index'),
  61. // meta: { title: 'Dashboard', icon: 'dashboard' }
  62. // }]
  63. // },
  64. {
  65. path: '/Platform',
  66. component: Layout,
  67. redirect: '/Platform/workbench',
  68. name: '流程管控',
  69. meta: { title: '流程管控', icon: 'env' },
  70. children: [
  71. {
  72. path: 'workbench',
  73. name: 'workbench',
  74. // hidden: true,
  75. component: () => import('@/views/Platform/workbench'),
  76. meta: { title: '我的工作台' }
  77. },
  78. {
  79. path: '/Platform/projectManage',
  80. name: '项目管理',
  81. component: () => import('@/views/Platform/presentation/testa'),
  82. redirect: '/Platform/projectManage/projectList',
  83. meta: { title: '项目管理' },
  84. children: [
  85. {
  86. path: 'projectList',
  87. name: '项目列表',
  88. component: () => import('@/views/projectManage/projectList/projectListIndex'),
  89. meta: { title: '项目列表' }
  90. },
  91. {
  92. path: 'projectCreate',
  93. hidden: true,
  94. name: '项目创建',
  95. component: () => import('@/views/projectManage/projectList/projectCreate'),
  96. meta: { title: '项目创建' }
  97. },
  98. {
  99. path: 'projectPreview',
  100. hidden: true,
  101. name: '项目查看',
  102. component: () => import('@/views/projectManage/projectList/projectPreview'),
  103. meta: { title: '项目查看' }
  104. },
  105. {
  106. path: 'taskList',
  107. name: '任务列表',
  108. component: () => import('@/views/projectManage/taskList/taskListIndex'),
  109. meta: { title: '任务列表' }
  110. },
  111. {
  112. path: 'taskCreate',
  113. hidden: true,
  114. name: '任务创建',
  115. component: () => import('@/views/projectManage/taskList/taskCreate'),
  116. meta: { title: '任务创建' }
  117. },
  118. {
  119. path: 'taskPreview',
  120. hidden: true,
  121. name: '任务查看',
  122. component: () => import('@/views/projectManage/taskList/taskPreview'),
  123. meta: { title: '任务查看' }
  124. },
  125. {
  126. path: 'taskUpdate',
  127. hidden: true,
  128. name: '任务更新',
  129. component: () => import('@/views/projectManage/taskList/taskUpdateCreate'),
  130. meta: { title: '任务更新' }
  131. }
  132. ]
  133. },
  134. {
  135. path: '/Platform/useCasePage',
  136. name: '用例管理',
  137. // hidden: true,
  138. component: () => import('@/views/Platform/useCasePage'),
  139. meta: { title: '用例管理' },
  140. children: [
  141. {
  142. path: 'createUse',
  143. name: '用例新增',
  144. hidden: true,
  145. component: () => import('@/views/Platform/useCase/createUse'),
  146. meta: { title: '用例新增' }
  147. },
  148. {
  149. path: 'queryUse',
  150. name: '用例查看',
  151. hidden: true,
  152. component: () => import('@/views/Platform/useCase/queryUse'),
  153. meta: { title: '用例查看' }
  154. }
  155. ]
  156. },
  157. {
  158. path: '/Platform/presentation',
  159. name: '测试管理',
  160. component: () => import('@/views/Platform/presentation/testa'),
  161. meta: { title: '测试管理' },
  162. children: [
  163. {
  164. path: 'testPageData',
  165. name: '测试计划管理',
  166. hidden: true,
  167. component: () => import('@/views/Platform/presentation/testPage.vue'),
  168. meta: { title: '测试计划管理' }
  169. },
  170. {
  171. path: 'testPresentation',
  172. name: '日报报告',
  173. component: () => import('@/views/Platform/presentation/testPresentation'),
  174. meta: { title: '日报报告' }
  175. },
  176. {
  177. path: 'ResultPage',
  178. name: '准出报告',
  179. component: () => import('@/views/Platform/presentation/ResultPage'),
  180. meta: { title: '准出报告' }
  181. },
  182. {
  183. path: 'Assumptions',
  184. name: '提测报告',
  185. component: () => import('@/views/Platform/presentation/Assumptions'),
  186. meta: { title: '提测报告' }
  187. },
  188. {
  189. path: 'DailyNewsAdded',
  190. name: '日报报告',
  191. hidden: true,
  192. component: () => import('@/views/Platform/presentation/DailyNewsAdded'),
  193. meta: { title: '新增日报报告' }
  194. },
  195. {
  196. path: 'presentationReport',
  197. name: '提测报告',
  198. hidden: true,
  199. component: () => import('@/views/Platform/presentation/presentationReport'),
  200. meta: { title: '新增服务器提测报告' }
  201. },
  202. {
  203. path: 'acceptTheReport',
  204. name: '提测预览',
  205. hidden: true,
  206. component: () => import('@/views/Platform/presentation/acceptTheReport'),
  207. meta: { title: '提测预览' }
  208. },
  209. {
  210. path: 'testPresenyL',
  211. name: '日报预览',
  212. hidden: true,
  213. component: () => import('@/views/Platform/presentation/testPresenyL'),
  214. meta: { title: '日报预览' }
  215. },
  216. {
  217. path: 'ResultPageyL',
  218. name: '准出预览',
  219. hidden: true,
  220. component: () => import('@/views/Platform/presentation/ResultPageyL'),
  221. meta: { title: '准出预览' }
  222. },
  223. {
  224. path: 'Acceptance',
  225. name: '准出报告',
  226. hidden: true,
  227. component: () => import('@/views/Platform/presentation/Acceptance'),
  228. meta: { title: '准出报告,新增服务器端报告' }
  229. },
  230. {
  231. path: 'ClientAcceptance',
  232. name: '准出报告',
  233. hidden: true,
  234. component: () => import('@/views/Platform/presentation/ClientAcceptance'),
  235. meta: { title: '准出报告,新增客户端报告' }
  236. },
  237. {
  238. path: 'PresentReport',
  239. name: '提测报告,新增报告',
  240. hidden: true,
  241. component: () => import('@/views/Platform/presentation/PresentReport'),
  242. meta: { title: '新增客户端提测报告' }
  243. },
  244. {
  245. path: 'projectQuery',
  246. name: '项目查看编辑',
  247. hidden: true,
  248. component: () => import('@/views/Platform/projectQuery/projectQuery.vue'),
  249. meta: { title: '项目查看编辑' }
  250. },
  251. {
  252. path: 'taskQuery',
  253. name: '任务查看编辑',
  254. hidden: true,
  255. component: () => import('@/views/Platform/projectQuery/taskQuery.vue'),
  256. meta: { title: '任务查看编辑' }
  257. }
  258. ]
  259. },
  260. {
  261. path: '/Platform/defectManagement',
  262. name: '缺陷管理',
  263. component: () => import('@/views/Platform/defectManagement'),
  264. meta: { title: '缺陷管理' }
  265. },
  266. {
  267. path: '/Platform/defectManagement/bugCreate',
  268. name: '新建Bug',
  269. hidden: true,
  270. component: () => import('@/views/Platform/bugManage/bugCreate'),
  271. meta: { title: '新建Bug' }
  272. },
  273. {
  274. path: '/Platform/defectManagement/bugQuery',
  275. name: '查看Bug',
  276. hidden: true,
  277. component: () => import('@/views/Platform/bugManage/bugQuery'),
  278. meta: { title: '查看Bug' }
  279. },
  280. {
  281. path: '/Platform/defectManagement/bugUpdate',
  282. name: '更新Bug',
  283. hidden: true,
  284. component: () => import('@/views/Platform/bugManage/bugUpdate'),
  285. meta: { title: '更新Bug' }
  286. },
  287. {
  288. path: '/Platform/setUp',
  289. // component: Layout,
  290. name: '设置',
  291. // meta: { title: '设置' },
  292. component: () => import('@/views/Platform/setUp/testa'),
  293. meta: { title: '设置' },
  294. children: [{
  295. path: 'systemSetup',
  296. name: '系统设置',
  297. component: () => import('@/views/Platform/setUp/systemSetup/testa'),
  298. meta: { title: '系统设置' },
  299. children: [{
  300. path: 'bizPage',
  301. name: '业务线',
  302. // hidden: true,
  303. component: () => import('@/views/Platform/setUp/systemSetup/bizPage'),
  304. meta: { title: '业务线' }
  305. },
  306. {
  307. path: 'platformPage',
  308. name: '平台类型',
  309. // hidden: true,
  310. component: () => import('@/views/Platform/setUp/systemSetup/platformPage'),
  311. meta: { title: '平台类型' }
  312. },
  313. {
  314. path: 'modulePage',
  315. name: '业务模块',
  316. // hidden: true,
  317. component: () => import('@/views/Platform/setUp/systemSetup/modulePage'),
  318. meta: { title: '业务模块' }
  319. },
  320. {
  321. path: 'projectPage',
  322. name: '工程模块',
  323. // hidden: true,
  324. component: () => import('@/views/Platform/setUp/systemSetup/projectPage'),
  325. meta: { title: '工程模块' }
  326. }
  327. ]
  328. },
  329. {
  330. path: 'teamPage',
  331. name: '团队设置',
  332. component: () => import('@/views/Platform/setUp/teamPage'),
  333. meta: { title: '团队设置' }
  334. }
  335. ]
  336. }
  337. ]
  338. },
  339. {
  340. path: '/env-platform',
  341. component: Layout,
  342. redirect: '/env-platform/env',
  343. name: '环境',
  344. meta: { title: '环境平台', icon: 'env_platform' },
  345. children: [
  346. {
  347. path: 'env',
  348. name: 'env',
  349. component: () => import('@/views/env/index.vue'),
  350. meta: { title: '环境管理' }
  351. },
  352. {
  353. path: 'businessline',
  354. name: 'businessline',
  355. component: () => import('@/views/env/index.vue'),
  356. meta: { title: '业务线管理' }
  357. },
  358. {
  359. path: 'whitelist',
  360. name: 'whitelist',
  361. component: () => import('@/views/env/index.vue'),
  362. meta: { title: '白名单管理' }
  363. },
  364. {
  365. path: 'module',
  366. name: 'module',
  367. component: () => import('@/views/env/index.vue'),
  368. meta: { title: '模块管理' }
  369. },
  370. {
  371. path: 'group',
  372. name: 'group',
  373. component: () => import('@/views/env/index.vue'),
  374. meta: { title: 'Group管理' }
  375. },
  376. {
  377. path: 'topic',
  378. name: 'topic',
  379. component: () => import('@/views/env/index.vue'),
  380. meta: { title: 'Topic管理' }
  381. },
  382. {
  383. path: 'mq',
  384. name: 'mq',
  385. component: () => import('@/views/env/index.vue'),
  386. meta: { title: 'MQ管理' }
  387. },
  388. {
  389. path: 'data',
  390. name: 'data',
  391. component: () => import('@/views/env/index.vue'),
  392. meta: { title: '数据统计' }
  393. }
  394. ]
  395. },
  396. {
  397. path: '/mock',
  398. component: Layout,
  399. redirect: '/mock/interface',
  400. name: 'Mock',
  401. meta: { title: 'Mock服务', icon: 'MQ' },
  402. children: [
  403. {
  404. path: 'interface',
  405. name: 'Interface',
  406. component: () => import('@/views/mock/interface'),
  407. meta: { title: 'dubbo mock' }
  408. },
  409. {
  410. path: 'interface/:rule',
  411. name: 'Rule',
  412. hidden: true,
  413. component: () => import('@/views/mock/rule'),
  414. meta: { title: 'dubbo规则' }
  415. },
  416. {
  417. path: 'httpmock',
  418. name: 'httpmock',
  419. component: () => import('@/views/mock/httpmock'),
  420. meta: { title: 'http mock' }
  421. },
  422. {
  423. path: 'httpmock/:httprule',
  424. name: 'Httprule',
  425. hidden: true,
  426. component: () => import('@/views/mock/httprule'),
  427. meta: { title: 'httpmock规则' }
  428. }
  429. ]
  430. },
  431. {
  432. path: '/data',
  433. component: Layout,
  434. redirect: '/data/upload-file',
  435. name: '数据中心',
  436. hidden: true,
  437. meta: { title: '数据中心', icon: 'examlpe' },
  438. children: [
  439. {
  440. path: 'upload-file',
  441. name: 'jar包管理',
  442. component: () => import('@/views/data/upload.vue'),
  443. meta: { title: 'jar包管理' }
  444. },
  445. {
  446. path: 'item',
  447. name: '动态数据',
  448. component: () => import('@/views/data/index.vue'),
  449. meta: { title: '动态数据' }
  450. }
  451. ]
  452. },
  453. {
  454. path: '/virtualDevices',
  455. component: Layout,
  456. redirect: '/virtualDevices/HTvehicle',
  457. name: '虚拟硬件',
  458. meta: { title: '虚拟硬件', icon: 'module' },
  459. children: [
  460. {
  461. path: 'HTvehicle',
  462. name: '单车',
  463. component: () => import('@/views/virtualDevices/HTvehicle'),
  464. meta: { title: '单车' }
  465. },
  466. {
  467. path: 'HTvehicl1e',
  468. name: '电单车'
  469. // hidden: true,
  470. // component: () => import('@/views/virtualDevices/HTvehicle'),
  471. // meta: { title: '电单车' }
  472. }
  473. ]
  474. },
  475. {
  476. path: '/online-quality',
  477. component: Layout,
  478. redirect: '/online-quality/check-list',
  479. name: '上线质检',
  480. meta: { title: '上线质检', icon: '上线质检' },
  481. children: [
  482. {
  483. path: 'check-list',
  484. name: '模板管理',
  485. component: () => import('@/views/online-quality/CheckConfig/index.vue'),
  486. meta: { title: '模板管理' }
  487. },
  488. {
  489. path: 'history-task',
  490. name: '历史任务',
  491. component: () => import('@/views/online-quality/HistoryTask/index.vue'),
  492. meta: { title: '历史任务' }
  493. },
  494. {
  495. path: 'history-task-details/:taskId',
  496. props: true,
  497. name: '历史任务详情',
  498. hidden: true,
  499. component: () => import('@/views/online-quality/HistoryTask/taskDetails.vue'),
  500. meta: { title: '历史任务详情' }
  501. },
  502. {
  503. path: 'block-server',
  504. name: '阻断服务',
  505. component: () => import('@/views/online-quality/BlockServer/index.vue'),
  506. meta: { title: '阻断服务' }
  507. }
  508. ]
  509. },
  510. { path: '*', redirect: '/404', hidden: true },
  511. {
  512. path: '/quality',
  513. component: Layout,
  514. redirect: '/quality/qualityMarket',
  515. name: '质量度量',
  516. // hidden: true,
  517. meta: { title: '质量度量', icon: 'rule' },
  518. children: [
  519. {
  520. path: 'qualityMarket',
  521. name: '质量大盘',
  522. // hidden: true,
  523. component: () => import('@/views/quality/qualityMarket.vue'),
  524. meta: { title: '质量大盘' },
  525. children: [
  526. {
  527. path: 'qualityProcess',
  528. name: '上线过程',
  529. hidden: true,
  530. component: () => import('@/views/quality/qualityProcess.vue'),
  531. meta: { title: '上线过程' }
  532. },
  533. {
  534. path: 'qualityDefectProcess',
  535. name: '缺陷过程',
  536. hidden: true,
  537. component: () => import('@/views/quality/qualityDefectProcess.vue'),
  538. meta: { title: '缺陷过程' }
  539. },
  540. {
  541. path: 'qualityHotpatchProcess',
  542. name: '热修复过程',
  543. hidden: true,
  544. component: () => import('@/views/quality/qualityHotpatchProcess.vue'),
  545. meta: { title: '热修复过程' }
  546. }
  547. ]
  548. },
  549. {
  550. path: 'problemList',
  551. name: '线上问题',
  552. // hidden: true,
  553. component: () => import('@/views/onlineProblem/problemList.vue'),
  554. meta: { title: '线上问题' }
  555. },
  556. {
  557. path: '/Platform/defectManagement/problemCreate',
  558. name: '新建线上问题',
  559. hidden: true,
  560. component: () => import('@/views/onlineProblem/problemCreate'),
  561. meta: { title: '新建线上问题' }
  562. },
  563. {
  564. path: '/Platform/defectManagement/problemQuery',
  565. name: '查看线上问题',
  566. hidden: true,
  567. component: () => import('@/views/onlineProblem/problemQuery'),
  568. meta: { title: '查看线上问题' }
  569. },
  570. {
  571. path: '/Platform/defectManagement/problemUpdate',
  572. name: '更新线上问题',
  573. hidden: true,
  574. component: () => import('@/views/onlineProblem/problemUpdate'),
  575. meta: { title: '更新线上问题' }
  576. }
  577. ]
  578. }
  579. ]
  580. const createRouter = () => new Router({
  581. // mode: 'history', // require service support
  582. scrollBehavior: () => ({ y: 0 }),
  583. routes: constantRoutes
  584. })
  585. const router = createRouter()
  586. // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
  587. export function resetRouter() {
  588. const newRouter = createRouter()
  589. router.matcher = newRouter.matcher // reset router
  590. }
  591. export default router