GP12报表分页优化

This commit is contained in:
2025-03-10 18:24:53 +08:00
parent 5717388e68
commit 81df92861e
3 changed files with 131 additions and 123 deletions

View File

@@ -5,7 +5,9 @@
"scripts": { "scripts": {
"dev": "vue-cli-service serve", "dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build", "build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging" "build:stage": "vue-cli-service build --mode staging",
"generateAnalyzFile": "webpack --profile --json stats.json",
"analyz": "webpack-bundle-analyzer --port 8888./dist/stats.json"
}, },
"husky": { "husky": {
"hooks": { "hooks": {
@@ -90,7 +92,8 @@
"stylus": "^0.54.5", "stylus": "^0.54.5",
"stylus-loader": "^3.0.2", "stylus-loader": "^3.0.2",
"svg-sprite-loader": "4.1.3", "svg-sprite-loader": "4.1.3",
"vue-template-compiler": "2.6.12" "vue-template-compiler": "2.6.12",
"webpack-bundle-analyzer": "^4.10.2"
}, },
"engines": { "engines": {
"node": ">=8.9", "node": ">=8.9",

View File

@@ -291,8 +291,8 @@ export default {
GetReviseList(this.queryParams).then(res => { GetReviseList(this.queryParams).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.allDataList = res.data.list; //this.allDataList = res.data.list;
this.dataList = Object.freeze(res.data.pageList.map(item => Object.freeze(item))) this.dataList = res.data.pageList;
this.total = res.data.total; this.total = res.data.total;
this.statistics = res.data.statistics; this.statistics = res.data.statistics;
this.mergeTable(3); this.mergeTable(3);

View File

@@ -7,7 +7,7 @@ function resolve(dir) {
} }
const name = defaultSettings.title // 标题 const name = defaultSettings.title // 标题
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
// 这里只列一部分,具体配置参考文档 // 这里只列一部分,具体配置参考文档
module.exports = { module.exports = {
@@ -37,7 +37,6 @@ module.exports = {
port: 8887, // 项目启动port, port: 8887, // 项目启动port,
open: true, open: true,
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: 'http://localhost:8888', // 后端接口地址 target: 'http://localhost:8888', // 后端接口地址
@@ -57,7 +56,6 @@ module.exports = {
['^/msgHub']: '', //需要rewrite的 ['^/msgHub']: '', //需要rewrite的
}, },
}, },
}, },
disableHostCheck: true, disableHostCheck: true,
}, },
@@ -69,12 +67,18 @@ module.exports = {
'@': resolve('src'), '@': resolve('src'),
}, },
}, },
plugins: [], plugins: [
new BundleAnalyzerPlugin({
analyzerMode: 'disabled', // 默认不自动启动
generateStatsFile: true, // 生成stats.json文件
statsFilename: 'stats.json',
}),
],
}, },
chainWebpack(config) { chainWebpack(config) {
config.plugins.delete('preload') // TODO: need test config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test config.plugins.delete('prefetch') // TODO: need test
//config.plugin('analyzer').use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
// set svg-sprite-loader // set svg-sprite-loader
config.module.rule('svg').exclude.add(resolve('src/assets/icons')).end() config.module.rule('svg').exclude.add(resolve('src/assets/icons')).end()
config.module config.module
@@ -97,7 +101,8 @@ module.exports = {
{ {
// `runtime` must same as runtimeChunk name. default is `runtime` // `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/, inline: /runtime\..*\.js$/,
}, ]) },
])
.end() .end()
config.optimization.splitChunks({ config.optimization.splitChunks({
chunks: 'all', chunks: 'all',