.umirc.ts 10 KB

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