.umirc.ts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. import { defineConfig } from '@umijs/max';
  2. const publicPath = process.env.NODE_ENV == 'development' ? '/' : '/gt-dig/';
  3. import locale from 'antd/es/calendar/locale/zh_CN';
  4. import moment from 'moment';
  5. moment.locale('zh-cn');
  6. export default defineConfig({
  7. hash: true,
  8. antd: {},
  9. dva: {},
  10. access: {},
  11. model: {},
  12. initialState: {},
  13. request: {},
  14. layout: {
  15. title: '金科环境数字化管理平台',
  16. locale: false,
  17. },
  18. locale: {
  19. antd: true, // 如果项目依赖中包含 `antd`,则默认为 true
  20. baseNavigator: true,
  21. baseSeparator: '-',
  22. default: 'zh-CN',
  23. title: false,
  24. useLocalStorage: true,
  25. },
  26. title: '金科环境数字化管理平台',
  27. publicPath,
  28. metas: [
  29. // 配置html禁止缓存
  30. { 'http-equiv': 'pragma', content: 'no-cache' },
  31. { 'http-equiv': 'cache-control', content: 'no-cache' },
  32. { 'http-equiv': 'expires', content: '0' },
  33. { 'http-equiv': 'X-UA-Compatible', content: 'IE=EmulateIE9' },
  34. ],
  35. proxy: {
  36. '/api': {
  37. // target: 'http://192.168.20.232:1007/',
  38. target: 'http://47.96.12.136:8895/',
  39. // target: 'https://work.greentech.com.cn/',
  40. changeOrigin: true,
  41. },
  42. },
  43. // chainWebpack(config) {
  44. // config.module
  45. // .rule()
  46. // .test(/\.(pdf|svg|docx|doc)$/)
  47. // .use('file-loader?name=[path][name].[ext]')
  48. // .loader('file-loader')
  49. // .end()
  50. // },
  51. routes: [
  52. {
  53. path: '/',
  54. redirect: '/home',
  55. },
  56. {
  57. name: '首页',
  58. path: '/home',
  59. component: './Home/index',
  60. menuRender: false,
  61. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/homeIcon.png',
  62. },
  63. {
  64. name: '审批流管理',
  65. path: '/flow',
  66. access: 'isAdmin',
  67. hideChildrenInMenu: true,
  68. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/flowIcon.png',
  69. routes: [
  70. // {
  71. // path: '/flow',
  72. // redirect: '/flow/list',
  73. // },
  74. {
  75. name: '审批流管理',
  76. path: '/flow',
  77. component: './Flow/index',
  78. },
  79. {
  80. name: '审批流详情',
  81. path: '/flow/audit',
  82. component: './Flow/Audit',
  83. hideInMenu: true,
  84. },
  85. ],
  86. },
  87. {
  88. name: 'OA审批',
  89. path: '/oa',
  90. hideChildrenInMenu: true,
  91. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/oaIcon.png',
  92. routes: [
  93. {
  94. name: 'OA审批',
  95. path: '/oa',
  96. component: './Flow/Oa',
  97. },
  98. {
  99. name: 'OA详情',
  100. path: '/oa/detail/:oaId',
  101. component: './Flow/OaDetail',
  102. },
  103. ],
  104. },
  105. // {
  106. // name: '权限演示',
  107. // path: '/access',
  108. // component: './Access',
  109. // },
  110. {
  111. name: '修改密码',
  112. path: '/safety',
  113. component: './UserCenter',
  114. hideInMenu: true,
  115. },
  116. {
  117. name: '登录',
  118. path: '/login',
  119. component: './Login/index',
  120. layout: false,
  121. },
  122. {
  123. name: '文档管理',
  124. path: '/fileManagement',
  125. component: './FileManagement/index',
  126. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/fileIcon.png',
  127. },
  128. {
  129. name: '合同管理',
  130. path: '/contract-manager',
  131. component: './ContractManager/index',
  132. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/contractIcon.png',
  133. },
  134. {
  135. name: '个人中心',
  136. path: '/profile',
  137. component: './Profile/index',
  138. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/profileIcon.png',
  139. },
  140. {
  141. name: '审批详情',
  142. path: '/profile/detail',
  143. component: './Flow/OaAuditDetail',
  144. hideInMenu: true,
  145. },
  146. {
  147. name: '供应商管理',
  148. path: '/manufacturer',
  149. component: './ManufacturerMng/Firm',
  150. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  151. },
  152. {
  153. name: 'PSR管理',
  154. path: '/psrManage',
  155. component: './PSRManage',
  156. icon: 'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/doc/contract/2023-06-20/25bf2fa5-f340-4f9b-8a13-ad50086aedbb.png',
  157. },
  158. {
  159. name: 'PSR详情',
  160. path: '/psrManage/detail/:id',
  161. component: './PSRManage/detail',
  162. hideInMenu: true,
  163. },
  164. {
  165. name: '工时管理',
  166. path: '/workload',
  167. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  168. routes: [
  169. {
  170. name: '上报工时',
  171. path: 'work-hours',
  172. component: './PurchaseList/WorkingHours/index',
  173. },
  174. {
  175. name: '审批工时',
  176. path: 'work-hours-auth',
  177. component: './PurchaseList/WorkingHours/Auth',
  178. },
  179. // {
  180. // name: '工时报表',
  181. // path: '/workload/report',
  182. // icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  183. // routes: [
  184. // {
  185. // name: '项目报表',
  186. // path: 'project',
  187. // component: './PurchaseList/Report/ProjectTree',
  188. // },
  189. // {
  190. // name: '部门报表',
  191. // path: 'department',
  192. // component: './PurchaseList/Report/Department',
  193. // },
  194. // // { name: '财务报表',
  195. // // path: 'finance', path: '/workload/report/finance' },
  196. // ],
  197. // },
  198. ],
  199. },
  200. {
  201. name: '项目立项',
  202. path: '/workload/approval',
  203. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  204. routes: [
  205. {
  206. name: '项目列表',
  207. path: 'list',
  208. component: './PurchaseList/Approval/List',
  209. },
  210. {
  211. name: '审核列表',
  212. path: 'auth',
  213. component: './PurchaseList/Approval/Auth',
  214. },
  215. ],
  216. },
  217. {
  218. name: '工时报表',
  219. path: '/workload/report',
  220. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  221. routes: [
  222. {
  223. name: '项目报表',
  224. path: 'project',
  225. component: './PurchaseList/Report/ProjectTree',
  226. },
  227. {
  228. name: '部门报表',
  229. path: 'department',
  230. component: './PurchaseList/Report/Department',
  231. },
  232. {
  233. name: '财务报表',
  234. path: '/workload/report/finance',
  235. // icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  236. routes: [
  237. {
  238. name: '资源总表',
  239. path: 'index',
  240. component: './PurchaseList/Report/Finance',
  241. },
  242. {
  243. name: '资源中心人日使用汇总表',
  244. path: 'resources',
  245. component: './PurchaseList/Report/Finance/Resources',
  246. },
  247. {
  248. name: '执行项目人日汇总表',
  249. path: 'project',
  250. component: './PurchaseList/Report/Finance/Project',
  251. },
  252. ],
  253. },
  254. ],
  255. },
  256. {
  257. name: '人日日志',
  258. path: '/workload/record',
  259. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  260. routes: [
  261. {
  262. name: '项目日志',
  263. path: 'project',
  264. component: './PurchaseList/DailyRecord',
  265. // icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  266. },
  267. {
  268. name: '个人日志',
  269. path: 'report-daily',
  270. component: './ReportDaily/Index',
  271. // icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  272. },
  273. // {
  274. // name: '工时报表',
  275. // path: '/workload/report',
  276. // icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  277. // routes: [
  278. // {
  279. // name: '项目报表',
  280. // path: 'project',
  281. // component: './PurchaseList/Report/ProjectTree',
  282. // },
  283. // {
  284. // name: '部门报表',
  285. // path: 'department',
  286. // component: './PurchaseList/Report/Department',
  287. // },
  288. // ],
  289. // },
  290. // {
  291. // name: '财务报表',
  292. // path: '/workload/finance',
  293. // icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  294. // routes: [
  295. // {
  296. // name: '资源总表',
  297. // path: 'index',
  298. // component: './PurchaseList/Report/Finance',
  299. // },
  300. // {
  301. // name: '资源中心人日使用汇总表',
  302. // path: 'resources',
  303. // component: './PurchaseList/Report/Finance/Resources',
  304. // },
  305. // {
  306. // name: '执行项目人日汇总表',
  307. // path: 'project',
  308. // component: './PurchaseList/Report/Finance/Project',
  309. // },
  310. // ],
  311. // },
  312. ],
  313. },
  314. {
  315. name: 'BOM清单',
  316. path: '/bom',
  317. hideChildrenInMenu: true,
  318. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/flowIcon.png',
  319. routes: [
  320. {
  321. name: '采购清单',
  322. path: '/bom/home',
  323. component: './Flow/index',
  324. },
  325. {
  326. name: '流程管理',
  327. path: '/bom/flow-list',
  328. component: './Flow/Audit',
  329. hideInMenu: true,
  330. },
  331. {
  332. name: '审核列表',
  333. path: '/bom/auth',
  334. component: './Flow/Audit',
  335. hideInMenu: true,
  336. },
  337. {
  338. name: '已提交审批',
  339. path: '/bom/submit',
  340. component: './Flow/Audit',
  341. hideInMenu: true,
  342. },
  343. ],
  344. },
  345. {
  346. name: 'CAD实例',
  347. path: '/cad',
  348. component: './Cad',
  349. icon: 'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/doc/contract/2023-07-31/3f72fccf-4f9c-4891-a6ec-f04fe4b1d9a2.png',
  350. },
  351. {
  352. name: 'CAD详情',
  353. path: '/cad/detail',
  354. component: './Cad/detail',
  355. hideInMenu: true,
  356. },
  357. {
  358. name: 'Scada功能',
  359. path: '/scada',
  360. access: 'scada',
  361. component: './Scada',
  362. icon: 'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/doc/contract/2023-11-24/27866151-5691-487d-8c58-5b4ae995395e.png',
  363. },
  364. {
  365. name: 'GreenGPT',
  366. path: '/gpt',
  367. component: './GreenGPT',
  368. icon: 'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/public/chart-template/icon-gpt.png',
  369. },
  370. ],
  371. npmClient: 'yarn',
  372. });