route.ts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. import { RouteRecordRaw } from 'vue-router';
  2. /**
  3. * * 建议:路由 path 路径与文件夹名称相同,找文件可浏览器地址找,方便定位文件位置
  4. *
  5. * 路由meta对象参数说明
  6. * meta: {
  7. * title: 菜单栏及 tagsView 栏、菜单搜索名称(国际化)
  8. * isLink: 是否超链接菜单,开启外链条件,`1、isLink: 链接地址不为空`
  9. * isHide: 是否隐藏此路由
  10. * isKeepAlive: 是否缓存组件状态
  11. * isAffix: 是否固定在 tagsView 栏上
  12. * isIframe: 是否内嵌窗口,开启条件,`1、isIframe:true 2、isLink:链接地址不为空`
  13. * roles: 当前路由权限标识,取角色管理。控制路由显示、隐藏。超级管理员:admin 普通角色:common
  14. * icon: 菜单、tagsView 图标,阿里:加 `iconfont xxx`,fontawesome:加 `fa xxx`
  15. * }
  16. */
  17. // 扩展 RouteMeta 接口
  18. declare module 'vue-router' {
  19. interface RouteMeta {
  20. title?: string;
  21. isLink?: string;
  22. isHide?: boolean;
  23. isKeepAlive?: boolean;
  24. isAffix?: boolean;
  25. isIframe?: boolean;
  26. roles?: string[];
  27. icon?: string;
  28. }
  29. }
  30. /**
  31. * 定义动态路由
  32. * 前端添加路由,请在顶级节点的 `children 数组` 里添加
  33. * @description 未开启 isRequestRoutes 为 true 时使用(前端控制路由),开启时第一个顶级 children 的路由将被替换成接口请求回来的路由数据
  34. * @description 各字段请查看 `@/views/system/menu/component/Menu-add.vue 下的 ruleForm`
  35. * @returns 返回路由菜单数据
  36. */
  37. export const dynamicRoutes: Array<RouteRecordRaw> = [
  38. {
  39. path: '/',
  40. name: '/',
  41. component: () => import('@/layout/index.vue'),
  42. redirect: '/home',
  43. meta: {
  44. isKeepAlive: true,
  45. },
  46. children: [
  47. {
  48. path: '/home',
  49. name: 'home',
  50. component: () => import('@/views/home/index.vue'),
  51. meta: {
  52. title: '首页',
  53. isLink: '',
  54. isHide: false,
  55. isKeepAlive: true,
  56. isAffix: true,
  57. isIframe: false,
  58. icon: 'iconfont icon-shouye',
  59. },
  60. },
  61. ],
  62. },
  63. {
  64. path: '/todo/seats/accept/:tagsViewName/:callId?/:id?',
  65. name: 'orderAccept',
  66. component: () => import('@/views/todo/seats/accept/index.vue'),
  67. meta: {
  68. title: '工单受理',
  69. isKeepAlive: true,
  70. isDynamic:true
  71. },
  72. },
  73. {
  74. path: '/knowledge/index/edit/:id?/:tagsViewName/:isDraft?',
  75. name: 'knowledgeEdit',
  76. component: () => import('@/views/knowledge/index/edit.vue'),
  77. meta: {
  78. title: '知识库新增/编辑',
  79. isKeepAlive: true,
  80. isDynamic:true
  81. },
  82. },
  83. {
  84. path: '/knowledge/index/preview/:tagsViewName/:id?/:isAddPv?',
  85. name: 'knowledgePreview',
  86. component: () => import('@/views/knowledge/index/preview.vue'),
  87. meta: {
  88. title: '知识查看',
  89. isKeepAlive: true,
  90. isDynamic:true
  91. },
  92. },
  93. {
  94. path: '/system/roles/dataAuth/:id/:tagsViewName?',
  95. name: 'systemDataAuth',
  96. component: () => import('@/views/system/dataAuth/index.vue'),
  97. meta: {
  98. title: '数据权限',
  99. isKeepAlive: true,
  100. isDynamic:true
  101. },
  102. },
  103. {
  104. path: '/system/config/workflow/edit/:id?/:tagsViewName',
  105. name: 'workflowAddEdit',
  106. component: () => import('@/views/system/config/workflow/component/workflowEdit.vue'),
  107. meta: {
  108. title: '流程编辑',
  109. isKeepAlive: true,
  110. isDynamic:true
  111. },
  112. },
  113. {
  114. path: '/public/notice/:tagsViewName/:id/:isRead',
  115. name: 'auxiliaryNoticeRead',
  116. component: () => import('@/views/public/notice/index.vue'),
  117. meta: {
  118. title: '通知阅读',
  119. isKeepAlive: true,
  120. isDynamic:true
  121. },
  122. },
  123. {
  124. path: '/statistics/order/visitTable/:id/:tagsViewName?',
  125. name: 'statisticsOrderVisitTable',
  126. component: () => import('@/views/statistics/order/visitTable.vue'),
  127. meta: {
  128. title: '回访不满意原因统计明细',
  129. isKeepAlive: true,
  130. isDynamic:true
  131. },
  132. },
  133. {
  134. path: '/statistics/order/specialTable/:cause/:tagsViewName?',
  135. name: 'statisticsOrderSpecialTable',
  136. component: () => import('@/views/statistics/order/specialTable.vue'),
  137. meta: {
  138. title: '特提统计明细',
  139. isKeepAlive: true,
  140. isDynamic:true
  141. },
  142. },
  143. {
  144. path: '/statistics/department/Detail/:key/:tagsViewName?',
  145. name: 'statisticsDepartmentSatisfiedDetail',
  146. component: () => import('@/views/statistics/department/detailSatisfied.vue'),
  147. meta: {
  148. title: '部门满意度统计明细',
  149. isKeepAlive: true,
  150. isDynamic:true
  151. },
  152. },
  153. {
  154. path: '/statistics/detailSatisfiedOrg/org/:key/:tagsViewName?',
  155. name: 'statisticsDepartmentSatisfiedOrg',
  156. component: () => import('@/views/statistics/department/detailSatisfiedOrg.vue'),
  157. meta: {
  158. title: '部门满意度统计明细部门',
  159. isKeepAlive: true,
  160. isDynamic:true
  161. },
  162. },
  163. {
  164. path: '/statistics/center/detailTelFrequently/:FromPhone/:tagsViewName?',
  165. name: 'telFrequentlyDetail',
  166. component: () => import('@/views/statistics/center/detailTelFrequently.vue'),
  167. meta: {
  168. title: '高频来电统计明细',
  169. isKeepAlive: true,
  170. isDynamic:true
  171. },
  172. },
  173. {
  174. path: '/statistics/center/detailEventFrequently/:id/:tagsViewName?',
  175. name: 'eventFrequentlyDetail',
  176. component: () => import('@/views/statistics/center/detailEventFrequently.vue'),
  177. meta: {
  178. title: '高频事项预警统计明细',
  179. isKeepAlive: true,
  180. isDynamic:true
  181. },
  182. },
  183. {
  184. path: '/statistics/department/detailOverdue/:id/:tagsViewName?',
  185. name: 'statisticsDepartmentOverdueDetail',
  186. component: () => import('@/views/statistics/department/detailOverdue.vue'),
  187. meta: {
  188. title: '部门超期统计明细',
  189. isKeepAlive: true,
  190. isDynamic:true
  191. },
  192. },
  193. {
  194. path: '/judicial/statistics/detailEventClass/:id/:tagsViewName?',
  195. name: 'judicialDetailEventClass',
  196. component: () => import('@/views/judicial/statistics/detailEventClass.vue'),
  197. meta: {
  198. title: '事项分类统计明细',
  199. isKeepAlive: true,
  200. isDynamic:true
  201. },
  202. },
  203. {
  204. path: '/judicial/statistics/detailDepartmentSub/:id/:tagsViewName?', // 部门
  205. name: 'judicialStatisticsDepartmentSub',
  206. component: () => import('@/views/judicial/statistics/detailDepartmentSub.vue'),
  207. meta: {
  208. title: '执法部门办件统计明细',
  209. isKeepAlive: true,
  210. isDynamic:true
  211. },
  212. },
  213. {
  214. path: '/judicial/statistics/detailDepartment/:id/:tagsViewName?', //工单
  215. name: 'judicialDetailDepartment',
  216. component: () => import('@/views/judicial/statistics/detailDepartment.vue'),
  217. meta: {
  218. title: '执法部门办件统计明细',
  219. isKeepAlive: true,
  220. isDynamic:true
  221. },
  222. },
  223. {
  224. path: '/judicial/statistics/detailArea/:id/:tagsViewName?',
  225. name: 'judicialDetailArea',
  226. component: () => import('@/views/judicial/statistics/detailArea.vue'),
  227. meta: {
  228. title: '区域分类统计明细',
  229. isKeepAlive: true,
  230. isDynamic:true
  231. },
  232. },
  233. {
  234. path: '/judicial/statistics/detailSatisfied/:id/:tagsViewName?',
  235. name: 'judicialStatisticsDetailSatisfied',
  236. component: () => import('@/views/judicial/statistics/detailSatisfied.vue'),
  237. meta: {
  238. title: '部门满意度统计明细',
  239. isKeepAlive: true,
  240. isDynamic:true
  241. },
  242. },
  243. {
  244. path: '/judicial/statistics/detailSatisfiedOrg/:id/:tagsViewName?',
  245. name: 'judicialStatisticsDetailSatisfiedOrg',
  246. component: () => import('@/views/judicial/statistics/detailSatisfiedOrg.vue'),
  247. meta: {
  248. title: '部门满意度统计明细部门',
  249. isKeepAlive: true,
  250. isDynamic:true
  251. },
  252. },
  253. {
  254. path: '/statistics/center/detailWrongItem',
  255. name: 'statisticsCenterDetailWrongItem',
  256. component: () => import('@/views/statistics/center/detailWrongItem.vue'),
  257. meta: {
  258. title: '回退错件统计明细',
  259. isKeepAlive: true,
  260. },
  261. },
  262. {
  263. path: '/statistics/order/detailAcceptType/:id/:tagsViewName?',
  264. name: 'statisticsDetailAcceptType',
  265. component: () => import('@/views/statistics/order/detailAcceptType.vue'),
  266. meta: {
  267. title: '部门受理类型统计周期明细',
  268. isKeepAlive: true,
  269. isDynamic:true
  270. },
  271. },{
  272. path: '/statistics/order/detailDispatch/:id/:tagsViewName?',
  273. name: 'statisticsOrderDetailDispatch',
  274. component: () => import('@/views/statistics/order/detailDispatch.vue'),
  275. meta: {
  276. title: '派单量统计明细',
  277. isKeepAlive: true,
  278. isDynamic:true
  279. },
  280. },
  281. {
  282. path: '/statistics/department/detailHandleOrg/:id/:tagsViewName?',
  283. name: 'statisticsDepartmentDetailHandleOrg',
  284. component: () => import('@/views/statistics/department/detailHandleOrg.vue'),
  285. meta: {
  286. title: '部门办件统计表明细',
  287. isKeepAlive: true,
  288. isDynamic:true
  289. },
  290. },
  291. {
  292. path: '/statistics/department/detailHandle/:id/:tagsViewName?',
  293. name: 'statisticsDepartmentDetailHandle',
  294. component: () => import('@/views/statistics/department/detailHandle.vue'),
  295. meta: {
  296. title: '部门办件统计表明细',
  297. isKeepAlive: true,
  298. isDynamic:true
  299. },
  300. },
  301. {
  302. path: '/statistics/call/detailTalkTime/:id/:tagsViewName?',
  303. name: 'statisticsCallDetailTalkTime',
  304. component: () => import('@/views/statistics/call/detailTalkTime.vue'),
  305. meta: {
  306. title: '通话时段分析',
  307. isKeepAlive: true,
  308. isDynamic:true
  309. },
  310. },
  311. ];
  312. /**
  313. * 定义404、401界面
  314. * @link 参考:https://next.router.vuejs.org/zh/guide/essentials/history-mode.html#netlify
  315. */
  316. export const notFoundAndNoPower = [
  317. {
  318. path: '/401',
  319. name: 'noPower',
  320. component: () => import('@/views/error/401.vue'),
  321. meta: {
  322. title: '无权限',
  323. isHide: true,
  324. },
  325. },
  326. {
  327. path: '/:pathMatch(.*)',
  328. name: 'notFound',
  329. component: () => import('@/views/error/404.vue'),
  330. meta: {
  331. title: '404',
  332. isHide: true,
  333. },
  334. },
  335. ];
  336. /**
  337. * 定义静态路由(默认路由)
  338. * 此路由不要动,前端添加路由的话,请在 `dynamicRoutes 数组` 中添加
  339. * @description 前端控制直接改 dynamicRoutes 中的路由,后端控制不需要修改,请求接口路由数据时,会覆盖 dynamicRoutes 第一个顶级 children 的内容(全屏,不包含 layout 中的路由出口)
  340. * @returns 返回路由菜单数据
  341. */
  342. export const staticRoutes: Array<RouteRecordRaw> = [
  343. {
  344. path: '/login',
  345. name: 'login',
  346. component: () => import('@/views/login/index.vue'),
  347. meta: {
  348. title: '登录',
  349. },
  350. },
  351. {
  352. path: '/forgetPwd',
  353. name: 'forgetPwd',
  354. component: () => import('@/views/forgetPwd/index.vue'),
  355. meta: {
  356. title: '修改密码',
  357. },
  358. },
  359. {
  360. path: '/resetPwd',
  361. name: 'resetPwd',
  362. component: () => import('@/views/resetPwd/index.vue'),
  363. meta: {
  364. title: '重置密码',
  365. },
  366. },
  367. ];