vue2-client 1.2.70 → 1.2.73

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.
Files changed (43) hide show
  1. package/.env +15 -15
  2. package/.eslintrc.js +82 -82
  3. package/CHANGELOG.md +16 -1
  4. package/package.json +1 -1
  5. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +225 -225
  6. package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +113 -113
  7. package/src/base-client/components/common/CitySelect/CitySelect.vue +244 -244
  8. package/src/base-client/components/common/CitySelect/index.js +3 -3
  9. package/src/base-client/components/common/CitySelect/index.md +109 -109
  10. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +41 -1
  11. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +773 -773
  12. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +310 -310
  13. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +553 -553
  14. package/src/base-client/components/common/Upload/Upload.vue +151 -151
  15. package/src/base-client/components/common/Upload/index.js +3 -3
  16. package/src/base-client/components/common/XAddForm/XAddForm.vue +345 -345
  17. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +322 -322
  18. package/src/base-client/components/common/XForm/XForm.vue +268 -268
  19. package/src/base-client/components/common/XForm/XFormItem.vue +358 -358
  20. package/src/base-client/components/common/XFormTable/XFormTable.vue +491 -491
  21. package/src/base-client/components/common/XTable/XTable.vue +269 -271
  22. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
  23. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +131 -131
  24. package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +300 -300
  25. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +647 -647
  26. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +43 -10
  27. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +65 -114
  28. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  29. package/src/base-client/plugins/AppData.js +70 -70
  30. package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
  31. package/src/config/CreateQueryConfig.js +301 -301
  32. package/src/pages/resourceManage/orgListManage.vue +98 -98
  33. package/src/router/async/config.async.js +26 -26
  34. package/src/router/async/router.map.js +60 -60
  35. package/src/router/index.js +27 -27
  36. package/src/services/api/EmployeeDetailsViewApi.js +0 -4
  37. package/src/services/api/common.js +56 -56
  38. package/src/services/api/manage.js +16 -16
  39. package/src/services/api/restTools.js +24 -24
  40. package/src/theme/default/style.less +47 -47
  41. package/src/utils/map-utils.js +28 -28
  42. package/src/utils/request.js +198 -198
  43. package/src/utils/util.js +222 -222
