vue2-client 1.14.62 → 1.14.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.message +19 -19
- package/package.json +109 -109
- package/src/base-client/components/common/AmapMarker/index.js +3 -3
- package/src/base-client/components/common/XDetailsView/index.js +3 -3
- package/src/base-client/components/common/XFormGroupDetails/index.js +3 -3
- package/src/base-client/components/common/XFormTable/XFormTable.vue +895 -895
- package/src/base-client/components/common/XFormTable/demo.vue +86 -86
- package/src/base-client/components/common/XTable/XTable.vue +1564 -1555
- package/src/base-client/components/his/threeTestOrders/textBox.vue +463 -463
- package/src/pages/WorkflowDetail/WorkFlowDemo.vue +36 -79
- package/vue.config.js +220 -220
|
@@ -1,90 +1,47 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-card :bordered="false">
|
|
3
|
-
<x-form-table
|
|
4
|
-
title="示例页面"
|
|
5
|
-
:queryParamsName="queryParamsName"
|
|
6
|
-
:fixed-query-form="{
|
|
7
|
-
users_f_handler_id: currUser.id,
|
|
8
|
-
}"
|
|
9
|
-
@action="toDetail">
|
|
10
|
-
<template slot="button">
|
|
11
|
-
<a-button @click="add">
|
|
12
|
-
<a-icon type="plus"/>
|
|
13
|
-
发起报建
|
|
14
|
-
</a-button>
|
|
15
|
-
</template>
|
|
16
|
-
</x-form-table>
|
|
17
|
-
<a-modal
|
|
18
|
-
v-model="applyAddFlag"
|
|
19
|
-
:footer="null"
|
|
20
|
-
:dialog-style="{ top: '5rem' }"
|
|
21
|
-
:z-index="1001"
|
|
22
|
-
title="发起报建"
|
|
23
|
-
:destroyOnClose="true">
|
|
24
|
-
<x-add-native-form ref="xForm" @onSubmit="applySubmit"/>
|
|
25
|
-
</a-modal>
|
|
26
|
-
<WorkflowDetail ref="workFlow" @success="success"></WorkflowDetail>
|
|
27
|
-
</a-card>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
1
|
<script>
|
|
31
2
|
import WorkflowDetail from '@vue2-client/pages/WorkflowDetail/WorkflowDetail.vue'
|
|
32
|
-
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
|
|
33
|
-
import XAddNativeForm from '@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'
|
|
34
|
-
import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
|
|
35
|
-
import { mapState } from 'vuex'
|
|
36
3
|
|
|
37
4
|
export default {
|
|
38
|
-
name: '
|
|
39
|
-
components: {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
data () {
|
|
45
|
-
return {
|
|
46
|
-
// 查询配置文件名
|
|
47
|
-
queryParamsName: 'applyCRUD',
|
|
48
|
-
// 发起报建弹框控制
|
|
49
|
-
applyAddFlag: false
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
computed: {
|
|
53
|
-
...mapState('account', { currUser: 'user' }),
|
|
5
|
+
name: 'WorkFlowDemo',
|
|
6
|
+
components: { WorkflowDetail },
|
|
7
|
+
mounted () {
|
|
8
|
+
this.$refs.workFlow.init({
|
|
9
|
+
workflowId: '11'
|
|
10
|
+
})
|
|
54
11
|
},
|
|
55
12
|
methods: {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
...res
|
|
65
|
-
})
|
|
66
|
-
})
|
|
67
|
-
}
|
|
68
|
-
)
|
|
69
|
-
},
|
|
70
|
-
applySubmit (formData) {
|
|
71
|
-
runLogic('addApply', formData).then(
|
|
72
|
-
res => {
|
|
73
|
-
this.$message.success('发起报建成功')
|
|
74
|
-
this.applyAddFlag = false
|
|
75
|
-
}
|
|
76
|
-
).catch(() => {
|
|
77
|
-
this.applyAddFlag = false
|
|
78
|
-
})
|
|
13
|
+
/**
|
|
14
|
+
* 流程详情页成功
|
|
15
|
+
* @param note 备注信息
|
|
16
|
+
* @param form 表单信息
|
|
17
|
+
* @param workflowId
|
|
18
|
+
*/
|
|
19
|
+
success ({ note, form, workflowId }) {
|
|
20
|
+
console.log('success', note, form, workflowId)
|
|
79
21
|
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
22
|
+
/**
|
|
23
|
+
* 流程详情页成功
|
|
24
|
+
* @param note 备注信息
|
|
25
|
+
* @param form 表单信息
|
|
26
|
+
* @param workflowId 工作流id
|
|
27
|
+
* @param fromStepId 起ID
|
|
28
|
+
* @param toStepId 往ID
|
|
29
|
+
* @param successStepId 完成步骤id
|
|
30
|
+
* @param successStep 完成步骤名称
|
|
31
|
+
* @param fromStep 起步骤名称
|
|
32
|
+
* @param toStep 往步骤名称
|
|
33
|
+
*/
|
|
34
|
+
nextClick ({ note, form, workflowId, fromStepId, toStepId, fromStep, toStep, successStepId, successStep }) {
|
|
35
|
+
console.log('success', note, form, workflowId, fromStepId, toStepId, fromStep, toStep, successStepId, successStep)
|
|
87
36
|
}
|
|
88
37
|
}
|
|
89
38
|
}
|
|
90
39
|
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<WorkflowDetail ref="workFlow" @success="success" @nextClick="nextClick"></WorkflowDetail>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<style scoped lang="less">
|
|
46
|
+
|
|
47
|
+
</style>
|
package/vue.config.js
CHANGED
|
@@ -1,220 +1,220 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const webpack = require('webpack')
|
|
3
|
-
const ThemeColorReplacer = require('webpack-theme-color-replacer')
|
|
4
|
-
const { getThemeColors, modifyVars } = require('./src/utils/themeUtil')
|
|
5
|
-
const { resolveCss } = require('./src/utils/theme-color-replacer-extend')
|
|
6
|
-
const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
|
7
|
-
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
|
|
8
|
-
// const CopyPlugin = require('copy-webpack-plugin')
|
|
9
|
-
|
|
10
|
-
const productionGzipExtensions = ['js', 'css']
|
|
11
|
-
const isProd = process.env.NODE_ENV === 'production'
|
|
12
|
-
|
|
13
|
-
// v4 产品演示
|
|
14
|
-
const v3Server = 'http://
|
|
15
|
-
// const gateway = 'http://192.168.50.67:31467'
|
|
16
|
-
// const testUpload = 'http://123.60.214.109:8406'
|
|
17
|
-
const OSSServerDev = 'http://192.168.50.67:30351'
|
|
18
|
-
// const revenue = 'http://aote-office.8866.org:31567'
|
|
19
|
-
const revenue = 'http://
|
|
20
|
-
// const OSSServerProd = 'http://192.168.50.67:31351'
|
|
21
|
-
// const testUploadLocal = 'http://127.0.0.1:9001'
|
|
22
|
-
// v3 铜川
|
|
23
|
-
// const v3Server = 'http://61.134.55.234:8405'
|
|
24
|
-
// const gateway = 'http://61.134.55.234:8456/webmeter'
|
|
25
|
-
// v3 涉县
|
|
26
|
-
// const v3Server = 'http://221.193.244.147:9600'
|
|
27
|
-
// const gateway = 'http://221.193.244.147:9600/webmeter'
|
|
28
|
-
// 本地
|
|
29
|
-
// const local = 'http://localhost:8080'
|
|
30
|
-
|
|
31
|
-
module.exports = {
|
|
32
|
-
devServer: {
|
|
33
|
-
// development server port 8000
|
|
34
|
-
port: 8020,
|
|
35
|
-
// If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
|
|
36
|
-
proxy: {
|
|
37
|
-
// '/apply-image': {
|
|
38
|
-
// target: revenue,
|
|
39
|
-
// },
|
|
40
|
-
'/rs': {
|
|
41
|
-
target: v3Server,
|
|
42
|
-
ws: false,
|
|
43
|
-
changeOrigin: true
|
|
44
|
-
},
|
|
45
|
-
// '/api/af-system/resource': {
|
|
46
|
-
// pathRewrite: { '^/api/af-system': '/' },
|
|
47
|
-
// target: testUpload,
|
|
48
|
-
// changeOrigin: true
|
|
49
|
-
// },
|
|
50
|
-
'/api/af-revenue/logic/openapi/': {
|
|
51
|
-
// pathRewrite: { '^/api/af-revenue/logic/openapi/': '/logic/' },
|
|
52
|
-
target: revenue,
|
|
53
|
-
changeOrigin: true
|
|
54
|
-
},
|
|
55
|
-
'/api/af-scada': {
|
|
56
|
-
target: revenue,
|
|
57
|
-
changeOrigin: true
|
|
58
|
-
},
|
|
59
|
-
'/api/af-runtime': {
|
|
60
|
-
pathRewrite: { '^/api/af-runtime/': '/' },
|
|
61
|
-
target: 'http://127.0.0.1:9001',
|
|
62
|
-
// target: revenue,
|
|
63
|
-
changeOrigin: true
|
|
64
|
-
},
|
|
65
|
-
'/api/af-revenue': {
|
|
66
|
-
// pathRewrite: { '^/api/af-revenue/': '/' },
|
|
67
|
-
target: revenue,
|
|
68
|
-
changeOrigin: true
|
|
69
|
-
},
|
|
70
|
-
'/api/af-liuli': {
|
|
71
|
-
// pathRewrite: { '^/api/af-liuli/': '/' },
|
|
72
|
-
// target: 'http://127.0.0.1:9014',
|
|
73
|
-
target: revenue,
|
|
74
|
-
changeOrigin: true
|
|
75
|
-
},
|
|
76
|
-
'/api/af-gaslink': {
|
|
77
|
-
// pathRewrite: { '^/api/af-gaslink/': '/' },
|
|
78
|
-
// target: 'http://127.0.0.1:9036',
|
|
79
|
-
target: revenue,
|
|
80
|
-
changeOrigin: true
|
|
81
|
-
},
|
|
82
|
-
'/api': {
|
|
83
|
-
// v3用
|
|
84
|
-
// pathRewrite: { '^/api/af-system/': '/rs/', '^/api/af-iot/': '/rs/' },
|
|
85
|
-
// pathRewrite: { '^/api/': '/' },
|
|
86
|
-
target: revenue,
|
|
87
|
-
changeOrigin: true
|
|
88
|
-
},
|
|
89
|
-
'/devApi': {
|
|
90
|
-
// v3用
|
|
91
|
-
// pathRewrite: { '^/api/af-system/': '/rs/', '^/api/af-iot/': '/rs/' },
|
|
92
|
-
// pathRewrite: { '^/api/': '/' },
|
|
93
|
-
target: revenue,
|
|
94
|
-
changeOrigin: true
|
|
95
|
-
},
|
|
96
|
-
'/resource': {
|
|
97
|
-
// pathRewrite: { '^/resource': '/' },
|
|
98
|
-
target: revenue,
|
|
99
|
-
changeOrigin: true
|
|
100
|
-
},
|
|
101
|
-
'/ai': {
|
|
102
|
-
target: 'http://192.168.50.67:31761',
|
|
103
|
-
pathRewrite: { '^/ai': '/' },
|
|
104
|
-
changeOrigin: true
|
|
105
|
-
},
|
|
106
|
-
'/oss': {
|
|
107
|
-
target: OSSServerDev,
|
|
108
|
-
pathRewrite: { '^/oss': '/' },
|
|
109
|
-
changeOrigin: true
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
client: {
|
|
113
|
-
overlay: false
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
pluginOptions: {
|
|
117
|
-
'style-resources-loader': {
|
|
118
|
-
preProcessor: 'less',
|
|
119
|
-
patterns: [path.resolve(__dirname, './src/theme/theme.less')]
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
configureWebpack: config => {
|
|
123
|
-
config.devtool = 'inline-source-map'
|
|
124
|
-
// 忽略.md文件
|
|
125
|
-
config.module.rules.push(
|
|
126
|
-
{
|
|
127
|
-
test: /\.md$/,
|
|
128
|
-
exclude: /node_modules/,
|
|
129
|
-
use: 'ignore-loader'
|
|
130
|
-
}
|
|
131
|
-
)
|
|
132
|
-
config.context = path.resolve(__dirname, './')
|
|
133
|
-
config.resolve = {
|
|
134
|
-
extensions: ['.js', '.vue', '.json'],
|
|
135
|
-
alias: {
|
|
136
|
-
'@vue2-client': path.resolve('src'),
|
|
137
|
-
'@': path.resolve('src'),
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
config.entry.app = ['core-js/stable', 'regenerator-runtime/runtime', 'whatwg-fetch', './src/main.js']
|
|
141
|
-
config.performance = {
|
|
142
|
-
hints: false
|
|
143
|
-
}
|
|
144
|
-
if (isProd) {
|
|
145
|
-
config.plugins.push(
|
|
146
|
-
new ThemeColorReplacer({
|
|
147
|
-
fileName: 'css/theme-colors-[contenthash:8].css',
|
|
148
|
-
matchColors: getThemeColors(),
|
|
149
|
-
injectCss: true,
|
|
150
|
-
resolveCss
|
|
151
|
-
})
|
|
152
|
-
)
|
|
153
|
-
}
|
|
154
|
-
// Ignore all locale files of moment.js
|
|
155
|
-
config.plugins.push(new webpack.IgnorePlugin({
|
|
156
|
-
resourceRegExp: /^\.\/locale$/,
|
|
157
|
-
contextRegExp: /moment$/
|
|
158
|
-
}))
|
|
159
|
-
|
|
160
|
-
config.plugins.push(
|
|
161
|
-
// new CopyPlugin({
|
|
162
|
-
// patterns: [{ from: 'node_modules/amis/sdk', to: 'amis/sdk' }],
|
|
163
|
-
// })
|
|
164
|
-
)
|
|
165
|
-
|
|
166
|
-
// 生产环境下将资源压缩成gzip格式
|
|
167
|
-
if (isProd) {
|
|
168
|
-
// add `CompressionWebpack` plugin to webpack plugins
|
|
169
|
-
config.plugins.push(new CompressionWebpackPlugin({
|
|
170
|
-
algorithm: 'gzip',
|
|
171
|
-
test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
|
|
172
|
-
threshold: 10240,
|
|
173
|
-
minRatio: 0.8
|
|
174
|
-
}))
|
|
175
|
-
}
|
|
176
|
-
// if prod, add externals
|
|
177
|
-
// if (isProd) {
|
|
178
|
-
// config.externals = assetsCDN.externals
|
|
179
|
-
// }
|
|
180
|
-
},
|
|
181
|
-
chainWebpack: config => {
|
|
182
|
-
// 生产环境下关闭css压缩的 colormin 项,因为此项优化与主题色替换功能冲突
|
|
183
|
-
if (isProd) {
|
|
184
|
-
config.optimization.minimizer('css').use(CssMinimizerPlugin, [{
|
|
185
|
-
minimizerOptions: {
|
|
186
|
-
preset: [
|
|
187
|
-
'default',
|
|
188
|
-
{
|
|
189
|
-
discardComments: { removeAll: true },
|
|
190
|
-
colormin: false,
|
|
191
|
-
}
|
|
192
|
-
],
|
|
193
|
-
ignoreOrder: true
|
|
194
|
-
}
|
|
195
|
-
}])
|
|
196
|
-
}
|
|
197
|
-
config.resolve.alias.set('@vue2-client', path.resolve(__dirname, 'src'))
|
|
198
|
-
},
|
|
199
|
-
css: {
|
|
200
|
-
extract: !isProd
|
|
201
|
-
? {
|
|
202
|
-
filename: 'css/[name].css',
|
|
203
|
-
chunkFilename: 'css/[name].css',
|
|
204
|
-
}
|
|
205
|
-
: true,
|
|
206
|
-
loaderOptions: {
|
|
207
|
-
less: {
|
|
208
|
-
lessOptions: {
|
|
209
|
-
modifyVars: modifyVars(),
|
|
210
|
-
javascriptEnabled: true
|
|
211
|
-
}
|
|
212
|
-
},
|
|
213
|
-
sass: {}
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
publicPath: process.env.VUE_APP_PUBLIC_PATH,
|
|
217
|
-
outputDir: 'dist',
|
|
218
|
-
assetsDir: 'static',
|
|
219
|
-
productionSourceMap: false
|
|
220
|
-
}
|
|
1
|
+
const path = require('path')
|
|
2
|
+
const webpack = require('webpack')
|
|
3
|
+
const ThemeColorReplacer = require('webpack-theme-color-replacer')
|
|
4
|
+
const { getThemeColors, modifyVars } = require('./src/utils/themeUtil')
|
|
5
|
+
const { resolveCss } = require('./src/utils/theme-color-replacer-extend')
|
|
6
|
+
const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
|
7
|
+
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
|
|
8
|
+
// const CopyPlugin = require('copy-webpack-plugin')
|
|
9
|
+
|
|
10
|
+
const productionGzipExtensions = ['js', 'css']
|
|
11
|
+
const isProd = process.env.NODE_ENV === 'production'
|
|
12
|
+
|
|
13
|
+
// v4 产品演示
|
|
14
|
+
const v3Server = 'http://aote-office.8866.org:31567'
|
|
15
|
+
// const gateway = 'http://192.168.50.67:31467'
|
|
16
|
+
// const testUpload = 'http://123.60.214.109:8406'
|
|
17
|
+
const OSSServerDev = 'http://192.168.50.67:30351'
|
|
18
|
+
// const revenue = 'http://aote-office.8866.org:31567'
|
|
19
|
+
const revenue = 'http://aote-office.8866.org:31567'
|
|
20
|
+
// const OSSServerProd = 'http://192.168.50.67:31351'
|
|
21
|
+
// const testUploadLocal = 'http://127.0.0.1:9001'
|
|
22
|
+
// v3 铜川
|
|
23
|
+
// const v3Server = 'http://61.134.55.234:8405'
|
|
24
|
+
// const gateway = 'http://61.134.55.234:8456/webmeter'
|
|
25
|
+
// v3 涉县
|
|
26
|
+
// const v3Server = 'http://221.193.244.147:9600'
|
|
27
|
+
// const gateway = 'http://221.193.244.147:9600/webmeter'
|
|
28
|
+
// 本地
|
|
29
|
+
// const local = 'http://localhost:8080'
|
|
30
|
+
|
|
31
|
+
module.exports = {
|
|
32
|
+
devServer: {
|
|
33
|
+
// development server port 8000
|
|
34
|
+
port: 8020,
|
|
35
|
+
// If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
|
|
36
|
+
proxy: {
|
|
37
|
+
// '/apply-image': {
|
|
38
|
+
// target: revenue,
|
|
39
|
+
// },
|
|
40
|
+
'/rs': {
|
|
41
|
+
target: v3Server,
|
|
42
|
+
ws: false,
|
|
43
|
+
changeOrigin: true
|
|
44
|
+
},
|
|
45
|
+
// '/api/af-system/resource': {
|
|
46
|
+
// pathRewrite: { '^/api/af-system': '/' },
|
|
47
|
+
// target: testUpload,
|
|
48
|
+
// changeOrigin: true
|
|
49
|
+
// },
|
|
50
|
+
'/api/af-revenue/logic/openapi/': {
|
|
51
|
+
// pathRewrite: { '^/api/af-revenue/logic/openapi/': '/logic/' },
|
|
52
|
+
target: revenue,
|
|
53
|
+
changeOrigin: true
|
|
54
|
+
},
|
|
55
|
+
'/api/af-scada': {
|
|
56
|
+
target: revenue,
|
|
57
|
+
changeOrigin: true
|
|
58
|
+
},
|
|
59
|
+
'/api/af-runtime': {
|
|
60
|
+
pathRewrite: { '^/api/af-runtime/': '/' },
|
|
61
|
+
target: 'http://127.0.0.1:9001',
|
|
62
|
+
// target: revenue,
|
|
63
|
+
changeOrigin: true
|
|
64
|
+
},
|
|
65
|
+
'/api/af-revenue': {
|
|
66
|
+
// pathRewrite: { '^/api/af-revenue/': '/' },
|
|
67
|
+
target: revenue,
|
|
68
|
+
changeOrigin: true
|
|
69
|
+
},
|
|
70
|
+
'/api/af-liuli': {
|
|
71
|
+
// pathRewrite: { '^/api/af-liuli/': '/' },
|
|
72
|
+
// target: 'http://127.0.0.1:9014',
|
|
73
|
+
target: revenue,
|
|
74
|
+
changeOrigin: true
|
|
75
|
+
},
|
|
76
|
+
'/api/af-gaslink': {
|
|
77
|
+
// pathRewrite: { '^/api/af-gaslink/': '/' },
|
|
78
|
+
// target: 'http://127.0.0.1:9036',
|
|
79
|
+
target: revenue,
|
|
80
|
+
changeOrigin: true
|
|
81
|
+
},
|
|
82
|
+
'/api': {
|
|
83
|
+
// v3用
|
|
84
|
+
// pathRewrite: { '^/api/af-system/': '/rs/', '^/api/af-iot/': '/rs/' },
|
|
85
|
+
// pathRewrite: { '^/api/': '/' },
|
|
86
|
+
target: revenue,
|
|
87
|
+
changeOrigin: true
|
|
88
|
+
},
|
|
89
|
+
'/devApi': {
|
|
90
|
+
// v3用
|
|
91
|
+
// pathRewrite: { '^/api/af-system/': '/rs/', '^/api/af-iot/': '/rs/' },
|
|
92
|
+
// pathRewrite: { '^/api/': '/' },
|
|
93
|
+
target: revenue,
|
|
94
|
+
changeOrigin: true
|
|
95
|
+
},
|
|
96
|
+
'/resource': {
|
|
97
|
+
// pathRewrite: { '^/resource': '/' },
|
|
98
|
+
target: revenue,
|
|
99
|
+
changeOrigin: true
|
|
100
|
+
},
|
|
101
|
+
'/ai': {
|
|
102
|
+
target: 'http://192.168.50.67:31761',
|
|
103
|
+
pathRewrite: { '^/ai': '/' },
|
|
104
|
+
changeOrigin: true
|
|
105
|
+
},
|
|
106
|
+
'/oss': {
|
|
107
|
+
target: OSSServerDev,
|
|
108
|
+
pathRewrite: { '^/oss': '/' },
|
|
109
|
+
changeOrigin: true
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
client: {
|
|
113
|
+
overlay: false
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
pluginOptions: {
|
|
117
|
+
'style-resources-loader': {
|
|
118
|
+
preProcessor: 'less',
|
|
119
|
+
patterns: [path.resolve(__dirname, './src/theme/theme.less')]
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
configureWebpack: config => {
|
|
123
|
+
config.devtool = 'inline-source-map'
|
|
124
|
+
// 忽略.md文件
|
|
125
|
+
config.module.rules.push(
|
|
126
|
+
{
|
|
127
|
+
test: /\.md$/,
|
|
128
|
+
exclude: /node_modules/,
|
|
129
|
+
use: 'ignore-loader'
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
config.context = path.resolve(__dirname, './')
|
|
133
|
+
config.resolve = {
|
|
134
|
+
extensions: ['.js', '.vue', '.json'],
|
|
135
|
+
alias: {
|
|
136
|
+
'@vue2-client': path.resolve('src'),
|
|
137
|
+
'@': path.resolve('src'),
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
config.entry.app = ['core-js/stable', 'regenerator-runtime/runtime', 'whatwg-fetch', './src/main.js']
|
|
141
|
+
config.performance = {
|
|
142
|
+
hints: false
|
|
143
|
+
}
|
|
144
|
+
if (isProd) {
|
|
145
|
+
config.plugins.push(
|
|
146
|
+
new ThemeColorReplacer({
|
|
147
|
+
fileName: 'css/theme-colors-[contenthash:8].css',
|
|
148
|
+
matchColors: getThemeColors(),
|
|
149
|
+
injectCss: true,
|
|
150
|
+
resolveCss
|
|
151
|
+
})
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
// Ignore all locale files of moment.js
|
|
155
|
+
config.plugins.push(new webpack.IgnorePlugin({
|
|
156
|
+
resourceRegExp: /^\.\/locale$/,
|
|
157
|
+
contextRegExp: /moment$/
|
|
158
|
+
}))
|
|
159
|
+
|
|
160
|
+
config.plugins.push(
|
|
161
|
+
// new CopyPlugin({
|
|
162
|
+
// patterns: [{ from: 'node_modules/amis/sdk', to: 'amis/sdk' }],
|
|
163
|
+
// })
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
// 生产环境下将资源压缩成gzip格式
|
|
167
|
+
if (isProd) {
|
|
168
|
+
// add `CompressionWebpack` plugin to webpack plugins
|
|
169
|
+
config.plugins.push(new CompressionWebpackPlugin({
|
|
170
|
+
algorithm: 'gzip',
|
|
171
|
+
test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
|
|
172
|
+
threshold: 10240,
|
|
173
|
+
minRatio: 0.8
|
|
174
|
+
}))
|
|
175
|
+
}
|
|
176
|
+
// if prod, add externals
|
|
177
|
+
// if (isProd) {
|
|
178
|
+
// config.externals = assetsCDN.externals
|
|
179
|
+
// }
|
|
180
|
+
},
|
|
181
|
+
chainWebpack: config => {
|
|
182
|
+
// 生产环境下关闭css压缩的 colormin 项,因为此项优化与主题色替换功能冲突
|
|
183
|
+
if (isProd) {
|
|
184
|
+
config.optimization.minimizer('css').use(CssMinimizerPlugin, [{
|
|
185
|
+
minimizerOptions: {
|
|
186
|
+
preset: [
|
|
187
|
+
'default',
|
|
188
|
+
{
|
|
189
|
+
discardComments: { removeAll: true },
|
|
190
|
+
colormin: false,
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
ignoreOrder: true
|
|
194
|
+
}
|
|
195
|
+
}])
|
|
196
|
+
}
|
|
197
|
+
config.resolve.alias.set('@vue2-client', path.resolve(__dirname, 'src'))
|
|
198
|
+
},
|
|
199
|
+
css: {
|
|
200
|
+
extract: !isProd
|
|
201
|
+
? {
|
|
202
|
+
filename: 'css/[name].css',
|
|
203
|
+
chunkFilename: 'css/[name].css',
|
|
204
|
+
}
|
|
205
|
+
: true,
|
|
206
|
+
loaderOptions: {
|
|
207
|
+
less: {
|
|
208
|
+
lessOptions: {
|
|
209
|
+
modifyVars: modifyVars(),
|
|
210
|
+
javascriptEnabled: true
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
sass: {}
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
publicPath: process.env.VUE_APP_PUBLIC_PATH,
|
|
217
|
+
outputDir: 'dist',
|
|
218
|
+
assetsDir: 'static',
|
|
219
|
+
productionSourceMap: false
|
|
220
|
+
}
|