index.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. import {createRouter, createWebHashHistory} from 'vue-router'
  2. /* Layout */
  3. import Layout from '@/layout'
  4. /**
  5. * Note: 路由配置项
  6. *
  7. * hidden: true // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1
  8. * alwaysShow: true // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面
  9. * // 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面
  10. * // 若你想不管路由下面的 children 声明的个数都显示你的根路由
  11. * // 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由
  12. * redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
  13. * name:'router-name' // 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题
  14. * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数
  15. * roles: ['admin', 'common'] // 访问路由的角色权限
  16. * permissions: ['a:a:a', 'b:b:b'] // 访问路由的菜单权限
  17. * meta : {
  18. noCache: true // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
  19. title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字
  20. icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg
  21. breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示
  22. activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。
  23. }
  24. */
  25. const prefix = '/pxf-risk-ripa-web'
  26. // 公共路由
  27. export const constantRoutes = [
  28. {
  29. path: '/redirect',
  30. component: Layout,
  31. hidden: true,
  32. children: [
  33. {
  34. path: '/redirect/:path(.*)',
  35. component: () => import('@/views/redirect/index.vue')
  36. }
  37. ]
  38. },
  39. {
  40. path: '/login',
  41. component: () => import('@/views/login'),
  42. hidden: true
  43. },
  44. {
  45. path: '/register',
  46. component: () => import('@/views/register'),
  47. hidden: true
  48. },
  49. {
  50. path: "/:pathMatch(.*)*",
  51. component: () => import('@/views/error/404'),
  52. hidden: true
  53. },
  54. {
  55. path: prefix + '/401',
  56. component: () => import('@/views/error/401'),
  57. hidden: true
  58. },
  59. {
  60. path: '',
  61. component: Layout,
  62. redirect: prefix + '/index',
  63. children: [
  64. {
  65. path: prefix + '/index',
  66. component: () => import('@/views/dashboard'),
  67. name: 'index',
  68. meta: {title: '业务运行风险', icon: 'dashboard', affix: true}
  69. },
  70. ]
  71. },
  72. {
  73. path: prefix,
  74. component: Layout,
  75. children: [
  76. //交易2025新增页面--start
  77. {
  78. path: prefix + '/model',
  79. component: () => import('@/views/biz/model/index')
  80. },
  81. {
  82. path: prefix + '/metrics',
  83. component: () => import('@/views/biz/metrics/index')
  84. },
  85. {
  86. path: prefix + '/algo',
  87. component: () => import('@/views/biz/algo/index')
  88. },
  89. {
  90. path: prefix + '/algo/data',
  91. component: () => import('@/views/biz/data/index')
  92. },
  93. //交易2025新增页面--end
  94. {
  95. path: prefix + '/user',
  96. component: Layout,
  97. hidden: true,
  98. redirect: 'noredirect',
  99. children: [
  100. {
  101. path: 'profile',
  102. component: () => import('@/views/system/user/profile/index'),
  103. name: 'Profile',
  104. meta: {title: '个人中心', icon: 'user'}
  105. }
  106. ]
  107. },
  108. {
  109. path: prefix + '/link/pp-link',
  110. component: () => import('@/views/obj/pp/link')
  111. },
  112. {
  113. path: prefix + '/hl/bm',
  114. component: () => import('@/views/hl/bm/index')
  115. },
  116. {
  117. path: prefix + '/hl/check',
  118. component: () => import('@/views/hl/check/index')
  119. },
  120. {
  121. path: prefix + '/alarm/record',
  122. component: () => import('@/views/alarm/record/index')
  123. },
  124. {
  125. path: prefix + '/alarm/bizType',
  126. component: () => import('@/views/alarm/record/bizType')
  127. },
  128. {
  129. path: prefix + '/alarm/bizSort',
  130. component: () => import('@/views/alarm/record/bizSort')
  131. },
  132. {
  133. path: prefix + '/alarm/bizAccess',
  134. component: () => import('@/views/alarm/record/bizAccess')
  135. },
  136. {
  137. path: prefix + '/risk/heterogeneous',
  138. component: () => import('@/views/risk/r2/index')
  139. },
  140. {
  141. path: prefix + '/risk/frequency',
  142. component: () => import('@/views/risk/r3/index')
  143. },
  144. {
  145. path: prefix + '/risk/numerical',
  146. component: () => import('@/views/risk/r4/index')
  147. },
  148. {
  149. path: prefix + '/risk/bizHost',
  150. component: () => import('@/views/risk/r5/index')
  151. },
  152. {
  153. path: prefix + '/risk/bizNetwork',
  154. component: () => import('@/views/risk/r6/index')
  155. },
  156. {
  157. path: prefix + '/risk/bizServer',
  158. component: () => import('@/views/risk/r7/index')
  159. },
  160. {
  161. path: prefix + '/ms/type',
  162. component: () => import('@/views/ms/type/index')
  163. },
  164. {
  165. path: prefix + '/ms/def',
  166. component: () => import('@/views/ms/def/index')
  167. },
  168. {
  169. path: prefix + '/ms/mstpl',
  170. component: () => import('@/views/ms/mstpl/index')
  171. },
  172. {
  173. path: prefix + '/obj/obj',
  174. component: () => import('@/views/obj/obj/index')
  175. },
  176. {
  177. path: prefix + '/sendMsg/pushConfig',
  178. component: () => import('@/views/push/pushConfig/index')
  179. },
  180. {
  181. path: prefix + '/sendMsg/pushRecordSms',
  182. component: () => import('@/views/push/pushRecord/sms')
  183. },
  184. {
  185. path: prefix + '/sendMsg/pushRecordMail',
  186. component: () => import('@/views/push/pushRecord/mail')
  187. },
  188. {
  189. path: prefix + '/monitor/job',
  190. component: () => import('@/views/monitor/job/index')
  191. },
  192. {
  193. path: prefix + '/system/config',
  194. component: () => import('@/views/system/config/index')
  195. },
  196. {
  197. path: prefix + '/system/dict',
  198. component: () => import('@/views/system/dict/index')
  199. },
  200. {
  201. path: prefix + '/system/dict-data',
  202. component: Layout,
  203. hidden: true,
  204. permissions: ['system:dict:list'],
  205. children: [
  206. {
  207. path: 'index/:dictId(\\d+)',
  208. component: () => import('@/views/system/dict/data'),
  209. name: 'Data',
  210. meta: {title: '字典数据', activeMenu: '/system/dict'}
  211. }
  212. ]
  213. },
  214. {
  215. path: prefix + '/system/user-auth',
  216. component: Layout,
  217. hidden: true,
  218. permissions: ['system:user:edit'],
  219. children: [
  220. {
  221. path: 'role/:userId(\\d+)',
  222. component: () => import('@/views/system/user/authRole'),
  223. name: 'AuthRole',
  224. meta: {title: '分配角色', activeMenu: '/system/user'}
  225. }
  226. ]
  227. },
  228. {
  229. path: prefix + '/system/role-auth',
  230. component: Layout,
  231. hidden: true,
  232. permissions: ['system:role:edit'],
  233. children: [
  234. {
  235. path: 'user/:roleId(\\d+)',
  236. component: () => import('@/views/system/role/authUser'),
  237. name: 'AuthUser',
  238. meta: {title: '分配用户', activeMenu: '/system/role'}
  239. }
  240. ]
  241. },
  242. {
  243. path: prefix + '/monitor/job-log',
  244. component: Layout,
  245. hidden: true,
  246. permissions: ['monitor:job:list'],
  247. children: [
  248. {
  249. path: 'index/:jobId(\\d+)',
  250. component: () => import('@/views/monitor/job/log'),
  251. name: 'JobLog',
  252. meta: {title: '调度日志', activeMenu: '/monitor/job'}
  253. }
  254. ]
  255. },
  256. {
  257. path: prefix + '/tool/gen',
  258. component: () => import('@/views/tool/gen/index')
  259. },
  260. {
  261. path: prefix + '/system/dept',
  262. component: () => import('@/views/system/dept/index')
  263. },
  264. {
  265. path: prefix + '/system/user',
  266. component: () => import('@/views/system/user/index')
  267. },
  268. {
  269. path: prefix + '/system/menu',
  270. component: () => import('@/views/system/menu/index')
  271. },
  272. {
  273. path: prefix + '/tool/gen-edit',
  274. component: Layout,
  275. hidden: true,
  276. children: [
  277. {
  278. path: 'index/:tableId(\\d+)',
  279. component: () => import('@/views/tool/gen/editTable'),
  280. name: 'GenEdit',
  281. meta: {title: '修改生成配置', activeMenu: '/tool/gen'}
  282. }
  283. ]
  284. }
  285. ]
  286. },
  287. ];
  288. // 动态路由,基于用户权限动态去加载
  289. export const dynamicRoutes = []
  290. const router = createRouter({
  291. history: createWebHashHistory(prefix + '/'),
  292. routes: constantRoutes,
  293. scrollBehavior(to, from, savedPosition) {
  294. if (savedPosition) {
  295. return savedPosition
  296. } else {
  297. return {top: 0}
  298. }
  299. },
  300. });
  301. export default router;