.umirc.ts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  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: 'work-hours',
  191. component: './PurchaseList/WorkingHours/index',
  192. },
  193. {
  194. name: '审批工时',
  195. path: 'work-hours-auth',
  196. component: './PurchaseList/WorkingHours/Auth',
  197. },
  198. {
  199. name: '工时报表',
  200. path: '/workload/report',
  201. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  202. routes: [
  203. {
  204. name: '项目报表',
  205. path: 'project',
  206. component: './PurchaseList/Report/ProjectTree',
  207. },
  208. {
  209. name: '部门报表',
  210. path: 'department',
  211. component: './PurchaseList/Report/Department',
  212. },
  213. { name: '财务报表', path: '/workload/report/finance' },
  214. ],
  215. },
  216. ],
  217. },
  218. {
  219. name: '项目立项',
  220. path: '/workload/approval',
  221. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  222. routes: [
  223. {
  224. name: '项目列表',
  225. path: 'list',
  226. component: './PurchaseList/Approval/List',
  227. },
  228. {
  229. name: '审核列表',
  230. path: 'auth',
  231. component: './PurchaseList/Approval/Auth',
  232. },
  233. ],
  234. },
  235. {
  236. name: '人日立项',
  237. path: '/workload',
  238. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  239. routes: [
  240. {
  241. name: '工时管理',
  242. path: '/workload',
  243. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  244. routes: [
  245. {
  246. name: '上报工时',
  247. path: 'work-hours',
  248. component: './PurchaseList/WorkingHours/index',
  249. },
  250. {
  251. name: '审批工时',
  252. path: 'work-hours-auth',
  253. component: './PurchaseList/WorkingHours/Auth',
  254. },
  255. ],
  256. },
  257. {
  258. name: '项目立项',
  259. path: '/workload/approval',
  260. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  261. routes: [
  262. {
  263. name: '项目列表',
  264. path: 'list',
  265. component: './PurchaseList/Approval/List',
  266. },
  267. {
  268. name: '审核列表',
  269. path: 'auth',
  270. component: './PurchaseList/Approval/Auth',
  271. },
  272. ],
  273. },
  274. {
  275. name: '工时报表',
  276. path: '/workload/report',
  277. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  278. routes: [
  279. {
  280. name: '项目报表',
  281. path: 'project',
  282. component: './PurchaseList/Report/ProjectTree',
  283. },
  284. {
  285. name: '部门报表',
  286. path: 'department',
  287. component: './PurchaseList/Report/Department',
  288. },
  289. ],
  290. },
  291. {
  292. name: '财务报表',
  293. path: '/workload/finance',
  294. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  295. routes: [
  296. {
  297. name: '资源总表',
  298. path: 'index',
  299. component: './PurchaseList/Report/Finance',
  300. },
  301. {
  302. name: '资源中心人日使用汇总表',
  303. path: 'resources',
  304. component: './PurchaseList/Report/Finance/Resources',
  305. },
  306. {
  307. name: '执行项目人日汇总表',
  308. path: 'project',
  309. component: './PurchaseList/Report/Finance/Project',
  310. },
  311. ],
  312. },
  313. ],
  314. },
  315. {
  316. name: 'BOM清单',
  317. path: '/bom',
  318. hideChildrenInMenu: true,
  319. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/flowIcon.png',
  320. routes: [
  321. {
  322. name: '采购清单',
  323. path: '/bom/home',
  324. component: './Flow/index',
  325. },
  326. {
  327. name: '流程管理',
  328. path: '/bom/flow-list',
  329. component: './Flow/Audit',
  330. hideInMenu: true,
  331. },
  332. {
  333. name: '审核列表',
  334. path: '/bom/auth',
  335. component: './Flow/Audit',
  336. hideInMenu: true,
  337. },
  338. {
  339. name: '已提交审批',
  340. path: '/bom/submit',
  341. component: './Flow/Audit',
  342. hideInMenu: true,
  343. },
  344. ],
  345. },
  346. // {checkReport(3) && (
  347. // // <Menu.Item key="/home/report/finance">
  348. // // <Link to="/home/report/finance">财务报表</Link>
  349. // // </Menu.Item>
  350. // <SubMenu key="/home/report/finance" title="财务报表">
  351. // <Menu.Item key="/home/report/finance">
  352. // <Link to="/home/report/finance">资源总表</Link>
  353. // </Menu.Item>
  354. // <Menu.Item key="/home/report/finance/resources">
  355. // <Link to="/home/report/finance/resources">
  356. // 资源中心人日使用汇总表
  357. // </Link>
  358. // </Menu.Item>
  359. // <Menu.Item key="/home/report/finance/project">
  360. // <Link to="/home/report/finance/project">
  361. // 执行项目人日汇总表
  362. // </Link>
  363. // </Menu.Item>
  364. // </SubMenu>
  365. // )}
  366. ],
  367. npmClient: 'yarn',
  368. });