import { defineConfig } from '@umijs/max'; const publicPath = process.env.NODE_ENV == 'development' ? '/' : '/gt-dig/'; export default defineConfig({ hash: true, antd: {}, dva: {}, access: {}, model: {}, initialState: {}, request: {}, layout: { title: '金科环境数字化管理平台', locale: false, }, title: '金科环境数字化管理平台', publicPath, metas: [ // 配置html禁止缓存 { 'http-equiv': 'pragma', content: 'no-cache' }, { 'http-equiv': 'cache-control', content: 'no-cache' }, { 'http-equiv': 'expires', content: '0' }, { 'http-equiv': 'X-UA-Compatible', content: 'IE=EmulateIE9' }, ], // links: [ // { // href: 'stylesheet', // rel: 'http://localhost:3000/plugins/css/pluginsCss.css', // }, // { href: 'stylesheet', rel: 'http://localhost:3000/plugins/plugins.css' }, // { href: 'stylesheet', rel: 'http://localhost:3000/css/luckysheet.css' }, // { // href: 'stylesheet', // rel: 'http://localhost:3000/assets/iconfont/iconfont.css', // }, // ], // scripts: [ // { src: '/ZwCloud2DSDK/ZwCloud2D.js' }, // { src: '/ZwCloud2DSDK/ZwWasmJs.js' }, // { src: '/ZwCloud2DSDK/ZwCloud2DAPI.js' }, // ], headScripts: [ `${publicPath}ZwCloud2DSDK/ZwCloud2D.js`, `${publicPath}ZwCloud2DSDK/ZwWasmJs.js`, `${publicPath}ZwCloud2DSDK/ZwCloud2DPrivateAPI.js`, ], proxy: { '/api': { // target: 'http://192.168.20.232:1007/', target: 'http://47.96.12.136:8895/', // target: 'https://work.greentech.com.cn/', changeOrigin: true, }, }, // chainWebpack(config) { // config.module // .rule() // .test(/\.(pdf|svg|docx|doc)$/) // .use('file-loader?name=[path][name].[ext]') // .loader('file-loader') // .end() // }, routes: [ { path: '/', redirect: '/home', }, { name: '首页', path: '/home', component: './Home/index', menuRender: false, icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/homeIcon.png', }, { name: '审批流管理', path: '/flow', access: 'isAdmin', hideChildrenInMenu: true, icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/flowIcon.png', routes: [ // { // path: '/flow', // redirect: '/flow/list', // }, { name: '审批流管理', path: '/flow', component: './Flow/index', }, { name: '审批流详情', path: '/flow/audit', component: './Flow/Audit', hideInMenu: true, }, ], }, { name: 'OA审批', path: '/oa', hideChildrenInMenu: true, icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/oaIcon.png', routes: [ { name: 'OA审批', path: '/oa', component: './Flow/Oa', }, { name: 'OA详情', path: '/oa/detail/:oaId', component: './Flow/OaDetail', }, ], }, // { // name: '权限演示', // path: '/access', // component: './Access', // }, { name: '修改密码', path: '/safety', component: './UserCenter', hideInMenu: true, }, { name: '登录', path: '/login', component: './Login/index', layout: false, }, { name: '文档管理', path: '/fileManagement', component: './FileManagement/index', icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/fileIcon.png', }, { name: '合同管理', path: '/contract-manager', component: './ContractManager/index', icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/contractIcon.png', }, { name: '个人中心', path: '/profile', component: './Profile/index', icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/profileIcon.png', }, { name: '审批详情', path: '/profile/detail', component: './Flow/OaAuditDetail', hideInMenu: true, }, { name: '供应商管理', path: '/manufacturer', component: './ManufacturerMng/Firm', icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/manufacturerIcon.png', }, { name: 'PSR管理', path: '/psrManage', component: './PSRManage', icon: 'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/doc/contract/2023-06-20/25bf2fa5-f340-4f9b-8a13-ad50086aedbb.png', }, { name: 'PSR详情', path: '/psrManage/detail/:id', component: './PSRManage/detail', hideInMenu: true, }, { name: 'CAD实例', path: '/cad', component: './Cad', icon: 'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/doc/contract/2023-07-31/3f72fccf-4f9c-4891-a6ec-f04fe4b1d9a2.png', }, { name: 'CAD详情', path: '/cad/detail', component: './Cad/detail', hideInMenu: true, }, { name: 'Scada功能', path: '/scada', component: './Scada', icon: 'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/doc/contract/2023-11-24/27866151-5691-487d-8c58-5b4ae995395e.png', }, ], npmClient: 'yarn', });