彭宇 1 rok temu
rodzic
commit
f155900979
2 zmienionych plików z 36 dodań i 2 usunięć
  1. 8 0
      src/api/monitor.js
  2. 28 2
      src/views/monitor.vue

+ 8 - 0
src/api/monitor.js

@@ -23,3 +23,11 @@ export function selectKeyAreaList() {
     params:{"areaType":2}
   })
 }
+// 获取重点区域
+export function selectKeyAreaList() {
+  return request({
+    url: '/center-data/importarea/listFegin',
+    method: 'get',
+    params:{"areaType":2}
+  })
+}

+ 28 - 2
src/views/monitor.vue

@@ -78,7 +78,7 @@
               <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;" :color="['#935713', '#ebd033']"/>
             </div>
             <div class="i-list-con h-25">
-              <div class="d-l-con" v-for="(item,index) in keyAreaList" @click="">
+              <div class="d-l-con" v-for="(item,index) in keyAreaList" :class="{on:listCurrentIndex3 == index}" @click="getRegionalFlag(item.id)">
                 <div class="d-l-l-text">
                   <i class="i-small"></i>
                   <h4>{{ item.areaName }}</h4>
@@ -111,7 +111,8 @@
 import {
   selectDeviceType,
   selectCameraByDeptId,
-  selectKeyAreaList
+  selectKeyAreaList,
+  getRegionalFlag
 } from '@/api/monitor'
 
 import supermap from '@/components/supermap' //超图
@@ -162,6 +163,7 @@ export default {
       iconCurrentIndex1: '-1',
       listCurrentIndex1: '-1',
       listCurrentIndex2: '-1',
+      listCurrentIndex3: '-1',
       /** ----------------------------------摄像头预览开始------------------------------------- */
       //大华
       activePanel: 'key1',
@@ -369,6 +371,30 @@ export default {
         that.keyAreaList = res
       })
     },
+    getRegionalFlag(id){
+      //获取重点区域
+      this.listCurrentIndex3=id
+      let that = this
+      getRegionalFlag(id).then(res => {
+        that.graphicsList=[]
+        //地图标记
+        if (res.data != null && res.data.length > 0) {
+          for (let i = 0; i < res.data.length; i++) {
+            let latlng = {
+              lat: res.data[i].lat,
+              lng: res.data[i].lng
+            }
+            that.graphicsList.push(latlng)
+          }
+          setTimeout(() => {
+            that.$refs.supermap.clearG()
+            that.$refs.supermap.setGraphicsList(this.graphicsList, 'red')
+          }, 1000)
+        } else {
+          that.$refs.supermap.clearG()
+        }
+      })
+    },
     selectDeviceType(index) {
       this.iconCurrentIndex1 = index
       //获取左侧动态感知设备