config.ts 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. // https://umijs.org/config/
  2. import { defineConfig } from 'umi';
  3. import defaultSettings from './defaultSettings';
  4. import proxy from './proxy';
  5. import UserList from "@/pages/User/User";
  6. import RoleList from "@/pages/User/Role/RoleList";
  7. import DeptList from "@/pages/User/Dept/DeptList";
  8. import TokenList from "@/pages/User/Token/TokenList";
  9. const { REACT_APP_ENV } = process.env;
  10. export default defineConfig({
  11. hash: true,
  12. antd: {},
  13. dva: {
  14. hmr: true,
  15. },
  16. layout: {
  17. name: 'Ant Design Pro',
  18. locale: true,
  19. siderWidth: 208,
  20. },
  21. locale: {
  22. // default zh-CN
  23. default: 'zh-CN',
  24. // default true, when it is true, will use `navigator.language` overwrite default
  25. antd: true,
  26. baseNavigator: true,
  27. },
  28. dynamicImport: {
  29. loading: '@/components/PageLoading/index',
  30. },
  31. targets: {
  32. ie: 11,
  33. },
  34. // umi routes: https://umijs.org/docs/routing
  35. routes: [
  36. {
  37. path: '/user',
  38. layout: false,
  39. routes: [
  40. {
  41. name: 'login',
  42. path: '/user/login',
  43. component: './User/login',
  44. },
  45. ],
  46. },
  47. {
  48. path: '/workbench',
  49. name: '工作台',
  50. icon: 'ScheduleOutlined',
  51. component: './Workbench',
  52. },
  53. {
  54. "path": "/tickets",
  55. "name": "工单管理",
  56. "icon": "SolutionOutlined",
  57. routes: [
  58. {
  59. "path": "/tickets/duty",
  60. "name": "我的待办",
  61. "component": '../../src/pages/Ticket/DutyTicket',
  62. },
  63. {
  64. "path": "/tickets/owner",
  65. "name": "我的申请",
  66. "component": '../../src/pages/Ticket/OwnerTicket',
  67. },
  68. {
  69. "path": "/tickets/relation",
  70. "name": "与我相关",
  71. "component": '../../src/pages/Ticket/RelatedTicket',
  72. },
  73. {
  74. "path": "/tickets/view",
  75. "name": "工单查看",
  76. "component": '../../src/pages/Ticket/ViewTicket',
  77. },
  78. {
  79. "path": "/tickets/intervene",
  80. "name": "工单干预",
  81. "access": 'workflowAdmin',
  82. "component": '../../src/pages/Ticket/InterveneTicket',
  83. },
  84. {
  85. "path": "/tickets/all",
  86. "access": 'superAdmin',
  87. "name": "所有工单",
  88. "component": '../../src/pages/Ticket/AllTicket',
  89. }
  90. ]
  91. },
  92. {
  93. path: '/workflows',
  94. name: '工作流管理',
  95. access: 'workflowAdmin',
  96. icon: 'DeploymentUnitOutlined',
  97. component: '../../src/pages/Workflow/WorkflowList',
  98. },
  99. {
  100. path: '/workflows/detail',
  101. component: '../../src/pages/Workflow/WorkflowDetail',
  102. },
  103. {
  104. "path": "/users",
  105. "name": "用户及权限",
  106. // "icon": "dashboard",
  107. "icon": "ApartmentOutlined",
  108. access: 'superAdmin',
  109. routes: [
  110. {
  111. "path": "/users/user",
  112. "name": "用户管理",
  113. "component": '../../src/pages/User/User/UserList',
  114. },
  115. {
  116. "path": "/users/role",
  117. "name": "角色管理",
  118. "component": '../../src/pages/User/Role/RoleList',
  119. },
  120. {
  121. "path": "/users/dept",
  122. "name": "部门管理",
  123. "component": '../../src/pages/User/Dept/DeptList',
  124. },
  125. {
  126. "path": "/users/app",
  127. "name": "调用权限",
  128. "component": '../../src/pages/User/Token/TokenList',
  129. }
  130. ],
  131. },
  132. {
  133. path: '/manage',
  134. name: '系统配置',
  135. icon: 'ToolOutlined',
  136. access: 'superAdmin',
  137. component: './Manage',
  138. },
  139. {
  140. path: 'account/changepwd',
  141. layout: false,
  142. icon: 'ToolOutlined',
  143. component: './Account/ChangePwd',
  144. },
  145. {
  146. path: '/',
  147. redirect: '/workbench',
  148. },
  149. {
  150. component: './404',
  151. },
  152. ],
  153. // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  154. theme: {
  155. // ...darkTheme,
  156. 'primary-color': defaultSettings.primaryColor,
  157. },
  158. // @ts-ignore
  159. title: false,
  160. ignoreMomentLocale: true,
  161. proxy: proxy[REACT_APP_ENV || 'dev'],
  162. manifest: {
  163. basePath: '/',
  164. },
  165. });