From 1d863cbf49164a6d062c9b1ce21d6edeaea9a784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Tue, 26 Oct 2021 07:28:14 +0800 Subject: [PATCH] webpack5 --- build/webpack.base.conf.js | 42 +-- config/index.js | 16 +- index.html | 3 +- package.json | 6 +- src/components/Tinymce/Index.vue | 71 ++--- src/components/VueEditor/Index.vue | 300 ------------------ src/components/editor/ImgEditor.vue | 124 -------- .../re/procdefParames/ProcdefParamesSet.vue | 2 +- .../ProcinstParamesStartSet.vue | 290 ++++++++--------- src/views/xm/core/components/headEditor.vue | 4 +- .../xm/core/xmExchange/TaskUserEditor.vue | 12 +- src/views/xm/core/xmFile/XmFileAdd.vue | 44 +-- src/views/xm/core/xmFile/XmFileEdit.vue | 48 +-- .../xm/core/xmMenuExchange/MenuUserEditor.vue | 10 +- .../xm/core/xmProject/XmProjectAssess.vue | 28 +- .../xm/core/xmQuestion/XmQuestionAdd.vue | 154 ++++----- .../xm/core/xmQuestion/XmQuestionEdit.vue | 222 ++++++------- .../xm/core/xmTestCase/XmTestCaseAdd.vue | 68 ++-- .../xm/core/xmTestCase/XmTestCaseEdit.vue | 64 ++-- 19 files changed, 540 insertions(+), 968 deletions(-) delete mode 100644 src/components/VueEditor/Index.vue delete mode 100644 src/components/editor/ImgEditor.vue diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js index fc983d2c..4affc711 100644 --- a/build/webpack.base.conf.js +++ b/build/webpack.base.conf.js @@ -54,7 +54,7 @@ var threadLoaderConfig={ // 可以修改名称来创建其余选项都一样的池(pool) name: "my-pool" } -} +} const publicCssLoaders=process.env.NODE_ENV === 'production'?[{loader:MiniCssExtractPlugin.loader,options:{publicPath:'../'}},'css-loader']:[ 'style-loader','css-loader'] function resolve(dir) { @@ -79,7 +79,7 @@ module.exports = { }, output: { clean:true, - path: config.build.assetsRoot, + path: config.build.assetsRoot, filename: 'js/[name].[contenthash].js', pathinfo: false, publicPath: process.env.NODE_ENV === 'production' @@ -96,16 +96,16 @@ module.exports = { // 加载器 module: { // https://doc.webpack-china.org/guides/migrating/#module-loaders-module-rules - rules: [ + rules: [ //...(config.dev.useEslint ? [createLintingRule()] : []), { test: /\.vue$/, - include: resolve('src'), + //include: resolve('src'), use:[ threadLoaderConfig, { loader: 'vue-loader', - /** + /** options:vueLoaderConfig, */ options: { @@ -115,30 +115,30 @@ module.exports = { { loader: 'cache-loader' }, { loader: 'babel-loader', options: { presets: ['env'] } } ] - }, + }, extractCSS: true, - hotReload:true, - - }, + hotReload:true, + + }, } ] - - - }, + + + }, { test: /\.css$/, use: publicCssLoaders, - }, + }, { test: /\.(sa|sc)ss$/, - use: publicCssLoaders.concat([ + use: publicCssLoaders.concat([ // 将 Sass 编译成 CSS 'sass-loader', ]), - }, + }, { test: /\.less$/, - use: publicCssLoaders.concat([ + use: publicCssLoaders.concat([ // 将 Sass 编译成 CSS 'less-loader', ]), @@ -149,7 +149,7 @@ module.exports = { // 将 Sass 编译成 CSS 'stylus-loader', ]), - }, + }, { // 配置Babel将ES6+ 转换为ES5 test: /\.js$/, use:[ @@ -159,10 +159,10 @@ module.exports = { options: { presets: ['env'], plugins: ['transform-runtime'] - }, + }, }, ], - include: resolve('src'), + include: resolve('src'), }, { test: /\.svg$/, @@ -181,7 +181,7 @@ module.exports = { } }, { - test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, type: 'asset/resource', generator: { filename: 'media/[hash][ext][query]' @@ -196,7 +196,7 @@ module.exports = { } ] - }, + }, plugins: [ new VueLoaderPlugin(), ], diff --git a/config/index.js b/config/index.js index f3965d23..3dfdb22d 100644 --- a/config/index.js +++ b/config/index.js @@ -10,23 +10,23 @@ module.exports = { // Paths assetsSubDirectory: 'static', assetsPublicPath: '/', - proxyTable: { - + proxyTable: { + /** '/api/m1/xm': { target: 'http://localhost:7067', changeOrigin: true, pathRewrite: { '^/api/m1/xm': '/xm' } - }, - /** + }, + '/api/m1/workflow': { target: 'http://localhost:7080', changeOrigin: true, pathRewrite: { '^/api/m1/workflow': '/workflow' } - }, + }, **/ '/api': { target: 'https://www.qingqinkj.com', @@ -58,7 +58,7 @@ module.exports = { */ // https://webpack.js.org/configuration/devtool/#development - devtool: '#cheap-source-map', + devtool: 'eval', // If you have problems debugging vue-files in devtools, // set this to false - it *may* help @@ -90,7 +90,7 @@ module.exports = { productionSourceMap: false, // https://webpack.js.org/configuration/devtool/#production - devtool: '#source-map', + devtool: false, // Gzip off by default as many popular static hosts such as // Surge or Netlify already gzip all static assets for you. @@ -105,4 +105,4 @@ module.exports = { // Set to `true` or `false` to always turn it on or off bundleAnalyzerReport: process.env.npm_config_report } -} \ No newline at end of file +} diff --git a/index.html b/index.html index 030c6df6..43bde0a0 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,8 @@ 项目管理系统 -
+ +
diff --git a/package.json b/package.json index 6156f510..fad14505 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@jiaminghi/data-view": "^2.10.0", "axios": "0.17.1", "clipboard": "1.7.1", - "vue-clipboard2": "^0.3.3", + "vue-clipboard2": "^0.3.1", "codemirror": "5.32.0", "dayjs": "^1.8.29", "decimal.js": "^10.2.0", @@ -42,8 +42,7 @@ "showdown": "1.8.5", "simplemde": "1.11.2", "sortablejs": "1.7.0", - "vue": "2.6.10", - "vue-clipboard2": "^0.3.1", + "vue": "2.6.14", "vue-contextmenujs": "^1.3.10", "vue-count-to": "1.0.13", "vue-cropper": "^0.2.9", @@ -87,7 +86,6 @@ "file-loader": "^6.2.0", "friendly-errors-plugin": "^1.1.2", "friendly-errors-webpack-plugin": "^1.7.0", - "happypack": "^4.0.0", "html-webpack-plugin": "^5.4.0", "less": "^4.1.2", "less-loader": "^10.2.0", diff --git a/src/components/Tinymce/Index.vue b/src/components/Tinymce/Index.vue index 00cd1be4..225b6228 100644 --- a/src/components/Tinymce/Index.vue +++ b/src/components/Tinymce/Index.vue @@ -1,25 +1,22 @@