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

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, node: true,
browser: true, browser: true,
}, },
extends: ["plugin:vue/essential", "@vue/standard"], extends: ["plugin:vue/essential", "eslint:recommended"],
parserOptions: { parserOptions: {
parser: "babel-eslint", parser: "babel-eslint",
}, },
@ -35,6 +35,10 @@ module.exports = {
"arrow-spacing": "warn", "arrow-spacing": "warn",
semi: ["warn", "never"], semi: ["warn", "never"],
"no-multi-spaces": "warn", "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: { globals: {
// Define global variables to prevent 'undefined' errors // Define global variables to prevent 'undefined' errors

View File

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