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": {
"dev": "vue-cli-service serve",
"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": {
"hooks": {
@@ -90,7 +92,8 @@
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"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": {
"node": ">=8.9",

View File

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

View File

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