index.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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. {
  94. path: prefix + '/dsa',
  95. component: () => import('@/views/biz/analy/index')
  96. }, {
  97. path: prefix + '/dsa/record',
  98. component: () => import('@/views/biz/record/index')
  99. },
  100. //交易2025新增页面--end
  101. {
  102. path: prefix + '/user',
  103. component: Layout,
  104. hidden: true,
  105. redirect: 'noredirect',
  106. children: [
  107. {
  108. path: 'profile',
  109. component: () => import('@/views/system/user/profile/index'),
  110. name: 'Profile',
  111. meta: {title: '个人中心', icon: 'user'}
  112. }
  113. ]
  114. },
  115. {
  116. path: prefix + '/link/pp-link',
  117. component: () => import('@/views/obj/pp/link')
  118. },
  119. {
  120. path: prefix + '/hl/bm',
  121. component: () => import('@/views/hl/bm/index')
  122. },
  123. {
  124. path: prefix + '/hl/check',
  125. component: () => import('@/views/hl/check/index')
  126. },
  127. {
  128. path: prefix + '/alarm/record',
  129. component: () => import('@/views/alarm/record/index')
  130. },
  131. {
  132. path: prefix + '/alarm/bizType',
  133. component: () => import('@/views/alarm/record/bizType')
  134. },
  135. {
  136. path: prefix + '/alarm/bizSort',
  137. component: () => import('@/views/alarm/record/bizSort')
  138. },
  139. {
  140. path: prefix + '/alarm/bizAccess',
  141. component: () => import('@/views/alarm/record/bizAccess')
  142. },
  143. {
  144. path: prefix + '/risk/heterogeneous',
  145. component: () => import('@/views/risk/r2/index')
  146. },
  147. {
  148. path: prefix + '/risk/frequency',
  149. component: () => import('@/views/risk/r3/index')
  150. },
  151. {
  152. path: prefix + '/risk/numerical',
  153. component: () => import('@/views/risk/r4/index')
  154. },
  155. {
  156. path: prefix + '/risk/bizHost',
  157. component: () => import('@/views/risk/r5/index')
  158. },
  159. {
  160. path: prefix + '/risk/bizNetwork',
  161. component: () => import('@/views/risk/r6/index')
  162. },
  163. {
  164. path: prefix + '/risk/bizServer',
  165. component: () => import('@/views/risk/r7/index')
  166. },
  167. {
  168. path: prefix + '/ms/type',
  169. component: () => import('@/views/ms/type/index')
  170. },
  171. {
  172. path: prefix + '/ms/def',
  173. component: () => import('@/views/ms/def/index')
  174. },
  175. {
  176. path: prefix + '/ms/mstpl',
  177. component: () => import('@/views/ms/mstpl/index')
  178. },
  179. {
  180. path: prefix + '/obj/obj',
  181. component: () => import('@/views/obj/obj/index')
  182. },
  183. {
  184. path: prefix + '/sendMsg/pushConfig',
  185. component: () => import('@/views/push/pushConfig/index')
  186. },
  187. {
  188. path: prefix + '/sendMsg/pushRecordSms',
  189. component: () => import('@/views/push/pushRecord/sms')
  190. },
  191. {
  192. path: prefix + '/sendMsg/pushRecordMail',
  193. component: () => import('@/views/push/pushRecord/mail')
  194. },
  195. {
  196. path: prefix + '/monitor/job',
  197. component: () => import('@/views/monitor/job/index')
  198. },
  199. {
  200. path: prefix + '/system/config',
  201. component: () => import('@/views/system/config/index')
  202. },
  203. {
  204. path: prefix + '/system/dict',
  205. component: () => import('@/views/system/dict/index')
  206. },
  207. {
  208. path: prefix + '/system/dict-data',
  209. component: Layout,
  210. hidden: true,
  211. permissions: ['system:dict:list'],
  212. children: [
  213. {
  214. path: 'index/:dictId(\\d+)',
  215. component: () => import('@/views/system/dict/data'),
  216. name: 'Data',
  217. meta: {title: '字典数据', activeMenu: '/system/dict'}
  218. }
  219. ]
  220. },
  221. {
  222. path: prefix + '/system/user-auth',
  223. component: Layout,
  224. hidden: true,
  225. permissions: ['system:user:edit'],
  226. children: [
  227. {
  228. path: 'role/:userId(\\d+)',
  229. component: () => import('@/views/system/user/authRole'),
  230. name: 'AuthRole',
  231. meta: {title: '分配角色', activeMenu: '/system/user'}
  232. }
  233. ]
  234. },
  235. {
  236. path: prefix + '/system/role-auth',
  237. component: Layout,
  238. hidden: true,
  239. permissions: ['system:role:edit'],
  240. children: [
  241. {
  242. path: 'user/:roleId(\\d+)',
  243. component: () => import('@/views/system/role/authUser'),
  244. name: 'AuthUser',
  245. meta: {title: '分配用户', activeMenu: '/system/role'}
  246. }
  247. ]
  248. },
  249. {
  250. path: prefix + '/monitor/job-log',
  251. component: Layout,
  252. hidden: true,
  253. permissions: ['monitor:job:list'],
  254. children: [
  255. {
  256. path: 'index/:jobId(\\d+)',
  257. component: () => import('@/views/monitor/job/log'),
  258. name: 'JobLog',
  259. meta: {title: '调度日志', activeMenu: '/monitor/job'}
  260. }
  261. ]
  262. },
  263. {
  264. path: prefix + '/tool/gen',
  265. component: () => import('@/views/tool/gen/index')
  266. },
  267. {
  268. path: prefix + '/system/dept',
  269. component: () => import('@/views/system/dept/index')
  270. },
  271. {
  272. path: prefix + '/system/user',
  273. component: () => import('@/views/system/user/index')
  274. },
  275. {
  276. path: prefix + '/system/menu',
  277. component: () => import('@/views/system/menu/index')
  278. },
  279. {
  280. path: prefix + '/tool/gen-edit',
  281. component: Layout,
  282. hidden: true,
  283. children: [
  284. {
  285. path: 'index/:tableId(\\d+)',
  286. component: () => import('@/views/tool/gen/editTable'),
  287. name: 'GenEdit',
  288. meta: {title: '修改生成配置', activeMenu: '/tool/gen'}
  289. }
  290. ]
  291. }
  292. ]
  293. },
  294. ];
  295. // 动态路由,基于用户权限动态去加载
  296. export const dynamicRoutes = []
  297. const router = createRouter({
  298. history: createWebHashHistory(prefix + '/'),
  299. routes: constantRoutes,
  300. scrollBehavior(to, from, savedPosition) {
  301. if (savedPosition) {
  302. return savedPosition
  303. } else {
  304. return {top: 0}
  305. }
  306. },
  307. });
  308. export default router;