vue2-client 1.2.84 → 1.2.88

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 (27) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/package.json +94 -94
  3. package/src/App.vue +2 -1
  4. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +225 -225
  5. package/src/base-client/components/common/AmapMarker/index.js +3 -3
  6. package/src/base-client/components/common/ScrollList/SrcollList.vue +113 -113
  7. package/src/base-client/components/common/ScrollList/index.js +3 -3
  8. package/src/base-client/components/common/XTable/XTable.vue +2 -2
  9. package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +232 -232
  10. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +678 -678
  11. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsException.vue +57 -57
  12. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsRead.vue +131 -131
  13. package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +300 -300
  14. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +770 -770
  15. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  16. package/src/base-client/plugins/AppData.js +0 -2
  17. package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
  18. package/src/pages/login/Login.vue +62 -51
  19. package/src/pages/resourceManage/orgListManage.vue +98 -98
  20. package/src/router/async/config.async.js +26 -26
  21. package/src/router/index.js +27 -27
  22. package/src/services/api/WebmeterAnalysisViewApi.js +20 -20
  23. package/src/services/api/index.js +39 -39
  24. package/src/services/api/iot/DeviceDetailsView/DeviceDetailsCountApi.js +18 -18
  25. package/src/theme/default/style.less +47 -47
  26. package/src/utils/map-utils.js +31 -31
  27. package/src/utils/request.js +24 -7
