综合办公系统
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. /*
  2. * @Author: ysh
  3. * @Date: 2024-01-03 09:23:11
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2025-03-06 14:59:47
  6. */
  7. import Vue from 'vue'
  8. import Router from 'vue-router'
  9. Vue.use(Router)
  10. /* Layout */
  11. import Layout from '@/layout'
  12. /**
  13. * Note: 路由配置项
  14. *
  15. * hidden: true // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1
  16. * alwaysShow: true // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面
  17. * // 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面
  18. * // 若你想不管路由下面的 children 声明的个数都显示你的根路由
  19. * // 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由
  20. * redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
  21. * name:'router-name' // 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题
  22. * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数
  23. * roles: ['admin', 'common'] // 访问路由的角色权限
  24. * permissions: ['a:a:a', 'b:b:b'] // 访问路由的菜单权限
  25. * meta : {
  26. noCache: true // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
  27. title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字
  28. icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg
  29. breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示
  30. activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。
  31. }
  32. */
  33. // 公共路由
  34. export const constantRoutes = [
  35. {
  36. path: '/redirect',
  37. component: Layout,
  38. hidden: true,
  39. children: [
  40. {
  41. path: '/redirect/:path(.*)',
  42. component: () => import('@/views/redirect')
  43. }
  44. ]
  45. },
  46. {
  47. path: '/login',
  48. component: () => import('@/views/login'),
  49. hidden: true
  50. },
  51. {
  52. path: '/register',
  53. component: () => import('@/views/register'),
  54. hidden: true
  55. },
  56. {
  57. path: '/404',
  58. component: () => import('@/views/error/404'),
  59. hidden: true
  60. },
  61. {
  62. path: '/401',
  63. component: () => import('@/views/error/401'),
  64. hidden: true
  65. },
  66. {
  67. path: '',
  68. component: Layout,
  69. redirect: 'index',
  70. children: [
  71. {
  72. path: 'index',
  73. component: () => import('@/views/index'),
  74. name: 'Index',
  75. meta: { title: '首页', icon: 'dashboard', affix: true }
  76. }
  77. ]
  78. },
  79. {
  80. path: '/user',
  81. component: Layout,
  82. hidden: true,
  83. redirect: 'noredirect',
  84. children: [
  85. {
  86. path: 'profile',
  87. component: () => import('@/views/system/user/profile/index'),
  88. name: 'Profile',
  89. meta: { title: '个人中心', icon: 'user' }
  90. }
  91. ]
  92. },
  93. {
  94. path: '/flowable',
  95. component: Layout,
  96. hidden: true,
  97. children: [
  98. {
  99. path: 'definition/model/',
  100. component: () => import('@/views/flowable/definition/model'),
  101. name: 'Model',
  102. meta: { title: '流程设计', icon: '' }
  103. }
  104. ]
  105. },
  106. {
  107. path: '/flowable',
  108. component: Layout,
  109. hidden: true,
  110. children: [
  111. {
  112. path: 'task/finished/detail/index',
  113. component: () => import('@/views/flowable/task/finished/detail/index'),
  114. name: 'FinishedRecord',
  115. meta: { title: '流程详情', icon: '' }
  116. }
  117. ]
  118. },
  119. {
  120. path: '/flowable',
  121. component: Layout,
  122. hidden: true,
  123. children: [
  124. {
  125. path: 'task/myProcess/detail/index',
  126. component: () => import('@/views/flowable/task/myProcess/detail/index'),
  127. name: 'MyProcessRecord',
  128. meta: { title: '流程详情', icon: '' }
  129. }
  130. ]
  131. },
  132. {
  133. path: '/flowable',
  134. component: Layout,
  135. hidden: true,
  136. children: [
  137. {
  138. path: 'task/myProcess/send/index',
  139. component: () => import('@/views/flowable/task/myProcess/send/index'),
  140. name: 'SendRecord',
  141. meta: { title: '流程发起', icon: '' }
  142. }
  143. ]
  144. },
  145. {
  146. path: '/flowable',
  147. component: Layout,
  148. hidden: true,
  149. children: [
  150. {
  151. path: 'task/todo/detail/index',
  152. component: () => import('@/views/flowable/task/todo/detail/index'),
  153. name: 'TodoRecord',
  154. meta: { title: '流程处理', icon: '' }
  155. }
  156. ]
  157. },
  158. {
  159. path: '/tool',
  160. component: Layout,
  161. hidden: true,
  162. children: [
  163. {
  164. path: 'build/index',
  165. component: () => import('@/views/tool/build/index'),
  166. name: 'FormBuild',
  167. meta: { title: '表单配置', icon: '' }
  168. }
  169. ]
  170. },
  171. {
  172. path: '/car/detail',
  173. component: Layout,
  174. hidden: true,
  175. children: [
  176. {
  177. path: '',
  178. component: () => import('@/views/oa/car/detail'),
  179. name: 'carDetail',
  180. meta: { title: '车辆明细', icon: '' }
  181. }
  182. ]
  183. },
  184. {
  185. path: '/device/detail',
  186. component: Layout,
  187. hidden: true,
  188. children: [
  189. {
  190. path: '',
  191. component: () => import('@/views/oa/device/detail'),
  192. name: 'deviceDetail',
  193. meta: { title: '设备明细', icon: '' }
  194. }
  195. ]
  196. },
  197. {
  198. path: '/staff/info',
  199. component: Layout,
  200. hidden: true,
  201. children: [
  202. {
  203. path: '',
  204. component: () => import('@/views/oa/staff/info'),
  205. name: 'staffInfo',
  206. meta: { title: '员工详情', icon: '' }
  207. }
  208. ]
  209. },
  210. {
  211. path: '/budget/add',
  212. component: Layout,
  213. hidden: true,
  214. children: [
  215. {
  216. path: '',
  217. component: () => import('@/views/flowable/form/budget/addBudget.vue'),
  218. name: 'addBudget',
  219. meta: { title: '新增预算', icon: '' }
  220. }
  221. ]
  222. },
  223. {
  224. path: '/applyForm/borrow',
  225. component: Layout,
  226. hidden: true,
  227. children: [
  228. {
  229. path: '',
  230. component: () => import('@/views/flowable/task/todo/applyForm/borrowIndex'),
  231. name: 'borrow',
  232. meta: { title: '借款审批', icon: '' }
  233. }
  234. ]
  235. },
  236. {
  237. path: '/applyForm/carApply',
  238. component: Layout,
  239. hidden: true,
  240. children: [
  241. {
  242. path: '',
  243. component: () => import('@/views/flowable/task/todo/applyForm/carIndex'),
  244. name: 'carApply',
  245. meta: { title: '用车审批', icon: '' }
  246. }
  247. ]
  248. },
  249. {
  250. path: '/applyForm/deviceApply',
  251. component: Layout,
  252. hidden: true,
  253. children: [
  254. {
  255. path: '',
  256. component: () => import('@/views/flowable/task/todo/applyForm/deviceIndex'),
  257. name: 'deviceApply',
  258. meta: { title: '设备审批', icon: '' }
  259. }
  260. ]
  261. },
  262. {
  263. path: '/applyForm/settleApply',
  264. component: Layout,
  265. hidden: true,
  266. children: [
  267. {
  268. path: '',
  269. component: () => import('@/views/flowable/task/todo/applyForm/settleIndex'),
  270. name: 'settleApply',
  271. meta: { title: '项目结算', icon: '' }
  272. }
  273. ]
  274. },
  275. {
  276. path: '/applyForm/archive',
  277. component: Layout,
  278. hidden: true,
  279. children: [
  280. {
  281. path: '',
  282. component: () => import('@/views/flowable/task/todo/applyForm/archiIndex'),
  283. name: 'archive',
  284. meta: { title: '成果归档', icon: '' }
  285. }
  286. ]
  287. },
  288. {
  289. path: '/applyForm/change',
  290. component: Layout,
  291. hidden: true,
  292. children: [
  293. {
  294. path: '',
  295. component: () => import('@/views/flowable/task/todo/applyForm/changeIndex'),
  296. name: 'change',
  297. meta: { title: '项目变更', icon: '' }
  298. }
  299. ]
  300. },
  301. {
  302. path: '',
  303. component: Layout,
  304. hidden: true,
  305. children: [
  306. {
  307. path: 'projectInfo/info/:id',
  308. component: () => import('@/views/oa/project/info'),
  309. name: 'projectInfo',
  310. meta: { title: '项目详情', icon: '' }
  311. }
  312. ]
  313. },
  314. {
  315. path: '/preview',
  316. component: Layout,
  317. hidden: true,
  318. children: [
  319. {
  320. path: '',
  321. component: () => import('@/components/preview'),
  322. name: 'preview',
  323. meta: { title: '在线预览', icon: '' }
  324. }
  325. ]
  326. },
  327. {
  328. path: '/videoStudy/:id',
  329. component: Layout,
  330. children: [
  331. {
  332. path: '',
  333. component: () => import('@/views/oa/study/components/videoStudy'),
  334. name: 'VideoStudy',
  335. meta: { title: '视频学习', icon: '' }
  336. }
  337. ],
  338. hidden: true
  339. },
  340. {
  341. path: '/pdfStudy/:id',
  342. component: Layout,
  343. children: [
  344. {
  345. path: '',
  346. component: () => import('@/views/oa/study/components/pdfStudy'),
  347. name: 'PdfStudy',
  348. meta: { title: '文档学习', icon: '' }
  349. }
  350. ],
  351. hidden: true
  352. },
  353. ]
  354. // 动态路由,基于用户权限动态去加载
  355. export const dynamicRoutes = [
  356. {
  357. path: '/system/user-auth',
  358. component: Layout,
  359. hidden: true,
  360. permissions: ['system:user:edit'],
  361. children: [
  362. {
  363. path: 'role/:userId(\\d+)',
  364. component: () => import('@/views/system/user/authRole'),
  365. name: 'AuthRole',
  366. meta: { title: '分配角色', activeMenu: '/system/user' }
  367. }
  368. ]
  369. },
  370. {
  371. path: '/system/role-auth',
  372. component: Layout,
  373. hidden: true,
  374. permissions: ['system:role:edit'],
  375. children: [
  376. {
  377. path: 'user/:roleId(\\d+)',
  378. component: () => import('@/views/system/role/authUser'),
  379. name: 'AuthUser',
  380. meta: { title: '分配用户', activeMenu: '/system/role' }
  381. }
  382. ]
  383. },
  384. {
  385. path: '/system/dict-data',
  386. component: Layout,
  387. hidden: true,
  388. permissions: ['system:dict:list'],
  389. children: [
  390. {
  391. path: 'index/:dictId(\\d+)',
  392. component: () => import('@/views/system/dict/data'),
  393. name: 'Data',
  394. meta: { title: '字典数据', activeMenu: '/system/dict' }
  395. }
  396. ]
  397. },
  398. {
  399. path: '/monitor/job-log',
  400. component: Layout,
  401. hidden: true,
  402. permissions: ['monitor:job:list'],
  403. children: [
  404. {
  405. path: 'index/:jobId(\\d+)',
  406. component: () => import('@/views/monitor/job/log'),
  407. name: 'JobLog',
  408. meta: { title: '调度日志', activeMenu: '/monitor/job' }
  409. }
  410. ]
  411. },
  412. {
  413. path: '/tool/gen-edit',
  414. component: Layout,
  415. hidden: true,
  416. permissions: ['tool:gen:edit'],
  417. children: [
  418. {
  419. path: 'index/:tableId(\\d+)',
  420. component: () => import('@/views/tool/gen/editTable'),
  421. name: 'GenEdit',
  422. meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
  423. }
  424. ]
  425. }
  426. ]
  427. // 防止连续点击多次路由报错
  428. let routerPush = Router.prototype.push;
  429. let routerReplace = Router.prototype.replace;
  430. // push
  431. Router.prototype.push = function push(location) {
  432. return routerPush.call(this, location).catch(err => err)
  433. }
  434. // replace
  435. Router.prototype.replace = function push(location) {
  436. return routerReplace.call(this, location).catch(err => err)
  437. }
  438. export default new Router({
  439. mode: 'history', // 去掉url中的#
  440. scrollBehavior: () => ({ y: 0 }),
  441. routes: constantRoutes
  442. })