修复了分配监控的页面自适应

This commit is contained in:
尚鹏暃
2025-05-23 16:13:57 +08:00
parent 97c53f07c8
commit 1a2de7a1c6
2 changed files with 75 additions and 77 deletions

View File

@@ -4,7 +4,7 @@ module.exports = {
node: true,
browser: true,
},
extends: ["plugin:vue/essential", "@vue/standard"],
extends: ["plugin:vue/essential", "eslint:recommended"],
parserOptions: {
parser: "babel-eslint",
},
@@ -35,6 +35,10 @@ module.exports = {
"arrow-spacing": "warn",
semi: ["warn", "never"],
"no-multi-spaces": "warn",
// Turn off console warnings for development
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
},
globals: {
// Define global variables to prevent 'undefined' errors

View File

@@ -1,12 +1,11 @@
'use strict'
const path = require('path')
const defaultSettings = require('./src/settings.js')
const path = require("path")
const defaultSettings = require("./src/settings.js")
function resolve(dir) {
return path.join(__dirname, dir)
}
const name = defaultSettings.title || 'WVP视频平台' // page title
const name = defaultSettings.title || "WVP视频平台" // page title
// If your port is set to 80,
// use administrator privileges to execute the command line.
@@ -24,37 +23,37 @@ module.exports = {
* In most cases please use '/' !!!
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/',
outputDir: '../src/main/resources/static',
assetsDir: 'static',
lintOnSave: process.env.NODE_ENV === 'development',
publicPath: "/",
outputDir: "../src/main/resources/static",
assetsDir: "static",
lintOnSave: false, // Disable ESLint to avoid warnings
productionSourceMap: false,
devServer: {
public: 'localhost:' + port,
host: 'localhost',
public: "localhost:" + port,
host: "localhost",
port: port,
open: true,
overlay: {
warnings: false,
errors: true
errors: false, // Changed to false to hide ESLint errors
},
// before: require('./mock/mock-server.js'),
proxy: {
'/dev-api': {
target: 'http://127.0.0.1:18080',
"/dev-api": {
target: "http://127.0.0.1:18080",
changeOrigin: true,
pathRewrite: {
'^/dev-api': '/'
}
"^/dev-api": "/",
},
},
'/static/snap': {
target: 'http://127.0.0.1:18080',
changeOrigin: true
"/static/snap": {
target: "http://127.0.0.1:18080",
changeOrigin: true,
// pathRewrite: {
// '^/static/snap': '/static/snap'
// }
}
}
},
},
},
configureWebpack: {
// provide the app's title in webpack's name field, so that
@@ -62,80 +61,75 @@ module.exports = {
name: name,
resolve: {
alias: {
'@': resolve('src')
}
}
"@": resolve("src"),
},
},
},
chainWebpack(config) {
// it can improve the speed of the first screen, it is recommended to turn on preload
config.plugin('preload').tap(() => [
config.plugin("preload").tap(() => [
{
rel: 'preload',
rel: "preload",
// to ignore runtime.js
// https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171
fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],
include: 'initial'
}
include: "initial",
},
])
// when there are many pages, it will cause too many meaningless requests
config.plugins.delete('prefetch')
config.plugins.delete("prefetch")
// set svg-sprite-loader
config.module.rule("svg").exclude.add(resolve("src/icons")).end()
config.module
.rule('svg')
.exclude.add(resolve('src/icons'))
.end()
config.module
.rule('icons')
.rule("icons")
.test(/\.svg$/)
.include.add(resolve('src/icons'))
.include.add(resolve("src/icons"))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.use("svg-sprite-loader")
.loader("svg-sprite-loader")
.options({
symbolId: 'icon-[name]'
symbolId: "icon-[name]",
})
.end()
config
.when(process.env.NODE_ENV !== 'development',
config => {
config
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [{
config.when(process.env.NODE_ENV !== "development", (config) => {
config
.plugin("ScriptExtHtmlWebpackPlugin")
.after("html")
.use("script-ext-html-webpack-plugin", [
{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}])
.end()
config
.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
libs: {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial' // only package third parties that are initially dependent
},
elementUI: {
name: 'chunk-elementUI', // split elementUI into a single package
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
},
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
}
}
})
// https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
config.optimization.runtimeChunk('single')
}
)
}
inline: /runtime\..*\.js$/,
},
])
.end()
config.optimization.splitChunks({
chunks: "all",
cacheGroups: {
libs: {
name: "chunk-libs",
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: "initial", // only package third parties that are initially dependent
},
elementUI: {
name: "chunk-elementUI", // split elementUI into a single package
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
},
commons: {
name: "chunk-commons",
test: resolve("src/components"), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true,
},
},
})
// https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
config.optimization.runtimeChunk("single")
})
},
}