index.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  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: 'projectPage',
  80. name: 'projectPage',
  81. component: () => import('@/views/Platform/projectPage'),
  82. meta: { title: '项目管理' }
  83. },
  84. {
  85. path: 'useCasePage',
  86. name: 'useCasePage',
  87. hidden: true,
  88. component: () => import('@/views/Platform/useCasePage'),
  89. meta: { title: '用例管理' }
  90. },
  91. {
  92. path: '/Platform/presentation',
  93. name: '测试管理',
  94. component: () => import('@/views/Platform/presentation/testa'),
  95. meta: { title: '测试管理' },
  96. children: [
  97. {
  98. path: 'testPageData',
  99. name: '测试计划管理',
  100. hidden: true,
  101. component: () => import('@/views/Platform/presentation/testPage.vue'),
  102. meta: { title: '测试计划管理' }
  103. },
  104. {
  105. path: 'testPresentation',
  106. name: '日报报告',
  107. component: () => import('@/views/Platform/presentation/testPresentation'),
  108. meta: { title: '日报报告' }
  109. },
  110. {
  111. path: 'ResultPage',
  112. name: '准出报告',
  113. component: () => import('@/views/Platform/presentation/ResultPage'),
  114. meta: { title: '准出报告' }
  115. },
  116. {
  117. path: 'Assumptions',
  118. name: '提测报告',
  119. component: () => import('@/views/Platform/presentation/Assumptions'),
  120. meta: { title: '提测报告' }
  121. },
  122. {
  123. path: 'DailyNewsAdded',
  124. name: '日报报告',
  125. hidden: true,
  126. component: () => import('@/views/Platform/presentation/DailyNewsAdded'),
  127. meta: { title: '新增日报报告' }
  128. },
  129. {
  130. path: 'presentationReport',
  131. name: '提测报告',
  132. hidden: true,
  133. component: () => import('@/views/Platform/presentation/presentationReport'),
  134. meta: { title: '新增服务器提测报告' }
  135. },
  136. {
  137. path: 'acceptTheReport',
  138. name: '提测预览',
  139. hidden: true,
  140. component: () => import('@/views/Platform/presentation/acceptTheReport'),
  141. meta: { title: '提测预览' }
  142. },
  143. {
  144. path: 'testPresenyL',
  145. name: '日报预览',
  146. hidden: true,
  147. component: () => import('@/views/Platform/presentation/testPresenyL'),
  148. meta: { title: '日报预览' }
  149. },
  150. {
  151. path: 'ResultPageyL',
  152. name: '准出预览',
  153. hidden: true,
  154. component: () => import('@/views/Platform/presentation/ResultPageyL'),
  155. meta: { title: '准出预览' }
  156. },
  157. {
  158. path: 'Acceptance',
  159. name: '准出报告',
  160. hidden: true,
  161. component: () => import('@/views/Platform/presentation/Acceptance'),
  162. meta: { title: '准出报告,新增服务器端报告' }
  163. },
  164. {
  165. path: 'ClientAcceptance',
  166. name: '准出报告',
  167. hidden: true,
  168. component: () => import('@/views/Platform/presentation/ClientAcceptance'),
  169. meta: { title: '准出报告,新增客户端报告' }
  170. },
  171. {
  172. path: 'PresentReport',
  173. name: '提测报告,新增报告',
  174. hidden: true,
  175. component: () => import('@/views/Platform/presentation/PresentReport'),
  176. meta: { title: '新增客户端提测报告' }
  177. },
  178. {
  179. path: 'projectQuery',
  180. name: '项目查看编辑',
  181. hidden: true,
  182. component: () => import('@/views/Platform/projectQuery/projectQuery.vue'),
  183. meta: { title: '项目查看编辑' }
  184. },
  185. {
  186. path: 'taskQuery',
  187. name: '任务查看编辑',
  188. hidden: true,
  189. component: () => import('@/views/Platform/projectQuery/taskQuery.vue'),
  190. meta: { title: '任务查看编辑' }
  191. }
  192. ]
  193. },
  194. {
  195. path: '/Platform/defectManagement',
  196. name: '缺陷管理',
  197. component: () => import('@/views/Platform/defectManagement'),
  198. meta: { title: '缺陷管理' },
  199. children: [
  200. {
  201. path: 'bugCreate',
  202. name: '新建Bug',
  203. hidden: true,
  204. component: () => import('@/views/Platform/bugManage/bugCreate'),
  205. meta: { title: '新建Bug' }
  206. },
  207. {
  208. path: 'bugQuery',
  209. name: '查看Bug',
  210. hidden: true,
  211. component: () => import('@/views/Platform/bugManage/bugQuery'),
  212. meta: { title: '查看Bug' }
  213. },
  214. {
  215. path: 'bugUpdate',
  216. name: '更新Bug',
  217. hidden: true,
  218. component: () => import('@/views/Platform/bugManage/bugUpdate'),
  219. meta: { title: '更新Bug' }
  220. }
  221. ]
  222. },
  223. {
  224. path: 'teamPage',
  225. name: 'teamPage',
  226. hidden: true,
  227. component: () => import('@/views/Platform/teamPage'),
  228. meta: { title: '团队管理' }
  229. }]
  230. },
  231. {
  232. path: '/env-platform',
  233. component: Layout,
  234. redirect: '/env-platform/env',
  235. name: '环境',
  236. meta: { title: '环境平台', icon: 'env_platform' },
  237. children: [
  238. {
  239. path: 'env',
  240. name: 'env',
  241. component: () => import('@/views/env/index.vue'),
  242. meta: { title: '环境管理' }
  243. },
  244. {
  245. path: 'businessline',
  246. name: 'businessline',
  247. component: () => import('@/views/env/index.vue'),
  248. meta: { title: '业务线管理' }
  249. },
  250. {
  251. path: 'whitelist',
  252. name: 'whitelist',
  253. component: () => import('@/views/env/index.vue'),
  254. meta: { title: '白名单管理' }
  255. },
  256. {
  257. path: 'module',
  258. name: 'module',
  259. component: () => import('@/views/env/index.vue'),
  260. meta: { title: '模块管理' }
  261. },
  262. {
  263. path: 'group',
  264. name: 'group',
  265. component: () => import('@/views/env/index.vue'),
  266. meta: { title: 'Group管理' }
  267. },
  268. {
  269. path: 'topic',
  270. name: 'topic',
  271. component: () => import('@/views/env/index.vue'),
  272. meta: { title: 'Topic管理' }
  273. },
  274. {
  275. path: 'mq',
  276. name: 'mq',
  277. component: () => import('@/views/env/index.vue'),
  278. meta: { title: 'MQ管理' }
  279. },
  280. {
  281. path: 'data',
  282. name: 'data',
  283. component: () => import('@/views/env/index.vue'),
  284. meta: { title: '数据统计' }
  285. }
  286. ]
  287. },
  288. {
  289. path: '/mock',
  290. component: Layout,
  291. redirect: '/mock/interface',
  292. name: 'Mock',
  293. meta: { title: 'Mock服务', icon: 'MQ' },
  294. children: [
  295. {
  296. path: 'interface',
  297. name: 'Interface',
  298. component: () => import('@/views/mock/interface'),
  299. meta: { title: 'dubbo mock' }
  300. },
  301. {
  302. path: 'interface/:rule',
  303. name: 'Rule',
  304. hidden: true,
  305. component: () => import('@/views/mock/rule'),
  306. meta: { title: 'dubbo规则' }
  307. },
  308. {
  309. path: 'httpmock',
  310. name: 'httpmock',
  311. component: () => import('@/views/mock/httpmock'),
  312. meta: { title: 'http mock' }
  313. },
  314. {
  315. path: 'httpmock/:httprule',
  316. name: 'Httprule',
  317. hidden: true,
  318. component: () => import('@/views/mock/httprule'),
  319. meta: { title: 'httpmock规则' }
  320. }
  321. ]
  322. },
  323. {
  324. path: '/data',
  325. component: Layout,
  326. redirect: '/data/upload-file',
  327. name: '数据中心',
  328. hidden: true,
  329. meta: { title: '数据中心', icon: 'examlpe' },
  330. children: [
  331. {
  332. path: 'upload-file',
  333. name: 'jar包管理',
  334. component: () => import('@/views/data/upload.vue'),
  335. meta: { title: 'jar包管理' }
  336. },
  337. {
  338. path: 'item',
  339. name: '动态数据',
  340. component: () => import('@/views/data/index.vue'),
  341. meta: { title: '动态数据' }
  342. }
  343. ]
  344. },
  345. {
  346. path: '/online-quality',
  347. component: Layout,
  348. redirect: '/online-quality/check-list',
  349. name: '上线质检',
  350. meta: { title: '上线质检', icon: '上线质检' },
  351. children: [
  352. {
  353. path: 'check-list',
  354. name: '模板管理',
  355. component: () => import('@/views/online-quality/CheckConfig/index.vue'),
  356. meta: { title: '模板管理' }
  357. },
  358. {
  359. path: 'history-task',
  360. name: '历史任务',
  361. component: () => import('@/views/online-quality/HistoryTask/index.vue'),
  362. meta: { title: '历史任务' }
  363. },
  364. {
  365. path: 'history-task-details/:taskId',
  366. props: true,
  367. name: '历史任务详情',
  368. hidden: true,
  369. component: () => import('@/views/online-quality/HistoryTask/taskDetails.vue'),
  370. meta: { title: '历史任务详情' }
  371. },
  372. {
  373. path: 'block-server',
  374. name: '阻断服务',
  375. component: () => import('@/views/online-quality/BlockServer/index.vue'),
  376. meta: { title: '阻断服务' }
  377. }
  378. ]
  379. },
  380. { path: '*', redirect: '/404', hidden: true },
  381. {
  382. path: '/quality',
  383. component: Layout,
  384. redirect: '/quality/qualityMarket',
  385. name: '质量度量',
  386. // hidden: true,
  387. meta: { title: '质量度量', icon: 'rule' },
  388. children: [
  389. {
  390. path: 'qualityMarket',
  391. name: '质量大盘',
  392. // hidden: true,
  393. component: () => import('@/views/quality/qualityMarket.vue'),
  394. meta: { title: '质量大盘' }
  395. },
  396. {
  397. path: 'qualityMarket',
  398. name: '质量大盘',
  399. // hidden: true,
  400. component: () => import('@/views/quality/qualityMarket.vue'),
  401. meta: { title: '质量大盘' },
  402. children: [
  403. {
  404. path: 'qualityProcess',
  405. name: '上线过程',
  406. hidden: true,
  407. component: () => import('@/views/quality/qualityProcess.vue'),
  408. meta: { title: '上线过程' }
  409. }
  410. ]
  411. }
  412. ]
  413. }
  414. ]
  415. const createRouter = () => new Router({
  416. // mode: 'history', // require service support
  417. scrollBehavior: () => ({ y: 0 }),
  418. routes: constantRoutes
  419. })
  420. const router = createRouter()
  421. // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
  422. export function resetRouter() {
  423. const newRouter = createRouter()
  424. router.matcher = newRouter.matcher // reset router
  425. }
  426. export default router