wangkang3 4 jaren geleden
bovenliggende
commit
0372f32d34

+ 22 - 2
ebc-middle-platform/src/http.js

153
 * @returns {Object|Promise} 返回`Axios`响应对象或Promise对象
153
 * @returns {Object|Promise} 返回`Axios`响应对象或Promise对象
154
 */
154
 */
155
function responseInterceptor(response) {
155
function responseInterceptor(response) {
156
  console.log(response)
156
  GLoading.$create().finish()
157
  GLoading.$create().finish()
157
  return response
158
  if (response.data.success) {
159
    return response.data
160
  } else {
161
    TMessage.danger(response.data.fail.message)
162
  }
163
  // return response
158
}
164
}
159
165
160
/**
166
/**
178
  return Promise.reject(error)
184
  return Promise.reject(error)
179
}
185
}
180
186
187
// axios.interceptors.response.use(
188
//   response => {
189
//     console.log(response)
190
//     if (response.data.success) {
191
//       return response
192
//     } else {
193
//       // this.$Message.warning(response.data.fail.message)
194
//     }
195
//   },
196
//   error => {
197
//     return Promise.reject(error)
198
//   }
199
// )
200
181
// 默认服务调用拦截器设置
201
// 默认服务调用拦截器设置
182
http.$http.interceptors.request.use(requestInterceptor, requestError)
202
http.$http.interceptors.request.use(requestInterceptor, requestError)
183
http.$http.interceptors.response.use(responseInterceptor, responseError)
203
http.$test.interceptors.response.use(responseInterceptor, responseError)
184
204
185
// 注册插件
205
// 注册插件
186
Vue.use(HttpPlugin)
206
Vue.use(HttpPlugin)

+ 1 - 0
ebc-middle-platform/src/modules/system-management/equipment-management.scss

44
  }
44
  }
45
}
45
}
46
.loading--fix{
46
.loading--fix{
47
  position: absolute;
47
  color: #000;
48
  color: #000;
48
  background-color: rgba(255, 255, 255, 0.8);
49
  background-color: rgba(255, 255, 255, 0.8);
49
}
50
}

+ 32 - 36
ebc-middle-platform/src/modules/system-management/equipment-management.vue

379
  },
379
  },
380
  methods: {
380
  methods: {
381
    async getType() {
381
    async getType() {
382
      this.fullLoading = true
382
      await this.$test.post(services.equipment.EQUIPMENT_TYPE, {}
383
      await this.$test.post(services.equipment.EQUIPMENT_TYPE, {}
383
      ).then(res => {
384
      ).then(res => {
384
        // 请求成功处理...
385
        // 请求成功处理...
385
        if (res.data.success) {
386
          this.typeList = res.data.data
387
        }
386
        this.fullLoading = false
387
        this.typeList = res.data
388
      }).catch(res => {
388
      }).catch(res => {
389
        // 请求失败处理...
389
        // 请求失败处理...
390
        this.fullLoading = false
390
      })
391
      })
391
    },
392
    },
392
    getList() {
393
    getList() {
404
        // 请求成功处理...
405
        // 请求成功处理...
405
        console.log(res)
406
        console.log(res)
406
        this.tableLoading = false
407
        this.tableLoading = false
407
        if (res.data.success) {
408
          this.table.data = res.data.data.data
409
          this.table.pager.total = res.data.data.total
410
        }
408
        this.table.data = res.data.data
409
        this.table.pager.total = res.data.total
411
      }).catch(res => {
410
      }).catch(res => {
412
        // 请求失败处理...
411
        // 请求失败处理...
412
        this.tableLoading = false
413
      })
413
      })
414
    },
414
    },
415
    type_formatter(row, column) {
415
    type_formatter(row, column) {
445
    },
445
    },
446
    checkReptition(data) {
446
    checkReptition(data) {
447
      return new Promise((resolve) => {
447
      return new Promise((resolve) => {
448
        this.fullLoading = true
448
        this.$test.post(services.equipment.GET_EQUIPMENT, {
449
        this.$test.post(services.equipment.GET_EQUIPMENT, {
449
          pageNumber: 1,
450
          pageNumber: 1,
450
          pageSize: 10,
451
          pageSize: 10,
452
        }
453
        }
453
        ).then(res => {
454
        ).then(res => {
454
        // 请求成功处理...
455
        // 请求成功处理...
456
          this.fullLoading = false
455
          console.log(res)
457
          console.log(res)
456
          if (res.data.success) {
457
            if (res.data.data.totalPage > 0 && res.data.data.data[0].resourceToolId === this.updateRow.resourceToolId) {
458
              resolve(false)
459
            } else {
460
              resolve(res.data.data.totalPage > 0)
461
            }
462
          } else {
458
          if (res.data.totalPage > 0 && res.data.data[0].resourceToolId === this.updateRow.resourceToolId) {
463
            resolve(false)
459
            resolve(false)
460
          } else {
461
            resolve(res.data.totalPage > 0)
464
          }
462
          }
465
        }).catch(res => {
463
        }).catch(res => {
466
        // 请求失败处理...
464
        // 请求失败处理...
465
          this.fullLoading = false
467
          resolve(false)
466
          resolve(false)
468
        })
467
        })
469
      })
468
      })
504
          ).then(res => {
503
          ).then(res => {
505
            // 请求成功处理...
504
            // 请求成功处理...
506
            this.fullLoading = false
505
            this.fullLoading = false
507
            if (res.data.success) {
508
              this.$Message.success('提交成功!')
509
              this.getList()
510
              this.modal = false
511
              this.formValidate = {
512
                type: '',
513
                name: '',
514
                radius: null,
515
                number: '',
516
                lng: '',
517
                lat: ''
518
              }
506
            this.$Message.success('提交成功!')
507
            this.getList()
508
            this.modal = false
509
            this.formValidate = {
510
              type: '',
511
              name: '',
512
              radius: null,
513
              number: '',
514
              lng: '',
515
              lat: ''
519
            }
516
            }
520
          }).catch(res => {
517
          }).catch(res => {
521
            // 请求失败处理...
518
            // 请求失败处理...
519
            this.fullLoading = false
522
          })
520
          })
523
        } else {
521
        } else {
524
          this.$Message.danger('表单验证失败!')
522
          this.$Message.danger('表单验证失败!')
537
          ).then(res => {
535
          ).then(res => {
538
            // 请求成功处理...
536
            // 请求成功处理...
539
            this.fullLoading = false
537
            this.fullLoading = false
540
            if (res.data.success) {
541
              this.$Message.success('提交成功!')
542
              this.getList()
543
              this.updateModal = false
544
            }
538
            this.$Message.success('提交成功!')
539
            this.getList()
540
            this.updateModal = false
545
          }).catch(res => {
541
          }).catch(res => {
546
            // 请求失败处理...
542
            // 请求失败处理...
543
            this.fullLoading = false
547
          })
544
          })
548
        } else {
545
        } else {
549
          this.$Message.danger('表单验证失败!')
546
          this.$Message.danger('表单验证失败!')
580
          ).then(res => {
577
          ).then(res => {
581
            // 请求成功处理...
578
            // 请求成功处理...
582
            this.fullLoading = false
579
            this.fullLoading = false
583
            if (res.data.success) {
584
              this.$Message.success('操作成功')
585
              this.table.pager.currentPage = 1
586
              this.getList()
587
            }
580
            this.$Message.success('操作成功')
581
            this.table.pager.currentPage = 1
582
            this.getList()
588
          }).catch(res => {
583
          }).catch(res => {
589
            // 请求失败处理...
584
            // 请求失败处理...
585
            this.fullLoading = false
590
          })
586
          })
591
        }
587
        }
592
      })
588
      })

+ 1 - 0
ebc-middle-platform/src/modules/system-management/map-mark.scss

47
  }
47
  }
48
}
48
}
49
.loading--fix{
49
.loading--fix{
50
  position: absolute;
50
  color: #000;
51
  color: #000;
51
  background-color: rgba(255, 255, 255, 0.8);
52
  background-color: rgba(255, 255, 255, 0.8);
52
}
53
}

+ 19 - 3
ebc-middle-platform/src/modules/system-management/map-mark.vue

266
  },
266
  },
267
  methods: {
267
  methods: {
268
    getDepartmentsList() {
268
    getDepartmentsList() {
269
      this.fullLoading = true
269
      this.$test
270
      this.$test
270
        .post(services.workEmployee.GET_ALL_ORGANIZE, {})
271
        .post(services.workEmployee.GET_ALL_ORGANIZE, {})
271
        .then((res) => {
272
        .then((res) => {
272
          // 请求成功处理...
273
          // 请求成功处理...
274
          this.fullLoading = false
273
          this.departments = res.data
275
          this.departments = res.data
274
          // this.onReset()
276
          // this.onReset()
275
        })
277
        })
276
        .catch((res) => {
278
        .catch((res) => {
277
          // 请求失败处理...
279
          // 请求失败处理...
280
          this.fullLoading = false
278
        })
281
        })
279
    },
282
    },
280
    getTagType() {
283
    getTagType() {
284
      this.fullLoading = true
281
      this.$test
285
      this.$test
282
        .post(services.mapTag.MAP_TAG_TYPE, {})
286
        .post(services.mapTag.MAP_TAG_TYPE, {})
283
        .then((res) => {
287
        .then((res) => {
284
          // 请求成功处理...
288
          // 请求成功处理...
289
          this.fullLoading = false
285
          console.log(res)
290
          console.log(res)
286
          this.markTypes = res.data.dataList
291
          this.markTypes = res.data
287
        })
292
        })
288
        .catch((res) => {
293
        .catch((res) => {
289
          // 请求失败处理...
294
          // 请求失败处理...
295
          this.fullLoading = false
290
        })
296
        })
291
    },
297
    },
292
    loadMap() {
298
    loadMap() {
349
        })
355
        })
350
        .catch((res) => {
356
        .catch((res) => {
351
          // 请求失败处理...
357
          // 请求失败处理...
358
          this.tableLoading = false
352
        })
359
        })
353
    },
360
    },
354
    type_formatter(row, column) {
361
    type_formatter(row, column) {
569
      this.getList()
576
      this.getList()
570
    },
577
    },
571
    handleClick(row) {
578
    handleClick(row) {
579
      this.fullLoading = true
572
      this.$test
580
      this.$test
573
        .post(services.mapTag.GET_ONE_MAP_TAG, {
581
        .post(services.mapTag.GET_ONE_MAP_TAG, {
574
          mapTagId: row.mapAreaId
582
          mapTagId: row.mapAreaId
575
        })
583
        })
576
        .then((res) => {
584
        .then((res) => {
577
          // 请求成功处理...
585
          // 请求成功处理...
586
          this.fullLoading = false
578
          this.modalData = []
587
          this.modalData = []
579
          var color
588
          var color
580
          if (row.businessType == '3') {
589
          if (row.businessType == '3') {
584
          } else {
593
          } else {
585
            color = 'blue'
594
            color = 'blue'
586
          }
595
          }
587
          var coverLayer = new Ai.Polygon(res.data.resultData.mapAreaContent, {color: color, opacity: 1.0})
596
          var coverLayer = new Ai.Polygon(res.data[0].mapAreaContent, {color: color, opacity: 1.0})
588
          // this.map.addLayer(coverLayer_blue)
597
          // this.map.addLayer(coverLayer_blue)
589
          // 面设为编辑状态
598
          // 面设为编辑状态
590
          coverLayer.snapediting = new Ai.PolylineSnap(
599
          coverLayer.snapediting = new Ai.PolylineSnap(
601
        })
610
        })
602
        .catch((res) => {
611
        .catch((res) => {
603
          // 请求失败处理...
612
          // 请求失败处理...
613
          this.fullLoading = false
604
        })
614
        })
605
      this.markName = row.mapAreaName
615
      this.markName = row.mapAreaName
606
      this.markType = row.businessType
616
      this.markType = row.businessType
704
      this.selection = arr
714
      this.selection = arr
705
    },
715
    },
706
    batchDelete() {
716
    batchDelete() {
707
      this.delete(this.selection)
717
      this.$Confirm.confirm({
718
        title: '请确认',
719
        content: '删除后不可恢复,确认删除吗?',
720
        ok: () => {
721
          this.delete(this.selection)
722
        }
723
      })
708
    },
724
    },
709
    delete(ids) {
725
    delete(ids) {
710
      this.fullLoading = true
726
      this.fullLoading = true

+ 1 - 0
ebc-middle-platform/src/modules/system-management/terminal-management.scss

92
  color: #ffffff;
92
  color: #ffffff;
93
}
93
}
94
.loading--fix{
94
.loading--fix{
95
  position: absolute;
95
  color: #000;
96
  color: #000;
96
  background-color: rgba(255, 255, 255, 0.8);
97
  background-color: rgba(255, 255, 255, 0.8);
97
}
98
}