@@ -1,47 +1,47 @@
1
- .week-mode{
2
- overflow: hidden;
3
- filter: invert(80%);
4
- }
5
- .beauty-scroll{
6
- scrollbar-color: @primary-color @primary-2;
7
- scrollbar-width: thin;
8
- -ms-overflow-style:none;
9
- position: relative;
10
- &::-webkit-scrollbar{
11
- width: 3px;
12
- height: 1px;
13
- }
14
- &::-webkit-scrollbar-thumb {
15
- border-radius: 3px;
16
- background: @primary-color;
17
- }
18
- &::-webkit-scrollbar-track {
19
- -webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0);
20
- border-radius: 3px;
21
- background: @primary-3;
22
- }
23
- }
24
- .split-right{
25
- &:not(:last-child) {
26
- border-right: 1px solid rgba(98, 98, 98, 0.2);
27
- }
28
- }
29
- .disabled{
30
- cursor: not-allowed;
31
- color: @disabled-color;
32
- pointer-events: none;
33
- }
34
-
35
- ::-webkit-scrollbar{
36
- width: 5px;
37
- height: 5px;
38
- }
39
- ::-webkit-scrollbar-thumb {
40
- border-radius: 3px;
41
- background: @primary-3;
42
- }
43
- ::-webkit-scrollbar-track {
44
- -webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0);
45
- border-radius: 3px;
46
- background: @primary-1;
47
- }
1
+ .week-mode{
2
+ overflow: hidden;
3
+ filter: invert(80%);
4
+ }
5
+ .beauty-scroll{
6
+ scrollbar-color: @primary-color @primary-2;
7
+ scrollbar-width: thin;
8
+ -ms-overflow-style:none;
9
+ position: relative;
10
+ &::-webkit-scrollbar{
11
+ width: 3px;
12
+ height: 1px;
13
+ }
14
+ &::-webkit-scrollbar-thumb {
15
+ border-radius: 3px;
16
+ background: @primary-color;
17
+ }
18
+ &::-webkit-scrollbar-track {
19
+ -webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0);
20
+ border-radius: 3px;
21
+ background: @primary-3;
22
+ }
23
+ }
24
+ .split-right{
25
+ &:not(:last-child) {
26
+ border-right: 1px solid rgba(98, 98, 98, 0.2);
27
+ }
28
+ }
29
+ .disabled{
30
+ cursor: not-allowed;
31
+ color: @disabled-color;
32
+ pointer-events: none;
33
+ }
34
+
35
+ ::-webkit-scrollbar{
36
+ width: 5px;
37
+ height: 5px;
38
+ }
39
+ ::-webkit-scrollbar-thumb {
40
+ border-radius: 3px;
41
+ background: @primary-3;
42
+ }
43
+ ::-webkit-scrollbar-track {
44
+ -webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0);
45
+ border-radius: 3px;
46
+ background: @primary-1;
47
+ }
@@ -1,28 +1,28 @@
1
- import AMapLoader from '@amap/amap-jsapi-loader'
2
- let Amap
3
- async function GetGDMap () {
4
- if (!Amap) {
5
- Amap = await AMapLoader.load({
6
- key: '4889f1e58df01cb40415536c8907bf64', // 申请好的Web端开发者Key,首次调用 load 时必填
7
- version: '1.4.2', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
8
- plugins: ['AMap.ToolBar', 'AMap.Geolocation', 'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.Autocomplete'] // 需要使用的的插件列表,如比例尺'AMap.Scale'等
9
- })
10
- }
11
- return Amap
12
- }
13
- async function GetLocation (address) {
14
- return new Promise(async (resolve, reject) => {
15
- new (await GetGDMap()).Geocoder({
16
- radius: 500 // 范围,默认:500
17
- }).getLocation(address, function (status, result) {
18
- console.log(result)
19
- if (status === 'complete' && result.geocodes.length) {
20
- resolve({ lng: result.geocodes[0].location.lng, lat: result.geocodes[0].location.lat })
21
- } else {
22
- // eslint-disable-next-line prefer-promise-reject-errors
23
- reject('根据经纬度查询地址失败')
24
- }
25
- })
26
- })
27
- }
28
- export { GetGDMap, GetLocation }
1
+ import AMapLoader from '@amap/amap-jsapi-loader'
2
+ let Amap
3
+ async function GetGDMap () {
4
+ if (!Amap) {
5
+ Amap = await AMapLoader.load({
6
+ key: '4889f1e58df01cb40415536c8907bf64', // 申请好的Web端开发者Key,首次调用 load 时必填
7
+ version: '1.4.2', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
8
+ plugins: ['AMap.ToolBar', 'AMap.Geolocation', 'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.Autocomplete'] // 需要使用的的插件列表,如比例尺'AMap.Scale'等
9
+ })
10
+ }
11
+ return Amap
12
+ }
13
+ async function GetLocation (address) {
14
+ return new Promise(async (resolve, reject) => {
15
+ new (await GetGDMap()).Geocoder({
16
+ radius: 500 // 范围,默认:500
17
+ }).getLocation(address, function (status, result) {
18
+ console.log(result)
19
+ if (status === 'complete' && result.geocodes.length) {
20
+ resolve({ lng: result.geocodes[0].location.lng, lat: result.geocodes[0].location.lat })
21
+ } else {
22
+ // eslint-disable-next-line prefer-promise-reject-errors
23
+ reject('根据经纬度查询地址失败')
24
+ }
25
+ })
26
+ })
27
+ }
28
+ export { GetGDMap, GetLocation }
@@ -1,198 +1,198 @@
1
- import axios from 'axios'
2
- import Cookie from 'js-cookie'
3
- import Vue from 'vue'
4
- import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
5
- import notification from 'ant-design-vue/es/notification'
6
-
7
- // 跨域认证信息 header 名
8
- const xsrfHeaderName = 'Authorization'
9
-
10
- axios.defaults.timeout = 5000
11
- axios.defaults.withCredentials = true
12
- axios.defaults.xsrfHeaderName = xsrfHeaderName
13
- axios.defaults.xsrfCookieName = xsrfHeaderName
14
-
15
- // 认证类型
16
- const AUTH_TYPE = {
17
- BEARER: 'Bearer',
18
- BASIC: 'basic',
19
- AUTH1: 'auth1',
20
- AUTH2: 'auth2'
21
- }
22
-
23
- // http method
24
- const METHOD = {
25
- GET: 'get',
26
- POST: 'post'
27
- }
28
-
29
- /**
30
- * axios请求
31
- * @param url 请求地址
32
- * @param method {METHOD} http method
33
- * @param params 请求参数
34
- * @param config
35
- * @returns {Promise<AxiosResponse<T>>}
36
- */
37
- async function request (url, method, params, config) {
38
- switch (method) {
39
- case METHOD.GET:
40
- return axios.get(url, { params, ...config })
41
- case METHOD.POST:
42
- return axios.post(url, params, config)
43
- default:
44
- return axios.get(url, { params, ...config })
45
- }
46
- }
47
-
48
- /**
49
- * 设置认证信息
50
- * @param auth {Object}
51
- * @param authType {AUTH_TYPE} 认证类型,默认:{AUTH_TYPE.BEARER}
52
- */
53
- function setAuthorization (auth, authType = AUTH_TYPE.BEARER) {
54
- switch (authType) {
55
- case AUTH_TYPE.BEARER:
56
- Cookie.set(xsrfHeaderName, 'Bearer ' + auth.token, { expires: auth.expireAt })
57
- break
58
- case AUTH_TYPE.BASIC:
59
- case AUTH_TYPE.AUTH1:
60
- case AUTH_TYPE.AUTH2:
61
- default:
62
- break
63
- }
64
- }
65
-
66
- /**
67
- * 移出认证信息
68
- * @param authType {AUTH_TYPE} 认证类型
69
- */
70
- function removeAuthorization (authType = AUTH_TYPE.BEARER) {
71
- switch (authType) {
72
- case AUTH_TYPE.BEARER:
73
- Cookie.remove(xsrfHeaderName)
74
- break
75
- case AUTH_TYPE.BASIC:
76
- case AUTH_TYPE.AUTH1:
77
- case AUTH_TYPE.AUTH2:
78
- default:
79
- break
80
- }
81
- }
82
-
83
- /**
84
- * 检查认证信息
85
- * @param authType
86
- * @returns {boolean}
87
- */
88
- function checkAuthorization (authType = AUTH_TYPE.BEARER) {
89
- switch (authType) {
90
- case AUTH_TYPE.BEARER:
91
- if (Cookie.get(xsrfHeaderName)) {
92
- return true
93
- }
94
- break
95
- case AUTH_TYPE.BASIC:
96
- case AUTH_TYPE.AUTH1:
97
- case AUTH_TYPE.AUTH2:
98
- default:
99
- break
100
- }
101
- return false
102
- }
103
-
104
- /**
105
- * 加载 axios 拦截器
106
- * @param interceptors
107
- * @param options
108
- */
109
- function loadInterceptors () {
110
- // 加载请求拦截器
111
- axios.interceptors.request.use(config => {
112
- const token = localStorage.getItem(ACCESS_TOKEN)
113
- // 如果 token 存在
114
- // 让每个请求携带自定义 token 请根据实际情况自行修改
115
- if (token) {
116
- config.headers['Access-Token'] = token
117
- }
118
- if (!config.headers['Content-Type']) {
119
- config.headers['Content-Type'] = 'application/json;charset=UTF-8'
120
- }
121
- return config
122
- }, errorHandler)
123
- // 加载响应拦截器
124
- axios.interceptors.response.use((response) => {
125
- return response.data
126
- }, errorHandler)
127
- }
128
-
129
- // 异常拦截处理器
130
- const errorHandler = (error) => {
131
- if (error.response) {
132
- const data = error.response.data
133
- // 从 localstorage 获取 token
134
- const token = localStorage.getItem(ACCESS_TOKEN)
135
- if (error.response.status === 403) {
136
- notification.error({
137
- message: '禁止访问',
138
- description: data
139
- })
140
- } else if (error.response.status === 401 && !(data.result && data.result.isLogin)) {
141
- notification.error({
142
- message: '鉴权失败',
143
- description: data
144
- })
145
- if (token) {
146
- Vue.$store.dispatch('Logout').then(() => {
147
- setTimeout(() => {
148
- window.location.reload()
149
- }, 1500)
150
- })
151
- }
152
- } else if (error.response.status === 500) {
153
- notification.error({
154
- message: '系统异常',
155
- description: data
156
- })
157
- } else {
158
- notification.error({
159
- message: '数据异常',
160
- description: data
161
- })
162
- }
163
- }
164
- return Promise.reject(error)
165
- }
166
-
167
- /**
168
- * 解析 url 中的参数
169
- * @param url
170
- * @returns {Object}
171
- */
172
- function parseUrlParams (url) {
173
- const params = {}
174
- if (!url || url === '' || typeof url !== 'string') {
175
- return params
176
- }
177
- const paramsStr = url.split('?')[1]
178
- if (!paramsStr) {
179
- return params
180
- }
181
- const paramsArr = paramsStr.replace(/&|=/g, ' ').split(' ')
182
- for (let i = 0; i < paramsArr.length / 2; i++) {
183
- const value = paramsArr[i * 2 + 1]
184
- params[paramsArr[i * 2]] = value === 'true' ? true : (value === 'false' ? false : value)
185
- }
186
- return params
187
- }
188
-
189
- export {
190
- METHOD,
191
- AUTH_TYPE,
192
- request,
193
- setAuthorization,
194
- removeAuthorization,
195
- checkAuthorization,
196
- loadInterceptors,
197
- parseUrlParams
198
- }
1
+ import axios from 'axios'
2
+ import Cookie from 'js-cookie'
3
+ import Vue from 'vue'
4
+ import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
5
+ import notification from 'ant-design-vue/es/notification'
6
+
7
+ // 跨域认证信息 header 名
8
+ const xsrfHeaderName = 'Authorization'
9
+
10
+ axios.defaults.timeout = 5000
11
+ axios.defaults.withCredentials = true
12
+ axios.defaults.xsrfHeaderName = xsrfHeaderName
13
+ axios.defaults.xsrfCookieName = xsrfHeaderName
14
+
15
+ // 认证类型
16
+ const AUTH_TYPE = {
17
+ BEARER: 'Bearer',
18
+ BASIC: 'basic',
19
+ AUTH1: 'auth1',
20
+ AUTH2: 'auth2'
21
+ }
22
+
23
+ // http method
24
+ const METHOD = {
25
+ GET: 'get',
26
+ POST: 'post'
27
+ }
28
+
29
+ /**
30
+ * axios请求
31
+ * @param url 请求地址
32
+ * @param method {METHOD} http method
33
+ * @param params 请求参数
34
+ * @param config
35
+ * @returns {Promise<AxiosResponse<T>>}
36
+ */
37
+ async function request (url, method, params, config) {
38
+ switch (method) {
39
+ case METHOD.GET:
40
+ return axios.get(url, { params, ...config })
41
+ case METHOD.POST:
42
+ return axios.post(url, params, config)
43
+ default:
44
+ return axios.get(url, { params, ...config })
45
+ }
46
+ }
47
+
48
+ /**
49
+ * 设置认证信息
50
+ * @param auth {Object}
51
+ * @param authType {AUTH_TYPE} 认证类型,默认:{AUTH_TYPE.BEARER}
52
+ */
53
+ function setAuthorization (auth, authType = AUTH_TYPE.BEARER) {
54
+ switch (authType) {
55
+ case AUTH_TYPE.BEARER:
56
+ Cookie.set(xsrfHeaderName, 'Bearer ' + auth.token, { expires: auth.expireAt })
57
+ break
58
+ case AUTH_TYPE.BASIC:
59
+ case AUTH_TYPE.AUTH1:
60
+ case AUTH_TYPE.AUTH2:
61
+ default:
62
+ break
63
+ }
64
+ }
65
+
66
+ /**
67
+ * 移出认证信息
68
+ * @param authType {AUTH_TYPE} 认证类型
69
+ */
70
+ function removeAuthorization (authType = AUTH_TYPE.BEARER) {
71
+ switch (authType) {
72
+ case AUTH_TYPE.BEARER:
73
+ Cookie.remove(xsrfHeaderName)
74
+ break
75
+ case AUTH_TYPE.BASIC:
76
+ case AUTH_TYPE.AUTH1:
77
+ case AUTH_TYPE.AUTH2:
78
+ default:
79
+ break
80
+ }
81
+ }
82
+
83
+ /**
84
+ * 检查认证信息
85
+ * @param authType
86
+ * @returns {boolean}
87
+ */
88
+ function checkAuthorization (authType = AUTH_TYPE.BEARER) {
89
+ switch (authType) {
90
+ case AUTH_TYPE.BEARER:
91
+ if (Cookie.get(xsrfHeaderName)) {
92
+ return true
93
+ }
94
+ break
95
+ case AUTH_TYPE.BASIC:
96
+ case AUTH_TYPE.AUTH1:
97
+ case AUTH_TYPE.AUTH2:
98
+ default:
99
+ break
100
+ }
101
+ return false
102
+ }
103
+
104
+ /**
105
+ * 加载 axios 拦截器
106
+ * @param interceptors
107
+ * @param options
108
+ */
109
+ function loadInterceptors () {
110
+ // 加载请求拦截器
111
+ axios.interceptors.request.use(config => {
112
+ const token = localStorage.getItem(ACCESS_TOKEN)
113
+ // 如果 token 存在
114
+ // 让每个请求携带自定义 token 请根据实际情况自行修改
115
+ if (token) {
116
+ config.headers['Access-Token'] = token
117
+ }
118
+ if (!config.headers['Content-Type']) {
119
+ config.headers['Content-Type'] = 'application/json;charset=UTF-8'
120
+ }
121
+ return config
122
+ }, errorHandler)
123
+ // 加载响应拦截器
124
+ axios.interceptors.response.use((response) => {
125
+ return response.data
126
+ }, errorHandler)
127
+ }
128
+
129
+ // 异常拦截处理器
130
+ const errorHandler = (error) => {
131
+ if (error.response) {
132
+ const data = error.response.data
133
+ // 从 localstorage 获取 token
134
+ const token = localStorage.getItem(ACCESS_TOKEN)
135
+ if (error.response.status === 403) {
136
+ notification.error({
137
+ message: '禁止访问',
138
+ description: data
139
+ })
140
+ } else if (error.response.status === 401 && !(data.result && data.result.isLogin)) {
141
+ notification.error({
142
+ message: '鉴权失败',
143
+ description: data
144
+ })
145
+ if (token) {
146
+ Vue.$store.dispatch('Logout').then(() => {
147
+ setTimeout(() => {
148
+ window.location.reload()
149
+ }, 1500)
150
+ })
151
+ }
152
+ } else if (error.response.status === 500) {
153
+ notification.error({
154
+ message: '系统异常',
155
+ description: data
156
+ })
157
+ } else {
158
+ notification.error({
159
+ message: '数据异常',
160
+ description: data
161
+ })
162
+ }
163
+ }
164
+ return Promise.reject(error)
165
+ }
166
+
167
+ /**
168
+ * 解析 url 中的参数
169
+ * @param url
170
+ * @returns {Object}
171
+ */
172
+ function parseUrlParams (url) {
173
+ const params = {}
174
+ if (!url || url === '' || typeof url !== 'string') {
175
+ return params
176
+ }
177
+ const paramsStr = url.split('?')[1]
178
+ if (!paramsStr) {
179
+ return params
180
+ }
181
+ const paramsArr = paramsStr.replace(/&|=/g, ' ').split(' ')
182
+ for (let i = 0; i < paramsArr.length / 2; i++) {
183
+ const value = paramsArr[i * 2 + 1]
184
+ params[paramsArr[i * 2]] = value === 'true' ? true : (value === 'false' ? false : value)
185
+ }
186
+ return params
187
+ }
188
+
189
+ export {
190
+ METHOD,
191
+ AUTH_TYPE,
192
+ request,
193
+ setAuthorization,
194
+ removeAuthorization,
195
+ checkAuthorization,
196
+ loadInterceptors,
197
+ parseUrlParams
198
+ }