route.ts 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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. },
  70. },
  71. {
  72. path: '/knowledge/index/edit/:id?/:tagsViewName/:isDraft?',
  73. name: 'knowledgeEdit',
  74. component: () => import('@/views/knowledge/index/edit.vue'),
  75. meta: {
  76. title: '知识库新增/编辑',
  77. },
  78. },
  79. {
  80. path: '/knowledge/index/preview/:tagsViewName/:id?/:isAddPv?',
  81. name: 'knowledgePreview',
  82. component: () => import('@/views/knowledge/index/preview.vue'),
  83. meta: {
  84. title: '知识查看',
  85. },
  86. },
  87. {
  88. path: '/system/roles/dataAuth',
  89. name: 'systemDataAuth',
  90. component: () => import('@/views/system/dataAuth/index.vue'),
  91. meta: {
  92. title: '数据权限',
  93. },
  94. },
  95. {
  96. path: '/system/config/workflow/edit/:id?/:tagsViewName',
  97. name: 'workflowAddEdit',
  98. component: () => import('@/views/system/config/workflow/component/workflowEdit.vue'),
  99. meta: {
  100. title: '流程编辑',
  101. },
  102. },
  103. {
  104. path: '/public/notice/:tagsViewName/:id/:isRead',
  105. name: 'auxiliaryNoticeRead',
  106. component: () => import('@/views/public/notice/index.vue'),
  107. meta: {
  108. title: '通知阅读',
  109. },
  110. },
  111. {
  112. path: '/statistics/order/visitTable/:id/:startTime/:endTime/:orgId/:tagsViewName',
  113. name: 'statisticsOrderVisitTable',
  114. component: () => import('@/views/statistics/order/visitTable.vue'),
  115. meta: {
  116. title: '不满意回访明细',
  117. },
  118. },
  119. {
  120. path: '/statistics/order/specialTable/:cause/:startTime:/:endTime/:tagsViewName',
  121. name: 'statisticsOrderSpecialTable',
  122. component: () => import('@/views/statistics/order/specialTable.vue'),
  123. meta: {
  124. title: '特提统计明细',
  125. },
  126. },
  127. {
  128. path: '/statistics/department/Detail/:tagsViewName/:key',
  129. name: 'statisticsDepartmentSatisfiedDetail',
  130. component: () => import('@/views/statistics/department/detailSatisfied.vue'),
  131. meta: {
  132. title: '部门满意度统计明细',
  133. },
  134. },
  135. {
  136. path: '/statistics/department/org/:tagsViewName/:key',
  137. name: 'statisticsDepartmentSatisfiedOrg',
  138. component: () => import('@/views/statistics/department/orgSatisfied.vue'),
  139. meta: {
  140. title: '部门满意度统计明细部门',
  141. },
  142. },
  143. ];
  144. /**
  145. * 定义404、401界面
  146. * @link 参考:https://next.router.vuejs.org/zh/guide/essentials/history-mode.html#netlify
  147. */
  148. export const notFoundAndNoPower = [
  149. {
  150. path: '/401',
  151. name: 'noPower',
  152. component: () => import('@/views/error/401.vue'),
  153. meta: {
  154. title: '无权限',
  155. isHide: true,
  156. },
  157. },
  158. {
  159. path: '/:pathMatch(.*)',
  160. name: 'notFound',
  161. component: () => import('@/views/error/404.vue'),
  162. meta: {
  163. title: '404',
  164. isHide: true,
  165. },
  166. },
  167. ];
  168. /**
  169. * 定义静态路由(默认路由)
  170. * 此路由不要动,前端添加路由的话,请在 `dynamicRoutes 数组` 中添加
  171. * @description 前端控制直接改 dynamicRoutes 中的路由,后端控制不需要修改,请求接口路由数据时,会覆盖 dynamicRoutes 第一个顶级 children 的内容(全屏,不包含 layout 中的路由出口)
  172. * @returns 返回路由菜单数据
  173. */
  174. export const staticRoutes: Array<RouteRecordRaw> = [
  175. {
  176. path: '/login',
  177. name: 'login',
  178. component: () => import('@/views/login/index.vue'),
  179. meta: {
  180. title: '登录',
  181. },
  182. },
  183. {
  184. path: '/forgetPwd',
  185. name: 'forgetPwd',
  186. component: () => import('@/views/forgetPwd/index.vue'),
  187. meta: {
  188. title: '修改密码',
  189. },
  190. },
  191. {
  192. path: '/resetPwd',
  193. name: 'resetPwd',
  194. component: () => import('@/views/resetPwd/index.vue'),
  195. meta: {
  196. title: '重置密码',
  197. },
  198. },
  199. ];