Parcourir la source

未覆盖区域

qinhouyu il y a 2 ans
Parent
commit
5f2f43878c
2 fichiers modifiés avec 32 ajouts et 0 suppressions
  1. 8 0
      src/api/monitor.js
  2. 24 0
      src/views/monitor.vue

+ 8 - 0
src/api/monitor.js

@@ -97,3 +97,11 @@ export function getMonitorDeviceAndDataList(deptId) {
   })
 }
 
+//未覆盖区域
+export function notCoverPlaces(deptId) {
+  return request({
+    url: `/center-data/camera/getList?deptId=${deptId}`,
+    method: 'get',
+  })
+}
+

+ 24 - 0
src/views/monitor.vue

@@ -146,6 +146,7 @@
     getDlblistBydeptId,
     selectKeyAreaList,
     getRegionalFlag,
+    notCoverPlaces,
     getCamerasByDeptId,
     getMonitorDeviceAndDataList
   } from '@/api/monitor'
@@ -207,6 +208,8 @@
         this.getMonitorDeviceAndDataLists()
         // this.getDlblistBydeptIds()
         this.selectDeviceType(-1)
+        this.getNotCoverPlaces(this.deptId);
+
         // this.showTVWall();
       }, 2000)
     },
@@ -290,6 +293,24 @@
       }
     },
     methods: {
+      getNotCoverPlaces(deptId) {
+        let that = this;
+        notCoverPlaces(deptId).then((res) => {
+          if (res.data != null && Array.isArray(res.data)) {
+            for (let i = 0; i < res.data.length; i++) {
+              if (res.data[i].latLngs != null && res.data[i].latLngs != "") {
+                let jsonToArr = JSON.parse(res.data[i].latLngs);
+                const arr = []
+                for (let j = 0; j < jsonToArr.length; j++) {
+                  arr.push(jsonToArr[j].lng)
+                  arr.push(jsonToArr[j].lat)
+                  that.$refs.supermap.setGraphicsList(arr, "rgba(23,22,22,0)", 0.8);
+                }
+              }
+            }
+          }
+        })
+      },
       //初始化地图数据
       getSuperMapUrl(){
         getUserProfile().then(response => {
@@ -427,6 +448,8 @@
         this.localMark = 'she'
         this.placeholderMsg = "请输入摄像头名称"
         this.selectDeviceType()
+        this.getNotCoverPlaces(this.deptId);
+
       },
       laClick() {
         this.onLa = true
@@ -445,6 +468,7 @@
         this.placeholderMsg = "请输入传感器名称"
         this.deptId = Cookies.get("deptId")
         this.getMonitorDeviceAndDataList()
+
       },
       chuanSet() {
         let that = this