@@ -1,18 +1,18 @@
1
- const DeviceDetailsCountApi = {
2
- // 获取设备使用天数
3
- getDeviceUsedDaySum: '/webmeterapi/getDeviceUsedDaySum',
4
- // 获取设备累计上报次数和近七天上报情况
5
- getDeviceUploadTimesCount: '/webmeterapi/getDeviceUploadTimesCount',
6
- // 获取设备累计失联次数和近三个月失联情况
7
- getDeviceLostContactCount: '/webmeterapi/getDeviceLostContactCount',
8
- // 获取设备指令下发成功率
9
- getInstructRateOfSuccess: '/webmeterapi/getInstructRateOfSuccess',
10
- // 获取设备上报情况
11
- getDeviceUploadCountData: '/webmeterapi/getDeviceUploadCountData',
12
- // 获取设备失联情况
13
- getDeviceLostContactCountData: '/webmeterapi/getDeviceLostContactCountData',
14
- // 获取设备失联排行榜
15
- getDeviceLostContactRankData: '/webmeterapi/getDeviceLostContactRankData'
16
- }
17
-
18
- export { DeviceDetailsCountApi }
1
+ const DeviceDetailsCountApi = {
2
+ // 获取设备使用天数
3
+ getDeviceUsedDaySum: '/webmeterapi/getDeviceUsedDaySum',
4
+ // 获取设备累计上报次数和近七天上报情况
5
+ getDeviceUploadTimesCount: '/webmeterapi/getDeviceUploadTimesCount',
6
+ // 获取设备累计失联次数和近三个月失联情况
7
+ getDeviceLostContactCount: '/webmeterapi/getDeviceLostContactCount',
8
+ // 获取设备指令下发成功率
9
+ getInstructRateOfSuccess: '/webmeterapi/getInstructRateOfSuccess',
10
+ // 获取设备上报情况
11
+ getDeviceUploadCountData: '/webmeterapi/getDeviceUploadCountData',
12
+ // 获取设备失联情况
13
+ getDeviceLostContactCountData: '/webmeterapi/getDeviceLostContactCountData',
14
+ // 获取设备失联排行榜
15
+ getDeviceLostContactRankData: '/webmeterapi/getDeviceLostContactRankData'
16
+ }
17
+
18
+ export { DeviceDetailsCountApi }
@@ -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,31 +1,31 @@
1
- import AMapLoader from '@amap/amap-jsapi-loader'
2
- let Amap
3
- async function GetGDMap () {
4
- if (!Amap) {
5
- window._AMapSecurityConfig = {
6
- securityJsCode:'275e59edb26ab1f917cfe7f05bea7979'
7
- }
8
- Amap = await AMapLoader.load({
9
- key: '55a4807a6fc3adca5510f69578b1ae4a', // 申请好的Web端开发者Key,首次调用 load 时必填
10
- version: '1.4.2', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
11
- plugins: ['AMap.ToolBar', 'AMap.Geolocation', 'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.Autocomplete'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
12
- })
13
- }
14
- return Amap
15
- }
16
- async function GetLocation (address) {
17
- return new Promise(async (resolve, reject) => {
18
- new (await GetGDMap()).Geocoder({
19
- radius: 500 // 范围,默认:500
20
- }).getLocation(address, function (status, result) {
21
- console.log(result)
22
- if (status === 'complete' && result.geocodes.length) {
23
- resolve({ lng: result.geocodes[0].location.lng, lat: result.geocodes[0].location.lat })
24
- } else {
25
- // eslint-disable-next-line prefer-promise-reject-errors
26
- reject('根据经纬度查询地址失败')
27
- }
28
- })
29
- })
30
- }
31
- export { GetGDMap, GetLocation }
1
+ import AMapLoader from '@amap/amap-jsapi-loader'
2
+ let Amap
3
+ async function GetGDMap () {
4
+ if (!Amap) {
5
+ window._AMapSecurityConfig = {
6
+ securityJsCode: '275e59edb26ab1f917cfe7f05bea7979'
7
+ }
8
+ Amap = await AMapLoader.load({
9
+ key: '55a4807a6fc3adca5510f69578b1ae4a', // 申请好的Web端开发者Key,首次调用 load 时必填
10
+ version: '1.4.2', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
11
+ plugins: ['AMap.ToolBar', 'AMap.Geolocation', 'AMap.Geocoder', 'AMap.MarkerClusterer', 'AMap.Autocomplete'], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
12
+ })
13
+ }
14
+ return Amap
15
+ }
16
+ async function GetLocation (address) {
17
+ return new Promise(async (resolve, reject) => {
18
+ new (await GetGDMap()).Geocoder({
19
+ radius: 500 // 范围,默认:500
20
+ }).getLocation(address, function (status, result) {
21
+ console.log(result)
22
+ if (status === 'complete' && result.geocodes.length) {
23
+ resolve({ lng: result.geocodes[0].location.lng, lat: result.geocodes[0].location.lat })
24
+ } else {
25
+ // eslint-disable-next-line prefer-promise-reject-errors
26
+ reject('根据经纬度查询地址失败')
27
+ }
28
+ })
29
+ })
30
+ }
31
+ export { GetGDMap, GetLocation }
@@ -4,7 +4,7 @@ import Vue from 'vue'
4
4
  import { ACCESS_TOKEN } from '@vue2-client/store/mutation-types'
5
5
  import notification from 'ant-design-vue/es/notification'
6
6
 
7
- const setting = require('../config/default/setting.config')
7
+ let compatible
8
8
 
9
9
  // 跨域认证信息 header 名
10
10
  const xsrfHeaderName = 'Authorization'
@@ -151,12 +151,16 @@ function checkAuthorization (authType = AUTH_TYPE.BEARER) {
151
151
  function loadInterceptors () {
152
152
  // 加载请求拦截器
153
153
  axios.interceptors.request.use(config => {
154
- const token = localStorage.getItem(ACCESS_TOKEN)
154
+ const token = localStorage.getItem('ACCESS_TOKEN')
155
155
  // 如果 token 存在
156
156
  // 让每个请求携带自定义 token 请根据实际情况自行修改
157
157
  if (token) {
158
+ // 如果是首次使用系统LocalStorage需要初始化,在登陆之后重新获取一次compatible
159
+ if (compatible === null) {
160
+ compatible = localStorage.getItem('compatible')
161
+ }
158
162
  // 判断是否为V4环境
159
- if (setting.compatible === 'V4') {
163
+ if (compatible === 'V4') {
160
164
  // V4 环境则添加 V4请求头
161
165
  config.headers['ACCESS_TOKEN'] = localStorage.getItem('ACCESS_TOKEN')
162
166
  config.headers['ACCESS_TOKEN_EXPIRES'] = localStorage.getItem('ACCESS_TOKEN_EXPIRES')
@@ -171,7 +175,20 @@ function loadInterceptors () {
171
175
  }, errorHandler)
172
176
  // 加载响应拦截器
173
177
  axios.interceptors.response.use((response) => {
174
- return response.data
178
+ // 判断是否为V4环境,不为compatible赋初始值
179
+ // 其有可能是undefined未定义,或第一次使用本系统LocalStorage在初始化,获得的值为null
180
+ if (compatible === null || compatible === undefined) {
181
+ compatible = localStorage.getItem('compatible')
182
+ }
183
+ if (compatible === 'V4') {
184
+ if (response.data.data) {
185
+ return response.data.data
186
+ } else {
187
+ return response.data
188
+ }
189
+ } else {
190
+ return response.data
191
+ }
175
192
  }, errorHandler)
176
193
  }
177
194
 
@@ -181,12 +198,12 @@ const errorHandler = (error) => {
181
198
  const data = error.response.data
182
199
  // 从 localstorage 获取 token
183
200
  const token = localStorage.getItem(ACCESS_TOKEN)
184
- if (error.response.status === 403) {
201
+ if (error.response.status === 403 || data.code === 403) {
185
202
  notification.error({
186
203
  message: '禁止访问',
187
204
  description: data
188
205
  })
189
- } else if (error.response.status === 401 && !(data.result && data.result.isLogin)) {
206
+ } else if ((error.response.status === 401 || data.code === 401) && !(data.result && data.result.isLogin)) {
190
207
  notification.error({
191
208
  message: '鉴权失败',
192
209
  description: data
@@ -198,7 +215,7 @@ const errorHandler = (error) => {
198
215
  }, 1500)
199
216
  })
200
217
  }
201
- } else if (error.response.status === 500) {
218
+ } else if (error.response.status === 500 || data.code === 500) {
202
219
  notification.error({
203
220
  message: '系统异常',
204
221
  description: data