Browse Source

事件定位

彭宇 2 years ago
parent
commit
e68ae6a857
3 changed files with 26 additions and 28 deletions
  1. 1 1
      src/api/event.js
  2. 24 24
      src/components/eventLocation.vue
  3. 1 3
      vue.config.js

+ 1 - 1
src/api/event.js

@@ -10,7 +10,7 @@ export function getNearEvent(longitude,latitude) {
 //获取附近摄像头
 export function getNearCamera(longitude,latitude) {
   return request({
-    url: '/center-village/VisuVillageCloudController/getNearCamera?longitude='+longitude+"&latitude="+latitude+"&type=1",
+    url: '/center-village/VisuVillageCloudController/getNearCamera?longitude='+longitude+"&latitude="+latitude,
     method: 'get',
   })
 }

+ 24 - 24
src/components/eventLocation.vue

@@ -315,11 +315,11 @@ export default {
         isAggregation: false
       }]
       let that = this
-      getNearEvent(this.longitude, this.latitude).then(res => {
+      getNearEvent(that.longitude, that.latitude).then(res => {
         that.markersList = []
         that.eventList = res.data
-        if (this.eventList != null && this.eventList.length > 0) {
-          for (let i = 0; i < this.eventList.length; i++) {
+        if (that.eventList != null && that.eventList.length > 0) {
+          for (let i = 0; i < that.eventList.length; i++) {
             let markersMap = {
               lng: 124.59,
               lat: 43.02,
@@ -330,58 +330,58 @@ export default {
               keepBindPopup: false,
               isAggregation: false
             }
-            if (this.eventList.length > 200) {
+            if (that.eventList.length > 200) {
               markersMap.isAggregation = true
             }
-            if (this.eventList[i].eventStatusValue == 'forest_event_status_1') {
+            if (that.eventList[i].eventStatusValue == 'forest_event_status_1') {
               markersMap.click = 'showEventDialog'
               markersMap.icon = 'sj-icon-map-xinshangbao'
             }
-            if (this.eventList[i].eventStatusValue == 'forest_event_status_1' && this.eventList[i].urgeCount > 0) {
+            if (that.eventList[i].eventStatusValue == 'forest_event_status_1' && that.eventList[i].urgeCount > 0) {
               markersMap.click = 'showEventDialog'
               markersMap.icon = 'sj-icon-map-cuiban'
-            } else if (this.eventList[i].eventStatusValue == 'forest_event_status_2') {
+            } else if (that.eventList[i].eventStatusValue == 'forest_event_status_2') {
               markersMap.click = 'showEventDialog'
               markersMap.icon = 'sj-icon-map-qianshou'
               markersMap.isAggregation = false
-            } else if (this.eventList[i].eventStatusValue == 'forest_event_status_5') {
+            } else if (that.eventList[i].eventStatusValue == 'forest_event_status_5') {
               markersMap.click = 'showEventDialog'
               markersMap.icon = 'sj-icon-map-banjie'
               markersMap.isAggregation = false
-            } else if (this.eventList[i].eventStatusValue == 'forest_event_status_6') {
+            } else if (that.eventList[i].eventStatusValue == 'forest_event_status_6') {
               markersMap.click = 'showEventDialog'
               markersMap.icon = 'sj-icon-map-guidang'
             }
-            markersMap.parameter = this.eventList[i].eventCode
-            markersMap.lng = this.eventList[i].longitude
-            markersMap.lat = this.eventList[i].latitude
+            markersMap.parameter = that.eventList[i].eventCode
+            markersMap.lng = that.eventList[i].longitude
+            markersMap.lat = that.eventList[i].latitude
             markersMap.bindPopupHtml = '<div class="map-tip">' +
               '<span>' +
               '                  <div class="d-l-con">' +
               '                  <div class="d-l-l-text">' +
-              '                  <h4>经纬度:' + this.eventList[i].longitude + ',' + this.eventList[i].latitude + '</h4>' +
+              '                  <h4>经纬度:' + that.eventList[i].longitude + ',' + that.eventList[i].latitude + '</h4>' +
               '                </div>' +
               '                </div>' +
               '                </span>' +
               '<span>' +
               '                  <div class="d-l-con">' +
               '                  <div class="d-l-l-text">' +
-              '                  <h4>事件名称:' + this.eventList[i].eventName + '</h4>' +
+              '                  <h4>事件名称:' + that.eventList[i].eventName + '</h4>' +
               '                </div>' +
               '                </div>' +
               '                </span>' +
               '<span>' +
               '                  <div class="d-l-con">' +
               '                  <div class="d-l-l-text">' +
-              '                  <h4>事件时间:' + this.eventList[i].reportTime + '</h4>' +
+              '                  <h4>事件时间:' + that.eventList[i].reportTime + '</h4>' +
               '                </div>' +
               '                </div>' +
               '                </span>'
-            if(this.eventList[i].pictureType=='image'&&this.eventList[i].picturePath != null && this.eventList[i].picturePath != ''){
+            if(that.eventList[i].pictureType=='image'&&that.eventList[i].picturePath != null && that.eventList[i].picturePath != ''){
               markersMap.bindPopupHtml += '<span>' +
                 '                  <div class="d-l-con">' +
                 '                  <div class="d-l-l-text">' +
-                '<img src="' + this.eventList[i].picturePath + '" style="width: 150px;height: 100px"/>' +
+                '<img src="' + that.eventList[i].picturePath + '" style="width: 150px;height: 100px"/>' +
                 '                </div>' +
                 '                </div>' +
                 '                </span>'
@@ -406,8 +406,8 @@ export default {
       let that = this
       that.$refs.eventLocationSupermap.controlLevel(8)
       let marker = [{
-        lng: this.longitude,
-        lat: this.latitude,
+        lng: that.longitude,
+        lat: that.latitude,
         icon: 'marker',
         bindPopupHtml: '定位',
         click: '',
@@ -416,13 +416,13 @@ export default {
         isAggregation: false
       }]
       if (tab.name == 'monitor') {
-        if (this.longitude == null || this.longitude == '' || this.latitude == null || this.latitude == '') {
-          this.$modal.msgError('请输入经纬度!')
+        if (that.longitude == null || that.longitude == '' || that.latitude == null || that.latitude == '') {
+          that.$modal.msgError('请输入经纬度!')
           return
         }
         that.cameraMarkersList = []
         that.cameraList = []
-        getNearCamera(this.longitude, this.latitude).then(res => {
+        getNearCamera(that.longitude, that.latitude).then(res => {
           //根据设备类型查看列表
           that.cameraList = res.data
 
@@ -479,12 +479,12 @@ export default {
                 '                </div>' +
                 '                </span>' +
                 '</div>'
-              this.cameraMarkersList.push(markersMap)
+              that.cameraMarkersList.push(markersMap)
             }
             setTimeout(() => {
               that.$refs.eventLocationSupermap.clearM(true)
               that.$refs.eventLocationSupermap.clearM(false)
-              that.$refs.eventLocationSupermap.setMarkersRadius(this.cameraMarkersList)
+              that.$refs.eventLocationSupermap.setMarkersRadius(that.cameraMarkersList)
               that.$refs.eventLocationSupermap.setMarkers(marker)
             }, 1000)
           }

+ 1 - 3
vue.config.js

@@ -52,9 +52,7 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        // target: `http://192.168.1.113:3031`,
-        target: `http://36.49.108.22:3031`,
-        // target: `http://192.168.31.98:3031`,
+        target: `http://117.78.49.164:3031`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''