提交 acb2a663 authored 作者: kxjia's avatar kxjia

完善非现场报送

上级 6f7a94e5
...@@ -113,6 +113,14 @@ export const columns: BasicColumn[] = [ ...@@ -113,6 +113,14 @@ export const columns: BasicColumn[] = [
{ {
title: '填报数', title: '填报数',
align: 'left', align: 'left',
dataIndex: 'fillNum',
ifShow: true,
width: "6%",
resizable:true
},
{
title: '提交数',
align: 'left',
dataIndex: 'fillStaNum', dataIndex: 'fillStaNum',
ifShow: true, ifShow: true,
width: "6%", width: "6%",
......
...@@ -24,7 +24,6 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { ...@@ -24,7 +24,6 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
const env = loadEnv(mode, root); const env = loadEnv(mode, root);
// The boolean type read by loadEnv is a string. This function can be converted to boolean type
const viteEnv = wrapperEnv(env); const viteEnv = wrapperEnv(env);
const { VITE_PORT, VITE_PUBLIC_PATH, VITE_PROXY } = viteEnv; const { VITE_PORT, VITE_PUBLIC_PATH, VITE_PROXY } = viteEnv;
...@@ -33,14 +32,12 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { ...@@ -33,14 +32,12 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
const serverOptions: Recordable = {} const serverOptions: Recordable = {}
// ----- [begin] 【JEECG作为乾坤子应用】 -----
const {VITE_GLOB_QIANKUN_MICRO_APP_NAME, VITE_GLOB_QIANKUN_MICRO_APP_ENTRY} = viteEnv; const {VITE_GLOB_QIANKUN_MICRO_APP_NAME, VITE_GLOB_QIANKUN_MICRO_APP_ENTRY} = viteEnv;
const isQiankunMicro = VITE_GLOB_QIANKUN_MICRO_APP_NAME != null && VITE_GLOB_QIANKUN_MICRO_APP_NAME !== ''; const isQiankunMicro = VITE_GLOB_QIANKUN_MICRO_APP_NAME != null && VITE_GLOB_QIANKUN_MICRO_APP_NAME !== '';
if (isQiankunMicro && !isBuild) { if (isQiankunMicro && !isBuild) {
serverOptions.cors = true; serverOptions.cors = true;
serverOptions.origin = VITE_GLOB_QIANKUN_MICRO_APP_ENTRY!.split('/').slice(0, 3).join('/'); serverOptions.origin = VITE_GLOB_QIANKUN_MICRO_APP_ENTRY!.split('/').slice(0, 3).join('/');
} }
// ----- [end] 【JEECG作为乾坤子应用】 -----
console.log('[init] Start Port: ', VITE_PORT); console.log('[init] Start Port: ', VITE_PORT);
console.debug('[init] Vite Proxy Config: ', VITE_PROXY); console.debug('[init] Vite Proxy Config: ', VITE_PROXY);
...@@ -55,17 +52,14 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { ...@@ -55,17 +52,14 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
find: 'vue-i18n', find: 'vue-i18n',
replacement: 'vue-i18n/dist/vue-i18n.cjs.js', replacement: 'vue-i18n/dist/vue-i18n.cjs.js',
}, },
// 添加 Vue 别名,确保使用正确的版本
{ {
find: 'vue', find: 'vue',
replacement: 'vue/dist/vue.esm-bundler.js', replacement: 'vue/dist/vue.esm-bundler.js',
}, },
// /@/xxxx => src/xxxx
{ {
find: /\/@\//, find: /\/@\//,
replacement: pathResolve('src') + '/', replacement: pathResolve('src') + '/',
}, },
// /#/xxxx => types/xxxx
{ {
find: /\/#\//, find: /\/#\//,
replacement: pathResolve('types') + '/', replacement: pathResolve('types') + '/',
...@@ -74,7 +68,6 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { ...@@ -74,7 +68,6 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
find: /@\//, find: /@\//,
replacement: pathResolve('src') + '/', replacement: pathResolve('src') + '/',
}, },
// /#/xxxx => types/xxxx
{ {
find: /#\//, find: /#\//,
replacement: pathResolve('types') + '/', replacement: pathResolve('types') + '/',
...@@ -82,20 +75,14 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { ...@@ -82,20 +75,14 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
], ],
}, },
server: { server: {
// Listening on all local IPs
host: true, host: true,
// @ts-ignore
https: false, https: false,
port: VITE_PORT, port: VITE_PORT,
// Load proxy configuration from .env
proxy: createProxy(VITE_PROXY), proxy: createProxy(VITE_PROXY),
// 合并 server 配置
...serverOptions, ...serverOptions,
// 预热常用文件,提高首次加载速度
warmup: { warmup: {
clientFiles: ['./index.html', './src/main.ts', './src/App.vue'], clientFiles: ['./index.html', './src/main.ts', './src/App.vue'],
}, },
// 启用更快的源文件变更检测
fs: { fs: {
strict: false, strict: false,
}, },
...@@ -106,16 +93,12 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { ...@@ -106,16 +93,12 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
cssTarget: 'chrome80', cssTarget: 'chrome80',
outDir: OUTPUT_DIR, outDir: OUTPUT_DIR,
rollupOptions: { rollupOptions: {
// 关闭除屑优化,防止删除重要代码,导致打包后功能出现异常
treeshake: false, treeshake: false,
output: { output: {
// 提供命名导出,解决默认导出问题
exports: 'named', exports: 'named',
chunkFileNames: 'js/[name]-[hash].js', // 引入文件名的名称 chunkFileNames: 'js/[name]-[hash].js',
entryFileNames: 'js/[name]-[hash].js', // 包的入口文件名称 entryFileNames: 'js/[name]-[hash].js',
// manualChunks配置 (依赖包从大到小排列)
manualChunks: { manualChunks: {
// vue vue-router合并打包
'vue-vendor': ['vue', 'vue-router'], 'vue-vendor': ['vue', 'vue-router'],
'antd-vue-vendor': ['ant-design-vue','@ant-design/icons-vue','@ant-design/colors'], 'antd-vue-vendor': ['ant-design-vue','@ant-design/icons-vue','@ant-design/colors'],
'vxe-table-vendor': ['vxe-table','vxe-table-plugin-antd','xe-utils'], 'vxe-table-vendor': ['vxe-table','vxe-table-plugin-antd','xe-utils'],
...@@ -124,27 +107,19 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { ...@@ -124,27 +107,19 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
}, },
}, },
}, },
// 关闭brotliSize显示可以稍微减少打包时间
reportCompressedSize: false, reportCompressedSize: false,
// 提高超大静态资源警告大小
chunkSizeWarningLimit: 2000, chunkSizeWarningLimit: 2000,
// 添加 CommonJS 配置
commonjsOptions: { commonjsOptions: {
transformMixedEsModules: true, transformMixedEsModules: true,
include: [/node_modules/], include: [/node_modules/],
// 特别处理 form-create 的依赖
requireReturnsDefault: 'auto', requireReturnsDefault: 'auto',
// 忽略导入检查
ignoreTryCatch: false, ignoreTryCatch: false,
}, },
}, },
esbuild: { esbuild: {
//清除全局的console.log和debug
drop: isBuild ? ['console', 'debugger'] : [], drop: isBuild ? ['console', 'debugger'] : [],
}, },
define: { define: {
// setting vue-i18-next
// Suppress warning
__INTLIFY_PROD_DEVTOOLS__: false, __INTLIFY_PROD_DEVTOOLS__: false,
__APP_INFO__: JSON.stringify(__APP_INFO__), __APP_INFO__: JSON.stringify(__APP_INFO__),
}, },
...@@ -156,27 +131,20 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { ...@@ -156,27 +131,20 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
}, },
}, },
}, },
// The vite plugin used by the project. The quantity is large, so it is separately extracted and managed
// 预加载构建配置(首屏性能)
plugins: createVitePlugins(viteEnv, isBuild, isQiankunMicro), plugins: createVitePlugins(viteEnv, isBuild, isQiankunMicro),
optimizeDeps: { optimizeDeps: {
esbuildOptions: { esbuildOptions: {
target: 'es2020', target: 'es2020',
// 为 ES 模块添加支持
supported: { supported: {
'dynamic-import': true, 'dynamic-import': true,
'import-meta': true, 'import-meta': true,
}, },
}, },
// 强制重新预构建,确保缓存是最新的 force: false,
force: false, // 设置为 false,避免每次都重新预构建
exclude: [ exclude: [
//升级vite4后,需要排除online依赖
'@jeecg/online', '@jeecg/online',
'@jeecg/aiflow', '@jeecg/aiflow',
], ],
// 只包含最核心的依赖,让 Vite 自动处理其他依赖
include: [ include: [
'vue', 'vue',
'vue-router', 'vue-router',
...@@ -184,5 +152,6 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { ...@@ -184,5 +152,6 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
'ant-design-vue', 'ant-design-vue',
] ]
}, },
cacheDir: '.vite',
}; };
}; };
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论