.umirc.ts 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. import { defineConfig } from '@umijs/max';
  2. import locale from 'antd/es/calendar/locale/zh_CN';
  3. import moment from 'moment';
  4. moment.locale('zh-cn');
  5. export default defineConfig({
  6. hash: true,
  7. antd: {},
  8. dva: {},
  9. access: {},
  10. model: {},
  11. initialState: {},
  12. request: {},
  13. layout: {
  14. title: '金科环境数字化管理平台',
  15. locale: false,
  16. },
  17. locale: {
  18. antd: true, // 如果项目依赖中包含 `antd`,则默认为 true
  19. baseNavigator: true,
  20. baseSeparator: '-',
  21. default: 'zh-CN',
  22. title: false,
  23. useLocalStorage: true,
  24. },
  25. title: '金科环境数字化管理平台',
  26. publicPath: process.env.NODE_ENV == 'development' ? '/' : '/gt-dig/',
  27. proxy: {
  28. '/api': {
  29. // target: 'http://47.96.12.136:8888/',
  30. target: 'http://47.96.12.136:8895/',
  31. // target: 'http://120.55.44.4:8902/',
  32. changeOrigin: true,
  33. },
  34. },
  35. // chainWebpack(config) {
  36. // config.module
  37. // .rule()
  38. // .test(/\.(pdf|svg|docx|doc)$/)
  39. // .use('file-loader?name=[path][name].[ext]')
  40. // .loader('file-loader')
  41. // .end()
  42. // },
  43. routes: [
  44. {
  45. path: '/',
  46. redirect: '/home',
  47. },
  48. {
  49. name: '首页',
  50. path: '/home',
  51. component: './Home/index',
  52. menuRender: false,
  53. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/homeIcon.png',
  54. },
  55. {
  56. name: '审批流管理',
  57. path: '/flow',
  58. access: 'isAdmin',
  59. hideChildrenInMenu: true,
  60. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/flowIcon.png',
  61. routes: [
  62. // {
  63. // path: '/flow',
  64. // redirect: '/flow/list',
  65. // },
  66. {
  67. name: '审批流管理',
  68. path: '/flow',
  69. component: './Flow/index',
  70. },
  71. {
  72. name: '审批流详情',
  73. path: '/flow/audit',
  74. component: './Flow/Audit',
  75. hideInMenu: true,
  76. },
  77. ],
  78. },
  79. {
  80. name: 'OA审批',
  81. path: '/oa',
  82. hideChildrenInMenu: true,
  83. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/oaIcon.png',
  84. routes: [
  85. {
  86. name: 'OA审批',
  87. path: '/oa',
  88. component: './Flow/Oa',
  89. },
  90. {
  91. name: 'OA详情',
  92. path: '/oa/detail/:oaId',
  93. component: './Flow/OaDetail',
  94. },
  95. ],
  96. },
  97. // {
  98. // name: '权限演示',
  99. // path: '/access',
  100. // component: './Access',
  101. // },
  102. // {
  103. // name: 'CRUD 示例',
  104. // path: '/table',
  105. // component: './Table',
  106. // },
  107. {
  108. name: '登录',
  109. path: '/login',
  110. component: './Login/index',
  111. layout: false,
  112. },
  113. {
  114. name: '文档管理',
  115. path: '/fileManagement',
  116. component: './FileManagement/index',
  117. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/fileIcon.png',
  118. },
  119. {
  120. name: '合同管理',
  121. path: '/contract-manager',
  122. component: './ContractManager/index',
  123. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/contractIcon.png',
  124. },
  125. // {
  126. // name: '授权管理',
  127. // path: '/permission',
  128. // routes: [
  129. // {
  130. // name: '菜单授权',
  131. // path: '/permission/menu',
  132. // component: './Permission/menu',
  133. // },
  134. // {
  135. // name: '文档管理',
  136. // path: '/permission/file',
  137. // component: './Permission/file',
  138. // },
  139. // ],
  140. // },
  141. {
  142. name: '个人中心',
  143. path: '/profile',
  144. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/profileIcon.png',
  145. routes: [
  146. {
  147. name: '我的申请',
  148. path: '/profile/apply',
  149. component: './Profile/apply',
  150. },
  151. {
  152. name: '我的审批',
  153. path: '/profile/approve',
  154. component: './Profile/approve',
  155. },
  156. {
  157. name: '已审核',
  158. path: '/profile/approved',
  159. component: './Profile/approved',
  160. },
  161. ],
  162. // component: './Profile/index',
  163. // hideInMenu: true,
  164. },
  165. // {
  166. // name: '个人中心',
  167. // path: '/profile',
  168. // component: './Profile/index',
  169. // hideInMenu: true,
  170. // },
  171. {
  172. name: '审批详情',
  173. path: '/profile/:id',
  174. component: './Flow/OaAuditDetail',
  175. hideInMenu: true,
  176. },
  177. {
  178. name: '供应商管理',
  179. path: '/manufacturer',
  180. component: './ManufacturerMng/Firm',
  181. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  182. },
  183. {
  184. name: '人日立项',
  185. path: '/workload',
  186. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  187. routes: [
  188. {
  189. name: '工时管理',
  190. path: '/workload',
  191. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  192. routes: [
  193. {
  194. name: '上报工时',
  195. path: 'work-hours',
  196. component: './PurchaseList/WorkingHours/index',
  197. },
  198. {
  199. name: '审批工时',
  200. path: 'work-hours-auth',
  201. component: './PurchaseList/WorkingHours/Auth',
  202. },
  203. ],
  204. },
  205. {
  206. name: '项目立项',
  207. path: '/workload/approval',
  208. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  209. routes: [
  210. {
  211. name: '项目列表',
  212. path: 'list',
  213. component: './PurchaseList/Approval/List',
  214. },
  215. {
  216. name: '审核列表',
  217. path: 'auth',
  218. component: './PurchaseList/Approval/Auth',
  219. },
  220. ],
  221. },
  222. {
  223. name: '工时报表',
  224. path: '/workload/report',
  225. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  226. routes: [
  227. {
  228. name: '项目报表',
  229. path: 'project',
  230. component: './PurchaseList/Report/ProjectTree',
  231. },
  232. {
  233. name: '部门报表',
  234. path: 'department',
  235. component: './PurchaseList/Report/Department',
  236. },
  237. ],
  238. },
  239. {
  240. name: '财务报表',
  241. path: '/workload/finance',
  242. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  243. routes: [
  244. {
  245. name: '资源总表',
  246. path: 'index',
  247. component: './PurchaseList/Report/Finance',
  248. },
  249. {
  250. name: '资源中心人日使用汇总表',
  251. path: 'resources',
  252. component: './PurchaseList/Report/Finance/Resources',
  253. },
  254. {
  255. name: '执行项目人日汇总表',
  256. path: 'project',
  257. component: './PurchaseList/Report/Finance/Project',
  258. },
  259. ],
  260. },
  261. ],
  262. },
  263. {
  264. name: 'BOM清单',
  265. path: '/bom',
  266. hideChildrenInMenu: true,
  267. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/flowIcon.png',
  268. routes: [
  269. {
  270. name: '采购清单',
  271. path: '/bom/home',
  272. component: './Flow/index',
  273. },
  274. {
  275. name: '流程管理',
  276. path: '/bom/flow-list',
  277. component: './Flow/Audit',
  278. hideInMenu: true,
  279. },
  280. {
  281. name: '审核列表',
  282. path: '/bom/auth',
  283. component: './Flow/Audit',
  284. hideInMenu: true,
  285. },
  286. {
  287. name: '已提交审批',
  288. path: '/bom/submit',
  289. component: './Flow/Audit',
  290. hideInMenu: true,
  291. },
  292. ],
  293. },
  294. // {checkReport(3) && (
  295. // // <Menu.Item key="/home/report/finance">
  296. // // <Link to="/home/report/finance">财务报表</Link>
  297. // // </Menu.Item>
  298. // <SubMenu key="/home/report/finance" title="财务报表">
  299. // <Menu.Item key="/home/report/finance">
  300. // <Link to="/home/report/finance">资源总表</Link>
  301. // </Menu.Item>
  302. // <Menu.Item key="/home/report/finance/resources">
  303. // <Link to="/home/report/finance/resources">
  304. // 资源中心人日使用汇总表
  305. // </Link>
  306. // </Menu.Item>
  307. // <Menu.Item key="/home/report/finance/project">
  308. // <Link to="/home/report/finance/project">
  309. // 执行项目人日汇总表
  310. // </Link>
  311. // </Menu.Item>
  312. // </SubMenu>
  313. // )}
  314. ],
  315. npmClient: 'yarn',
  316. });