.umirc.ts 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  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. // links: [
  36. // {
  37. // href: 'stylesheet',
  38. // rel: 'http://localhost:3000/plugins/css/pluginsCss.css',
  39. // },
  40. // { href: 'stylesheet', rel: 'http://localhost:3000/plugins/plugins.css' },
  41. // { href: 'stylesheet', rel: 'http://localhost:3000/css/luckysheet.css' },
  42. // {
  43. // href: 'stylesheet',
  44. // rel: 'http://localhost:3000/assets/iconfont/iconfont.css',
  45. // },
  46. // ],
  47. // scripts: [
  48. // { src: '/ZwCloud2DSDK/ZwCloud2D.js' },
  49. // { src: '/ZwCloud2DSDK/ZwWasmJs.js' },
  50. // { src: '/ZwCloud2DSDK/ZwCloud2DAPI.js' },
  51. // ],
  52. headScripts: [
  53. `${publicPath}ZwCloud2DSDK/ZwCloud2D.js`,
  54. `${publicPath}ZwCloud2DSDK/ZwWasmJs.js`,
  55. `${publicPath}ZwCloud2DSDK/ZwCloud2DPrivateAPI.js`,
  56. ],
  57. proxy: {
  58. '/api': {
  59. // target: 'http://192.168.20.232:1007/',
  60. target: 'http://47.96.12.136:8888/',
  61. // target: 'https://work.greentech.com.cn/',
  62. changeOrigin: true,
  63. },
  64. },
  65. // chainWebpack(config) {
  66. // config.module
  67. // .rule()
  68. // .test(/\.(pdf|svg|docx|doc)$/)
  69. // .use('file-loader?name=[path][name].[ext]')
  70. // .loader('file-loader')
  71. // .end()
  72. // },
  73. routes: [
  74. {
  75. path: '/',
  76. redirect: '/home',
  77. },
  78. {
  79. name: '首页',
  80. path: '/home',
  81. component: './Home/index',
  82. menuRender: false,
  83. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/homeIcon.png',
  84. },
  85. {
  86. name: '审批流管理',
  87. path: '/flow',
  88. access: 'isAdmin',
  89. hideChildrenInMenu: true,
  90. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/flowIcon.png',
  91. routes: [
  92. // {
  93. // path: '/flow',
  94. // redirect: '/flow/list',
  95. // },
  96. {
  97. name: '审批流管理',
  98. path: '/flow',
  99. component: './Flow/index',
  100. },
  101. {
  102. name: '审批流详情',
  103. path: '/flow/audit',
  104. component: './Flow/Audit',
  105. hideInMenu: true,
  106. },
  107. ],
  108. },
  109. {
  110. name: 'OA审批',
  111. path: '/oa',
  112. hideChildrenInMenu: true,
  113. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/oaIcon.png',
  114. routes: [
  115. {
  116. name: 'OA审批',
  117. path: '/oa',
  118. component: './Flow/Oa',
  119. },
  120. {
  121. name: 'OA详情',
  122. path: '/oa/detail/:oaId',
  123. component: './Flow/OaDetail',
  124. },
  125. ],
  126. },
  127. // {
  128. // name: '权限演示',
  129. // path: '/access',
  130. // component: './Access',
  131. // },
  132. {
  133. name: '修改密码',
  134. path: '/safety',
  135. component: './UserCenter',
  136. hideInMenu: true,
  137. },
  138. {
  139. name: '登录',
  140. path: '/login',
  141. component: './Login/index',
  142. layout: false,
  143. },
  144. {
  145. name: '文档管理',
  146. path: '/fileManagement',
  147. component: './FileManagement/index',
  148. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/fileIcon.png',
  149. },
  150. {
  151. name: '合同管理',
  152. path: '/contract-manager',
  153. component: './ContractManager/index',
  154. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/contractIcon.png',
  155. },
  156. {
  157. name: '个人中心',
  158. path: '/profile',
  159. component: './Profile/index',
  160. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/profileIcon.png',
  161. },
  162. {
  163. name: '审批详情',
  164. path: '/profile/detail',
  165. component: './Flow/OaAuditDetail',
  166. hideInMenu: true,
  167. },
  168. {
  169. name: '供应商管理',
  170. path: '/manufacturer',
  171. component: './ManufacturerMng/Firm',
  172. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  173. },
  174. {
  175. name: 'PSR管理',
  176. path: '/psrManage',
  177. component: './PSRManage',
  178. icon: 'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/doc/contract/2023-06-20/25bf2fa5-f340-4f9b-8a13-ad50086aedbb.png',
  179. },
  180. {
  181. name: 'PSR详情',
  182. path: '/psrManage/detail/:id',
  183. component: './PSRManage/detail',
  184. hideInMenu: true,
  185. },
  186. {
  187. name: '工时管理',
  188. path: '/workload',
  189. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  190. routes: [
  191. {
  192. name: '上报工时',
  193. path: 'work-hours',
  194. component: './PurchaseList/WorkingHours/index',
  195. },
  196. {
  197. name: '审批工时',
  198. path: 'work-hours-auth',
  199. component: './PurchaseList/WorkingHours/Auth',
  200. },
  201. // {
  202. // name: '工时报表',
  203. // path: '/workload/report',
  204. // icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  205. // routes: [
  206. // {
  207. // name: '项目报表',
  208. // path: 'project',
  209. // component: './PurchaseList/Report/ProjectTree',
  210. // },
  211. // {
  212. // name: '部门报表',
  213. // path: 'department',
  214. // component: './PurchaseList/Report/Department',
  215. // },
  216. // // { name: '财务报表',
  217. // // path: 'finance', path: '/workload/report/finance' },
  218. // ],
  219. // },
  220. ],
  221. },
  222. {
  223. name: '项目立项',
  224. path: '/workload/approval',
  225. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  226. routes: [
  227. {
  228. name: '项目列表',
  229. path: 'list',
  230. component: './PurchaseList/Approval/List',
  231. },
  232. {
  233. name: '审核列表',
  234. path: 'auth',
  235. component: './PurchaseList/Approval/Auth',
  236. },
  237. ],
  238. },
  239. {
  240. name: '工时报表',
  241. path: '/workload/report',
  242. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  243. routes: [
  244. {
  245. name: '项目报表',
  246. path: 'project',
  247. component: './PurchaseList/Report/ProjectTree',
  248. },
  249. {
  250. name: '部门报表',
  251. path: 'department',
  252. component: './PurchaseList/Report/Department',
  253. },
  254. {
  255. name: '财务报表',
  256. path: '/workload/report/finance',
  257. // icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  258. routes: [
  259. {
  260. name: '资源总表',
  261. path: 'index',
  262. component: './PurchaseList/Report/Finance',
  263. },
  264. {
  265. name: '资源中心人日使用汇总表',
  266. path: 'resources',
  267. component: './PurchaseList/Report/Finance/Resources',
  268. },
  269. {
  270. name: '执行项目人日汇总表',
  271. path: 'project',
  272. component: './PurchaseList/Report/Finance/Project',
  273. },
  274. ],
  275. },
  276. ],
  277. },
  278. {
  279. name: '人日日志',
  280. path: '/workload/record',
  281. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  282. routes: [
  283. {
  284. name: '项目日志',
  285. path: 'project',
  286. component: './PurchaseList/DailyRecord',
  287. // icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  288. },
  289. {
  290. name: '个人日志',
  291. path: 'report-daily',
  292. component: './ReportDaily/Index',
  293. // icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  294. },
  295. // {
  296. // name: '工时报表',
  297. // path: '/workload/report',
  298. // icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  299. // routes: [
  300. // {
  301. // name: '项目报表',
  302. // path: 'project',
  303. // component: './PurchaseList/Report/ProjectTree',
  304. // },
  305. // {
  306. // name: '部门报表',
  307. // path: 'department',
  308. // component: './PurchaseList/Report/Department',
  309. // },
  310. // ],
  311. // },
  312. // {
  313. // name: '财务报表',
  314. // path: '/workload/finance',
  315. // icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png',
  316. // routes: [
  317. // {
  318. // name: '资源总表',
  319. // path: 'index',
  320. // component: './PurchaseList/Report/Finance',
  321. // },
  322. // {
  323. // name: '资源中心人日使用汇总表',
  324. // path: 'resources',
  325. // component: './PurchaseList/Report/Finance/Resources',
  326. // },
  327. // {
  328. // name: '执行项目人日汇总表',
  329. // path: 'project',
  330. // component: './PurchaseList/Report/Finance/Project',
  331. // },
  332. // ],
  333. // },
  334. ],
  335. },
  336. {
  337. name: 'BOM清单',
  338. path: '/bom',
  339. hideChildrenInMenu: true,
  340. icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/flowIcon.png',
  341. routes: [
  342. {
  343. name: '采购清单',
  344. path: '/bom/home',
  345. component: './Flow/index',
  346. },
  347. {
  348. name: '流程管理',
  349. path: '/bom/flow-list',
  350. component: './Flow/Audit',
  351. hideInMenu: true,
  352. },
  353. {
  354. name: '审核列表',
  355. path: '/bom/auth',
  356. component: './Flow/Audit',
  357. hideInMenu: true,
  358. },
  359. {
  360. name: '已提交审批',
  361. path: '/bom/submit',
  362. component: './Flow/Audit',
  363. hideInMenu: true,
  364. },
  365. ],
  366. },
  367. {
  368. name: 'CAD实例',
  369. path: '/cad',
  370. component: './Cad',
  371. icon: 'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/doc/contract/2023-07-31/3f72fccf-4f9c-4891-a6ec-f04fe4b1d9a2.png',
  372. },
  373. {
  374. name: 'CAD详情',
  375. path: '/cad/detail',
  376. component: './Cad/detail',
  377. hideInMenu: true,
  378. },
  379. {
  380. name: 'Scada功能',
  381. path: '/scada',
  382. access: 'scada',
  383. component: './Scada',
  384. icon: 'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/doc/contract/2023-11-24/27866151-5691-487d-8c58-5b4ae995395e.png',
  385. },
  386. {
  387. name: 'GreenGPT',
  388. path: '/gpt',
  389. component: './GreenGPT',
  390. icon: 'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/public/chart-template/icon-gpt.png',
  391. },
  392. ],
  393. npmClient: 'yarn',
  394. });