vue2-client 1.2.99-test → 1.2.101
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 +15 -15
- package/.eslintrc.js +82 -82
- package/CHANGELOG.md +245 -245
- package/package.json +92 -92
- package/src/base-client/all.js +66 -66
- package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +113 -113
- package/src/base-client/components/common/CitySelect/CitySelect.vue +244 -244
- package/src/base-client/components/common/CitySelect/index.js +3 -3
- package/src/base-client/components/common/CitySelect/index.md +109 -109
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +547 -547
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +778 -778
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +310 -310
- package/src/base-client/components/common/PersonSetting/PersonSetting.vue +210 -210
- package/src/base-client/components/common/PersonSetting/index.js +3 -3
- package/src/base-client/components/common/Upload/Upload.vue +157 -157
- package/src/base-client/components/common/Upload/index.js +3 -3
- package/src/base-client/components/common/XAddForm/XAddForm.vue +349 -349
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +322 -322
- package/src/base-client/components/common/XForm/XForm.vue +268 -268
- package/src/base-client/components/common/XForm/XFormItem.vue +371 -371
- package/src/base-client/components/common/XFormTable/XFormTable.vue +507 -507
- package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +960 -960
- package/src/config/CreateQueryConfig.js +307 -307
- package/src/layouts/header/HeaderNotice.vue +164 -158
- package/src/layouts/header/InstitutionDetail.vue +177 -176
- package/src/pages/system/ticket/index.vue +68 -5
- package/src/router/async/router.map.js +60 -60
- package/src/services/api/TicketDetailsViewApi.js +3 -1
- package/src/services/api/WebmeterAnalysisViewApi.js +24 -24
- package/src/services/api/common.js +58 -58
- package/src/services/api/manage.js +16 -16
- package/src/services/api/restTools.js +24 -24
- package/vue.config.js +163 -163
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
const WebmeterAnalysisViewApi = {
|
|
2
|
-
// 查询:指令数统计
|
|
3
|
-
instructSumCount: '/webmeterapi/foreignaidInstructSumCountData',
|
|
4
|
-
// 查询:抄表数统计
|
|
5
|
-
meteReadSumCount: '/webmeterapi/foreignaidMetereadSumCountData',
|
|
6
|
-
// 查询:近一周抄表量数据
|
|
7
|
-
meteReadDataByWeek: '/webmeterapi/foreignaidMetereadDataByWeekData',
|
|
8
|
-
// 查询:在用表具数
|
|
9
|
-
usingMeterSumCount: '/webmeterapi/foreignaidUsingMeterSumCountData',
|
|
10
|
-
// 查询:近一周在用表具数数据
|
|
11
|
-
usingMeterDataByWeek: '/webmeterapi/foreignaidUsingMeterDataByWeekData',
|
|
12
|
-
// 查询:指令成功率统计
|
|
13
|
-
instructRateOfSuccess: '/webmeterapi/foreignaidInstructRateOfSuccessData',
|
|
14
|
-
// 查询:按表厂抄表量统计
|
|
15
|
-
handMeterSumCountData: '/webmeterapi/foreignaidHandMeterSumCountData',
|
|
16
|
-
// 查询:统计用气量数据
|
|
17
|
-
useGasSumCount: '/webmeterapi/foreignaidUseGasSumCountData',
|
|
18
|
-
// 查询:按用气性质统计用气量
|
|
19
|
-
GasByGasProperties: '/webmeterapi/foreignaidGasByGasProperties',
|
|
20
|
-
// 查询:用户在用气量占比
|
|
21
|
-
GasInUser: '/webmeterapi/foreignaidGasInUser'
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { WebmeterAnalysisViewApi }
|
|
1
|
+
const WebmeterAnalysisViewApi = {
|
|
2
|
+
// 查询:指令数统计
|
|
3
|
+
instructSumCount: '/webmeterapi/foreignaidInstructSumCountData',
|
|
4
|
+
// 查询:抄表数统计
|
|
5
|
+
meteReadSumCount: '/webmeterapi/foreignaidMetereadSumCountData',
|
|
6
|
+
// 查询:近一周抄表量数据
|
|
7
|
+
meteReadDataByWeek: '/webmeterapi/foreignaidMetereadDataByWeekData',
|
|
8
|
+
// 查询:在用表具数
|
|
9
|
+
usingMeterSumCount: '/webmeterapi/foreignaidUsingMeterSumCountData',
|
|
10
|
+
// 查询:近一周在用表具数数据
|
|
11
|
+
usingMeterDataByWeek: '/webmeterapi/foreignaidUsingMeterDataByWeekData',
|
|
12
|
+
// 查询:指令成功率统计
|
|
13
|
+
instructRateOfSuccess: '/webmeterapi/foreignaidInstructRateOfSuccessData',
|
|
14
|
+
// 查询:按表厂抄表量统计
|
|
15
|
+
handMeterSumCountData: '/webmeterapi/foreignaidHandMeterSumCountData',
|
|
16
|
+
// 查询:统计用气量数据
|
|
17
|
+
useGasSumCount: '/webmeterapi/foreignaidUseGasSumCountData',
|
|
18
|
+
// 查询:按用气性质统计用气量
|
|
19
|
+
GasByGasProperties: '/webmeterapi/foreignaidGasByGasProperties',
|
|
20
|
+
// 查询:用户在用气量占比
|
|
21
|
+
GasInUser: '/webmeterapi/foreignaidGasInUser'
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { WebmeterAnalysisViewApi }
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { METHOD, request } from '@vue2-client/utils/request'
|
|
2
|
-
import { indexedDB } from '@vue2-client/utils/indexedDB'
|
|
3
|
-
|
|
4
|
-
const commonApi = {
|
|
5
|
-
// 获取表格列配置
|
|
6
|
-
getColumnsJson: '/webmeterapi/getColumns',
|
|
7
|
-
// 通用查询
|
|
8
|
-
query: '/webmeterapi/commonQuery',
|
|
9
|
-
// 表单通用查询
|
|
10
|
-
queryWithResource: '/webmeterapi/commonQueryWithResource',
|
|
11
|
-
// 通用新增/修改
|
|
12
|
-
addOrModify: '/webmeterapi/commonAddOrModify',
|
|
13
|
-
// 通用删除
|
|
14
|
-
delete: '/webmeterapi/commonDelete',
|
|
15
|
-
// 获取字典键列表
|
|
16
|
-
getDictionaryParam: '/webmeterapi/getDictionaryParam',
|
|
17
|
-
// 获取所有员工及其部门的级联菜单数据
|
|
18
|
-
getEmpTree: '/webmeterapi/getEmpTree',
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* 带缓存查询的表格配置文件查询
|
|
23
|
-
* @param queryParamsName 配置名称
|
|
24
|
-
* @param callback 回调函数
|
|
25
|
-
*/
|
|
26
|
-
export function getColumnsJson (queryParamsName, callback) {
|
|
27
|
-
indexedDB.getByWeb(queryParamsName, commonApi.getColumnsJson, { str: queryParamsName }, callback)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* 通用表单查询
|
|
32
|
-
*/
|
|
33
|
-
export function query (parameter) {
|
|
34
|
-
return request(commonApi.query, METHOD.POST, parameter)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* 通用表单查询
|
|
39
|
-
*/
|
|
40
|
-
export function queryWithResource (parameter, api = commonApi.queryWithResource) {
|
|
41
|
-
return request(api, METHOD.POST, parameter)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* 通用新增/修改
|
|
46
|
-
*/
|
|
47
|
-
export function addOrModify (parameter, api = commonApi.
|
|
48
|
-
return request(api, METHOD.POST, parameter)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* 通用删除
|
|
53
|
-
*/
|
|
54
|
-
export function remove (parameter) {
|
|
55
|
-
return request(commonApi.delete, METHOD.POST, parameter)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export { commonApi }
|
|
1
|
+
import { METHOD, request } from '@vue2-client/utils/request'
|
|
2
|
+
import { indexedDB } from '@vue2-client/utils/indexedDB'
|
|
3
|
+
|
|
4
|
+
const commonApi = {
|
|
5
|
+
// 获取表格列配置
|
|
6
|
+
getColumnsJson: '/webmeterapi/getColumns',
|
|
7
|
+
// 通用查询
|
|
8
|
+
query: '/webmeterapi/commonQuery',
|
|
9
|
+
// 表单通用查询
|
|
10
|
+
queryWithResource: '/webmeterapi/commonQueryWithResource',
|
|
11
|
+
// 通用新增/修改
|
|
12
|
+
addOrModify: '/webmeterapi/commonAddOrModify',
|
|
13
|
+
// 通用删除
|
|
14
|
+
delete: '/webmeterapi/commonDelete',
|
|
15
|
+
// 获取字典键列表
|
|
16
|
+
getDictionaryParam: '/webmeterapi/getDictionaryParam',
|
|
17
|
+
// 获取所有员工及其部门的级联菜单数据
|
|
18
|
+
getEmpTree: '/webmeterapi/getEmpTree',
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 带缓存查询的表格配置文件查询
|
|
23
|
+
* @param queryParamsName 配置名称
|
|
24
|
+
* @param callback 回调函数
|
|
25
|
+
*/
|
|
26
|
+
export function getColumnsJson (queryParamsName, callback) {
|
|
27
|
+
indexedDB.getByWeb(queryParamsName, commonApi.getColumnsJson, { str: queryParamsName }, callback)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 通用表单查询
|
|
32
|
+
*/
|
|
33
|
+
export function query (parameter) {
|
|
34
|
+
return request(commonApi.query, METHOD.POST, parameter)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 通用表单查询
|
|
39
|
+
*/
|
|
40
|
+
export function queryWithResource (parameter, api = commonApi.queryWithResource) {
|
|
41
|
+
return request(api, METHOD.POST, parameter)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 通用新增/修改
|
|
46
|
+
*/
|
|
47
|
+
export function addOrModify (parameter, api = commonApi.addOrModify) {
|
|
48
|
+
return request(api, METHOD.POST, parameter)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 通用删除
|
|
53
|
+
*/
|
|
54
|
+
export function remove (parameter) {
|
|
55
|
+
return request(commonApi.delete, METHOD.POST, parameter)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { commonApi }
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const manageApi = {
|
|
2
|
-
// 查询:获取燃气公司列表
|
|
3
|
-
orgList: '/webmeterapi/foreignaidGetOrgList',
|
|
4
|
-
// 查询:获取客户列表
|
|
5
|
-
customerList: '/webmeterapi/foreignaidGetCustomerList',
|
|
6
|
-
// 查询:检查链接有效性
|
|
7
|
-
checkUrlWork: '/webmeterapi/foreignaidCheckUrl',
|
|
8
|
-
// 操作:客户数据
|
|
9
|
-
doCustomerInfo: '/webmeterapi/foreignaidDoCustomerInfo',
|
|
10
|
-
// 查询:获取字典键列表
|
|
11
|
-
getDictionaryValue: '/webmeterapi/getDictionaryValue',
|
|
12
|
-
// 查询:获取省市区街道三级分类
|
|
13
|
-
getDivisionsOhChina: '/webmeterapi/getDivisionsOhChina'
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { manageApi }
|
|
1
|
+
const manageApi = {
|
|
2
|
+
// 查询:获取燃气公司列表
|
|
3
|
+
orgList: '/webmeterapi/foreignaidGetOrgList',
|
|
4
|
+
// 查询:获取客户列表
|
|
5
|
+
customerList: '/webmeterapi/foreignaidGetCustomerList',
|
|
6
|
+
// 查询:检查链接有效性
|
|
7
|
+
checkUrlWork: '/webmeterapi/foreignaidCheckUrl',
|
|
8
|
+
// 操作:客户数据
|
|
9
|
+
doCustomerInfo: '/webmeterapi/foreignaidDoCustomerInfo',
|
|
10
|
+
// 查询:获取字典键列表
|
|
11
|
+
getDictionaryValue: '/webmeterapi/getDictionaryValue',
|
|
12
|
+
// 查询:获取省市区街道三级分类
|
|
13
|
+
getDivisionsOhChina: '/webmeterapi/getDivisionsOhChina'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { manageApi }
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { METHOD, request } from '@vue2-client/utils/request'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* GET请求
|
|
5
|
-
* @param url 请求地址
|
|
6
|
-
* @param parameter 路径参数
|
|
7
|
-
* @returns {Promise<AxiosResponse<T>>}
|
|
8
|
-
*/
|
|
9
|
-
function get (url, parameter) {
|
|
10
|
-
return request(url, METHOD.GET, parameter)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* POST请求
|
|
15
|
-
* @param url 请求地址
|
|
16
|
-
* @param parameter 请求参数
|
|
17
|
-
* @param config
|
|
18
|
-
* @returns {Promise<AxiosResponse<T>>}
|
|
19
|
-
*/
|
|
20
|
-
function post (url, parameter, config = {}) {
|
|
21
|
-
return request(url, METHOD.POST, parameter, config)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { get, post }
|
|
1
|
+
import { METHOD, request } from '@vue2-client/utils/request'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* GET请求
|
|
5
|
+
* @param url 请求地址
|
|
6
|
+
* @param parameter 路径参数
|
|
7
|
+
* @returns {Promise<AxiosResponse<T>>}
|
|
8
|
+
*/
|
|
9
|
+
function get (url, parameter) {
|
|
10
|
+
return request(url, METHOD.GET, parameter)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* POST请求
|
|
15
|
+
* @param url 请求地址
|
|
16
|
+
* @param parameter 请求参数
|
|
17
|
+
* @param config
|
|
18
|
+
* @returns {Promise<AxiosResponse<T>>}
|
|
19
|
+
*/
|
|
20
|
+
function post (url, parameter, config = {}) {
|
|
21
|
+
return request(url, METHOD.POST, parameter, config)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { get, post }
|
package/vue.config.js
CHANGED
|
@@ -1,163 +1,163 @@
|
|
|
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
|
-
|
|
8
|
-
const productionGzipExtensions = ['js', 'css']
|
|
9
|
-
const isProd = process.env.NODE_ENV === 'production'
|
|
10
|
-
|
|
11
|
-
// const assetsCDN = {
|
|
12
|
-
// // webpack build externals
|
|
13
|
-
// externals: {
|
|
14
|
-
// vue: 'Vue',
|
|
15
|
-
// 'vue-router': 'VueRouter',
|
|
16
|
-
// vuex: 'Vuex',
|
|
17
|
-
// axios: 'axios',
|
|
18
|
-
// nprogress: 'NProgress',
|
|
19
|
-
// clipboard: 'ClipboardJS',
|
|
20
|
-
// '@antv/data-set': 'DataSet',
|
|
21
|
-
// 'js-cookie': 'Cookies'
|
|
22
|
-
// },
|
|
23
|
-
// css: [
|
|
24
|
-
// ],
|
|
25
|
-
// js: [
|
|
26
|
-
// '//cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js',
|
|
27
|
-
// '//cdn.jsdelivr.net/npm/vue-router@3.3.4/dist/vue-router.min.js',
|
|
28
|
-
// '//cdn.jsdelivr.net/npm/vuex@3.4.0/dist/vuex.min.js',
|
|
29
|
-
// '//cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js',
|
|
30
|
-
// '//cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.js',
|
|
31
|
-
// '//cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js',
|
|
32
|
-
// '//cdn.jsdelivr.net/npm/@antv/data-set@0.11.4/build/data-set.min.js',
|
|
33
|
-
// '//cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js'
|
|
34
|
-
// ]
|
|
35
|
-
// }
|
|
36
|
-
|
|
37
|
-
const server = 'http://123.60.214.109:8406'
|
|
38
|
-
const local = 'http://localhost:8445/webmeter'
|
|
39
|
-
// const local = 'http://123.60.214.109:8405/webmeter'
|
|
40
|
-
|
|
41
|
-
module.exports = {
|
|
42
|
-
devServer: {
|
|
43
|
-
// development server port 8000
|
|
44
|
-
port: 8001,
|
|
45
|
-
// If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
|
|
46
|
-
proxy: {
|
|
47
|
-
'/rs': {
|
|
48
|
-
target: server,
|
|
49
|
-
ws: false,
|
|
50
|
-
changeOrigin: true
|
|
51
|
-
},
|
|
52
|
-
'/image': {
|
|
53
|
-
target: server,
|
|
54
|
-
ws: false,
|
|
55
|
-
changeOrigin: true
|
|
56
|
-
},
|
|
57
|
-
'/webapps': {
|
|
58
|
-
target: server,
|
|
59
|
-
ws: false,
|
|
60
|
-
changeOrigin: true
|
|
61
|
-
},
|
|
62
|
-
'/webmeterapi/foreignaidUseGasSumCountData': {
|
|
63
|
-
// pathRewrite: { '^/webmeterapi': '/rs/logic' },
|
|
64
|
-
target: 'http://61.134.55.234:8405/',
|
|
65
|
-
changeOrigin: true
|
|
66
|
-
},
|
|
67
|
-
'/webmeterapi/getEmpTree': {
|
|
68
|
-
// pathRewrite: { '^/webmeterapi': '/rs/logic' },
|
|
69
|
-
target: 'http://123.60.214.109:8406/',
|
|
70
|
-
changeOrigin: true
|
|
71
|
-
},
|
|
72
|
-
'/webmeterapi': {
|
|
73
|
-
pathRewrite: { '^/webmeterapi': '/rs/logic' },
|
|
74
|
-
target: local,
|
|
75
|
-
changeOrigin: true
|
|
76
|
-
},
|
|
77
|
-
'/webmeteruploadapi': {
|
|
78
|
-
pathRewrite: { '^/webmeteruploadapi': '/rs/file' },
|
|
79
|
-
target: local,
|
|
80
|
-
changeOrigin: true
|
|
81
|
-
},
|
|
82
|
-
'/webmeterresourceapi': {
|
|
83
|
-
pathRewrite: { '^/webmeterresourceapi': '/rs/resource' },
|
|
84
|
-
target: local,
|
|
85
|
-
changeOrigin: true
|
|
86
|
-
},
|
|
87
|
-
'/resource': {
|
|
88
|
-
pathRewrite: { '^/resource': '/' },
|
|
89
|
-
target: 'http://127.0.0.1:4789',
|
|
90
|
-
changeOrigin: true
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
pluginOptions: {
|
|
95
|
-
'style-resources-loader': {
|
|
96
|
-
preProcessor: 'less',
|
|
97
|
-
patterns: [path.resolve(__dirname, './src/theme/theme.less')]
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
configureWebpack: config => {
|
|
101
|
-
config.entry.app = ['babel-polyfill', 'whatwg-fetch', './src/main.js']
|
|
102
|
-
config.performance = {
|
|
103
|
-
hints: false
|
|
104
|
-
}
|
|
105
|
-
config.plugins.push(
|
|
106
|
-
new ThemeColorReplacer({
|
|
107
|
-
fileName: 'css/theme-colors-[contenthash:8].css',
|
|
108
|
-
matchColors: getThemeColors(),
|
|
109
|
-
injectCss: true,
|
|
110
|
-
resolveCss
|
|
111
|
-
})
|
|
112
|
-
)
|
|
113
|
-
// Ignore all locale files of moment.js
|
|
114
|
-
config.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/))
|
|
115
|
-
// 生产环境下将资源压缩成gzip格式
|
|
116
|
-
if (isProd) {
|
|
117
|
-
// add `CompressionWebpack` plugin to webpack plugins
|
|
118
|
-
config.plugins.push(new CompressionWebpackPlugin({
|
|
119
|
-
algorithm: 'gzip',
|
|
120
|
-
test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
|
|
121
|
-
threshold: 10240,
|
|
122
|
-
minRatio: 0.8
|
|
123
|
-
}))
|
|
124
|
-
}
|
|
125
|
-
// if prod, add externals
|
|
126
|
-
// if (isProd) {
|
|
127
|
-
// config.externals = assetsCDN.externals
|
|
128
|
-
// }
|
|
129
|
-
},
|
|
130
|
-
chainWebpack: config => {
|
|
131
|
-
// 生产环境下关闭css压缩的 colormin 项,因为此项优化与主题色替换功能冲突
|
|
132
|
-
if (isProd) {
|
|
133
|
-
config.plugin('optimize-css')
|
|
134
|
-
.tap(args => {
|
|
135
|
-
args[0].cssnanoOptions.preset[1].colormin = false
|
|
136
|
-
return args
|
|
137
|
-
})
|
|
138
|
-
}
|
|
139
|
-
// 生产环境下使用CDN
|
|
140
|
-
// if (isProd) {
|
|
141
|
-
// config.plugin('html')
|
|
142
|
-
// .tap(args => {
|
|
143
|
-
// args[0].cdn = assetsCDN
|
|
144
|
-
// return args
|
|
145
|
-
// })
|
|
146
|
-
// }
|
|
147
|
-
config.resolve.alias.set('@vue2-client', path.resolve(__dirname, 'src'))
|
|
148
|
-
},
|
|
149
|
-
css: {
|
|
150
|
-
loaderOptions: {
|
|
151
|
-
less: {
|
|
152
|
-
lessOptions: {
|
|
153
|
-
modifyVars: modifyVars(),
|
|
154
|
-
javascriptEnabled: true
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
publicPath: process.env.VUE_APP_PUBLIC_PATH,
|
|
160
|
-
outputDir: 'dist',
|
|
161
|
-
assetsDir: 'static',
|
|
162
|
-
productionSourceMap: false
|
|
163
|
-
}
|
|
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
|
+
|
|
8
|
+
const productionGzipExtensions = ['js', 'css']
|
|
9
|
+
const isProd = process.env.NODE_ENV === 'production'
|
|
10
|
+
|
|
11
|
+
// const assetsCDN = {
|
|
12
|
+
// // webpack build externals
|
|
13
|
+
// externals: {
|
|
14
|
+
// vue: 'Vue',
|
|
15
|
+
// 'vue-router': 'VueRouter',
|
|
16
|
+
// vuex: 'Vuex',
|
|
17
|
+
// axios: 'axios',
|
|
18
|
+
// nprogress: 'NProgress',
|
|
19
|
+
// clipboard: 'ClipboardJS',
|
|
20
|
+
// '@antv/data-set': 'DataSet',
|
|
21
|
+
// 'js-cookie': 'Cookies'
|
|
22
|
+
// },
|
|
23
|
+
// css: [
|
|
24
|
+
// ],
|
|
25
|
+
// js: [
|
|
26
|
+
// '//cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js',
|
|
27
|
+
// '//cdn.jsdelivr.net/npm/vue-router@3.3.4/dist/vue-router.min.js',
|
|
28
|
+
// '//cdn.jsdelivr.net/npm/vuex@3.4.0/dist/vuex.min.js',
|
|
29
|
+
// '//cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js',
|
|
30
|
+
// '//cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.js',
|
|
31
|
+
// '//cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js',
|
|
32
|
+
// '//cdn.jsdelivr.net/npm/@antv/data-set@0.11.4/build/data-set.min.js',
|
|
33
|
+
// '//cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js'
|
|
34
|
+
// ]
|
|
35
|
+
// }
|
|
36
|
+
|
|
37
|
+
const server = 'http://123.60.214.109:8406'
|
|
38
|
+
const local = 'http://localhost:8445/webmeter'
|
|
39
|
+
// const local = 'http://123.60.214.109:8405/webmeter'
|
|
40
|
+
|
|
41
|
+
module.exports = {
|
|
42
|
+
devServer: {
|
|
43
|
+
// development server port 8000
|
|
44
|
+
port: 8001,
|
|
45
|
+
// If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
|
|
46
|
+
proxy: {
|
|
47
|
+
'/rs': {
|
|
48
|
+
target: server,
|
|
49
|
+
ws: false,
|
|
50
|
+
changeOrigin: true
|
|
51
|
+
},
|
|
52
|
+
'/image': {
|
|
53
|
+
target: server,
|
|
54
|
+
ws: false,
|
|
55
|
+
changeOrigin: true
|
|
56
|
+
},
|
|
57
|
+
'/webapps': {
|
|
58
|
+
target: server,
|
|
59
|
+
ws: false,
|
|
60
|
+
changeOrigin: true
|
|
61
|
+
},
|
|
62
|
+
'/webmeterapi/foreignaidUseGasSumCountData': {
|
|
63
|
+
// pathRewrite: { '^/webmeterapi': '/rs/logic' },
|
|
64
|
+
target: 'http://61.134.55.234:8405/',
|
|
65
|
+
changeOrigin: true
|
|
66
|
+
},
|
|
67
|
+
'/webmeterapi/getEmpTree': {
|
|
68
|
+
// pathRewrite: { '^/webmeterapi': '/rs/logic' },
|
|
69
|
+
target: 'http://123.60.214.109:8406/',
|
|
70
|
+
changeOrigin: true
|
|
71
|
+
},
|
|
72
|
+
'/webmeterapi': {
|
|
73
|
+
pathRewrite: { '^/webmeterapi': '/rs/logic' },
|
|
74
|
+
target: local,
|
|
75
|
+
changeOrigin: true
|
|
76
|
+
},
|
|
77
|
+
'/webmeteruploadapi': {
|
|
78
|
+
pathRewrite: { '^/webmeteruploadapi': '/rs/file' },
|
|
79
|
+
target: local,
|
|
80
|
+
changeOrigin: true
|
|
81
|
+
},
|
|
82
|
+
'/webmeterresourceapi': {
|
|
83
|
+
pathRewrite: { '^/webmeterresourceapi': '/rs/resource' },
|
|
84
|
+
target: local,
|
|
85
|
+
changeOrigin: true
|
|
86
|
+
},
|
|
87
|
+
'/resource': {
|
|
88
|
+
pathRewrite: { '^/resource': '/' },
|
|
89
|
+
target: 'http://127.0.0.1:4789',
|
|
90
|
+
changeOrigin: true
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
pluginOptions: {
|
|
95
|
+
'style-resources-loader': {
|
|
96
|
+
preProcessor: 'less',
|
|
97
|
+
patterns: [path.resolve(__dirname, './src/theme/theme.less')]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
configureWebpack: config => {
|
|
101
|
+
config.entry.app = ['babel-polyfill', 'whatwg-fetch', './src/main.js']
|
|
102
|
+
config.performance = {
|
|
103
|
+
hints: false
|
|
104
|
+
}
|
|
105
|
+
config.plugins.push(
|
|
106
|
+
new ThemeColorReplacer({
|
|
107
|
+
fileName: 'css/theme-colors-[contenthash:8].css',
|
|
108
|
+
matchColors: getThemeColors(),
|
|
109
|
+
injectCss: true,
|
|
110
|
+
resolveCss
|
|
111
|
+
})
|
|
112
|
+
)
|
|
113
|
+
// Ignore all locale files of moment.js
|
|
114
|
+
config.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/))
|
|
115
|
+
// 生产环境下将资源压缩成gzip格式
|
|
116
|
+
if (isProd) {
|
|
117
|
+
// add `CompressionWebpack` plugin to webpack plugins
|
|
118
|
+
config.plugins.push(new CompressionWebpackPlugin({
|
|
119
|
+
algorithm: 'gzip',
|
|
120
|
+
test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
|
|
121
|
+
threshold: 10240,
|
|
122
|
+
minRatio: 0.8
|
|
123
|
+
}))
|
|
124
|
+
}
|
|
125
|
+
// if prod, add externals
|
|
126
|
+
// if (isProd) {
|
|
127
|
+
// config.externals = assetsCDN.externals
|
|
128
|
+
// }
|
|
129
|
+
},
|
|
130
|
+
chainWebpack: config => {
|
|
131
|
+
// 生产环境下关闭css压缩的 colormin 项,因为此项优化与主题色替换功能冲突
|
|
132
|
+
if (isProd) {
|
|
133
|
+
config.plugin('optimize-css')
|
|
134
|
+
.tap(args => {
|
|
135
|
+
args[0].cssnanoOptions.preset[1].colormin = false
|
|
136
|
+
return args
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
// 生产环境下使用CDN
|
|
140
|
+
// if (isProd) {
|
|
141
|
+
// config.plugin('html')
|
|
142
|
+
// .tap(args => {
|
|
143
|
+
// args[0].cdn = assetsCDN
|
|
144
|
+
// return args
|
|
145
|
+
// })
|
|
146
|
+
// }
|
|
147
|
+
config.resolve.alias.set('@vue2-client', path.resolve(__dirname, 'src'))
|
|
148
|
+
},
|
|
149
|
+
css: {
|
|
150
|
+
loaderOptions: {
|
|
151
|
+
less: {
|
|
152
|
+
lessOptions: {
|
|
153
|
+
modifyVars: modifyVars(),
|
|
154
|
+
javascriptEnabled: true
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
publicPath: process.env.VUE_APP_PUBLIC_PATH,
|
|
160
|
+
outputDir: 'dist',
|
|
161
|
+
assetsDir: 'static',
|
|
162
|
+
productionSourceMap: false
|
|
163
|
+
}
|