优化代码

This commit is contained in:
2025-12-24 10:08:38 +08:00
parent 03176aabdc
commit 18793b3e6d
143 changed files with 17043 additions and 10119 deletions

View File

@@ -4,7 +4,7 @@ require('./check-versions')()
process.env.NODE_ENV = 'production'
const ora = require('ora')
const rm = require('rimraf')
const fs = require('fs')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
@@ -14,7 +14,7 @@ const webpackConfig = require('./webpack.prod.conf')
const spinner = ora('building for production...')
spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
fs.rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), { recursive: true, force: true }, err => {
if (err) throw err
webpack(webpackConfig, (err, stats) => {
spinner.stop()

View File

@@ -33,15 +33,21 @@ const webpackConfig = merge(baseWebpackConfig, {
new webpack.DefinePlugin({
'process.env': env
}),
new UglifyJsPlugin({
uglifyOptions: {
compress: {
warnings: false
}
},
sourceMap: config.build.productionSourceMap,
parallel: true
}),
// new UglifyJsPlugin({
// uglifyOptions: {
// compress: {
// warnings: false,
// drop_console: true,
// pure_funcs: ['console.log']
// },
// mangle: false,
// output: {
// beautify: true
// }
// },
// sourceMap: config.build.productionSourceMap,
// parallel: true
// }),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].css?v=' + version), // css/[name].[contenthash].css

View File

@@ -38,7 +38,7 @@ module.exports = {
// Use Eslint Loader?
// If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console.
useEslint: true,
useEslint: false,
// If true, eslint errors and warnings will also be shown in the error overlay
// in the browser.
showEslintErrorsInOverlay: false,

File diff suppressed because it is too large Load Diff

View File

@@ -43,13 +43,13 @@
"babel-preset-stage-2": "^6.22.0",
"chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^3.2.0",
"css-loader": "^1.0.1",
"echarts": "^4.3.0",
"eslint": "^4.19.1",
"eslint-config-standard": "^10.2.1",
"eslint-friendly-formatter": "^4.0.1",
"eslint-loader": "^2.0.0",
"eslint-plugin-html": "^4.0.3",
"eslint-config-standard": "^10.2.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.2.0",
"eslint-plugin-promise": "^3.4.0",
@@ -61,7 +61,6 @@
"html-webpack-plugin": "^2.30.1",
"moment": "^2.24.0",
"node-notifier": "^5.1.2",
"node-sass": "^4.12.0",
"nprogress": "^0.2.0",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
@@ -69,14 +68,15 @@
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"rimraf": "^5.0.0",
"sass": "^1.62.0",
"sass-loader": "^7.1.0",
"sass-resources-loader": "^2.0.1",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^2.2.0",
"uuid": "^3.3.2",
"uuid": "^9.0.0",
"vue-echarts": "^4.0.4",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
@@ -96,5 +96,8 @@
"> 1%",
"last 2 versions",
"not ie <= 8"
]
],
"optionalDependencies": {
"fsevents": "^2.3.3"
}
}

View File

@@ -4,7 +4,7 @@ import axios from 'axios'
import router from '../router'
// api 模块化
import apis from './modules'
let developmentURL = `https://https://stms.lyraiov.com`
let developmentURL = `https://stms.lyraiov.com`
axios.defaults.timeout = 300000
axios.defaults.baseURL = process.env.NODE_ENV === 'development' ? developmentURL : getProCurrentHref()
// axios.defaults.baseURL = process.env.NODE_ENV === 'development' ? '/userApi/' : getProCurrentHref()

View File

@@ -4,7 +4,7 @@
<div class="lb-left">
<div class="logo">
<!-- <el-image class="logo-img" :src="routesItem.logo" fit="cover" @click="$router.push('/')" ></el-image> -->
<div @click="$router.push('/')" class="flex-center logo-img c-base">
<div @click="$router.push('/')" class="flex-center logo-img c-base bg-white">
<img class="flex-center logo-img c-base" :src="banner" />
</div>
</div>
@@ -41,7 +41,7 @@ export default {
return {
isIndex: true,
title: '',
banner: require('@/./style/image/zhnc.png'),
banner: require('@/./style/image/zhnc1.png'),
icon: 'el-icon-s-open',
notice_list: { data: [] },
visible: false,
@@ -111,6 +111,9 @@ export default {
</script>
<style lang="scss" scoped>
.bg-white{
background-color: white;
}
.lb-header {
width: 100%;
height: 70px;
@@ -141,7 +144,7 @@ export default {
height: 45px;
margin-bottom: 0;
border-radius: 50%;
cursor: pointer;
cursor: pointer;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

View File

@@ -434,7 +434,7 @@
</template>
<script>
import Uuid from 'uuid'
import { v4 as Uuid } from 'uuid'
export default {
data () {
let checkAddress = (rule, value, callback) => {

View File

@@ -475,7 +475,7 @@
</template>
<script>
import Uuid from 'uuid'
import { v4 as Uuid } from 'uuid'
export default {
data () {
let checkAddress = (rule, value, callback) => {

View File

@@ -161,7 +161,7 @@
</template>
<script>
import Uuid from 'uuid'
import { v4 as Uuid } from 'uuid'
export default {
data () {
return {

View File

@@ -337,7 +337,7 @@
</template>
<script>
import Uuid from 'uuid'
import { v4 as Uuid } from 'uuid'
export default {
data () {
let checkType = (rule, value, callback) => {

View File

@@ -482,7 +482,7 @@
</template>
<script>
import Uuid from 'uuid'
import { v4 as Uuid } from 'uuid'
import { mapGetters } from 'vuex'
export default {
data () {

View File

@@ -213,7 +213,7 @@
</template>
<script>
import Uuid from 'uuid'
import { v4 as Uuid } from 'uuid'
import { provinceAndCityData } from 'element-china-area-data'
export default {
data () {