Преглед изворни кода

Merge remote-tracking branch 'origin/visu_water' into visu_water

王通 пре 2 година
родитељ
комит
8331ea8c87

+ 3 - 2
src/api/event.js

@@ -1,15 +1,16 @@
 import request from '@/utils/request'
 
 //获取附近事件
-export function getNearEvent(longitude,latitude,day,loading) {
+export function getNearEvent(longitude, latitude, day, loading, eventTypeIdDl, eventTypeId) {
   return request({
-    url: '/center-water/VisuForestEventCenterController/getNearEvent?longitude='+longitude+"&latitude="+latitude+"&day="+day,
+    url: '/center-water/VisuForestEventCenterController/getNearEvent?longitude=' + longitude + "&latitude=" + latitude + "&day=" + day + "&eventTypeIdDl=" + eventTypeIdDl + "&eventTypeId=" + eventTypeId,
     method: 'get',
     headers: {
       loading: loading
     },
   })
 }
+
 //获取附近摄像头
 export function getNearCamera(longitude,latitude) {
   return request({

+ 15 - 0
src/api/forest.js

@@ -1,5 +1,20 @@
 import request from '@/utils/request'
 
+// 获取绑定的事件类型
+export function getMenuEventType() {
+  return request({
+    url: '/center-water/WaterController/getMenuEventType',
+    method: 'get',
+  })
+}
+// 获取事件详情
+export function getEventPush(param) {
+  return request({
+    url: '/center-water/WaterController/getEventPush',
+    method: 'post',
+    data: param
+  })
+}
 // 左侧获取部门信息
 export function getBaseInfo() {
   return request({

+ 1 - 0
src/store/getters.js

@@ -5,6 +5,7 @@ const getters = {
   visitedViews: state => state.tagsView.visitedViews,
   cachedViews: state => state.tagsView.cachedViews,
   token: state => state.user.token,
+  userId: state => state.user.id,
   avatar: state => state.user.avatar,
   name: state => state.user.name,
   introduction: state => state.user.introduction,

+ 6 - 1
src/store/modules/user.js

@@ -6,6 +6,7 @@ const user = {
     token: getToken(),
     name: '',
     avatar: '',
+    userId: '',
     roles: [],
     permissions: []
   },
@@ -28,6 +29,9 @@ const user = {
     },
     SET_PERMISSIONS: (state, permissions) => {
       state.permissions = permissions
+    },
+    SET_USERID: (state, userId) => {
+      state.userId = userId
     }
   },
 
@@ -65,6 +69,7 @@ const user = {
             commit('SET_ROLES', ['ROLE_DEFAULT'])
           }
           commit('SET_NAME', user.userName)
+          commit('SET_USERID', user.id)
           commit('SET_AVATAR', avatar)
           resolve(res)
         }).catch(error => {
@@ -85,7 +90,7 @@ const user = {
         })
       })
     },
-    
+
     // 退出系统
     LogOut({ commit, state }) {
       return new Promise((resolve, reject) => {

+ 15 - 8
src/views/eventdetailsdialog.vue

@@ -285,7 +285,7 @@
             </el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="事件类型" v-if="eventStatusButton=='qs'">
+        <el-form-item label="事件类型" v-if="eventStatusButton=='qs'&& eventTypeXl == null">
           <el-select v-model="sendEventType" placeholder="请选择事件类型!" clearable>
             <el-option
               v-for="item in eventTypeList"
@@ -1174,6 +1174,7 @@ export default {
       eventStatusValue: null,//事件状态
       eventId: null,//事件ID
       eventType: null,//事件类型-大类
+      eventTypeXl: null,//事件类型-小类
       dataStatus: null,//事件流程按钮
       deptId: null,//事件流程部门
       eventCode: null,
@@ -1656,12 +1657,16 @@ export default {
         if (eventStatus == 'qs') {//签收
           that.eventConfirmTitle = '事件签收'
           let param = { parentId: that.eventType }
-          await listSJfl(param).then(res => {
-            //事件类型
-            if (res.code == 200) {
-              that.eventTypeList = res.data
-            }
-          })
+          if(that.eventTypeXl != null){
+            that.sendEventType = that.eventTypeXl;
+          }else{
+            await listSJfl(param).then(res => {
+              //事件类型
+              if (res.code == 200) {
+                that.eventTypeList = res.data
+              }
+            })
+          }
           await listYuAn().then(res => {
             //关联预案
             if (res.code == 200) {
@@ -1899,6 +1904,7 @@ export default {
         that.longitude = res.data.catalogue.longitude
         that.latitude = res.data.catalogue.latitude
         that.eventName = res.data.catalogue.eventName
+        that.eventTypeXl = res.data.catalogue.eventTypeXl
         let markersMap = {
           lng: 124.59,
           lat: 43.02,
@@ -1936,7 +1942,7 @@ export default {
           that.$refs.supermapDialog.dropLocation10(res.data.catalogue.latitude, res.data.catalogue.longitude)
         }, 2000)
         if (res.data.centermonitorTCamera != null) {
-          that.cameraCode = res.data.centermonitorTCamera.cameraCode;
+          that.cameraCode = res.data.centermonitorTCamera.id;
           let markersMap = {
             lng: 124.59,
             lat: 43.02,
@@ -1983,6 +1989,7 @@ export default {
         that.latitude = res.data.catalogue.latitude
         that.longitude = res.data.catalogue.longitude
         that.eventName = res.data.catalogue.eventName
+        that.eventTypeXl = res.data.catalogue.eventTypeXl
         let markersMap = {
           lng: 124.59,
           lat: 43.02,

+ 165 - 0
src/views/from/dvCapsuleChart.vue

@@ -0,0 +1,165 @@
+<template>
+  <div class="dv-capsule-chart">
+    <template v-if="mergedConfig">
+      <div class="label-column">
+        <div v-for="item in mergedConfig.data" :key="item.name" style="cursor: pointer" @click="getEventList(item)">
+          {{ item.name }}
+        </div>
+        <div>&nbsp;</div>
+      </div>
+      <div class="capsule-container">
+        <div class="capsule-item" v-for="(capsule, index) in capsuleLength" :key="index" style="cursor: pointer" @click="getEventList(mergedConfig.data[index])">
+          <div
+            class="capsule-item-column"
+            :style="`width: ${capsule * 100}%; background-color: ${mergedConfig.colors[index % mergedConfig.colors.length]};`"
+          >
+            <div
+              v-if="mergedConfig.showValue"
+              class="capsule-item-value"
+            >{{ capsuleValue[index] }}
+            </div>
+          </div>
+        </div>
+
+        <div class="unit-label">
+          <div
+            v-for="(label, index) in labelData"
+            :key="label + index"
+          >{{ label }}
+          </div>
+        </div>
+      </div>
+
+      <div class="unit-text" v-if="mergedConfig.unit">{{ mergedConfig.unit }}</div>
+    </template>
+  </div>
+</template>
+
+<script>
+import {deepMerge} from '@jiaminghi/charts/lib/util/index'
+
+import {deepClone} from '@jiaminghi/c-render/lib/plugin/util'
+
+export default {
+  name: 'DvCapsuleChart',
+  props: {
+    config: {
+      type: Object,
+      default: () => ({})
+    }
+  },
+  data() {
+    return {
+      defaultConfig: {
+        /**
+         * @description Capsule chart data
+         * @type {Array<Object>}
+         * @default data = []
+         * @example data = [{ name: 'foo1', value: 100 }, { name: 'foo2', value: 100 }]
+         */
+        data: [],
+        /**
+         * @description Colors (hex|rgb|rgba|color keywords)
+         * @type {Array<String>}
+         * @default color = ['#37a2da', '#32c5e9', '#67e0e3', '#9fe6b8', '#ffdb5c', '#ff9f7f', '#fb7293']
+         * @example color = ['#000', 'rgb(0, 0, 0)', 'rgba(0, 0, 0, 1)', 'red']
+         */
+        colors: [
+          '#37a2da',
+          '#32c5e9',
+          '#67e0e3',
+          '#9fe6b8',
+          '#ffdb5c',
+          '#ff9f7f',
+          '#fb7293'
+        ],
+        /**
+         * @description Chart unit
+         * @type {String}
+         * @default unit = ''
+         */
+        unit: '',
+        /**
+         * @description Show item value
+         * @type {Boolean}
+         * @default showValue = false
+         */
+        showValue: false
+      },
+
+      mergedConfig: null,
+
+      capsuleLength: [],
+      capsuleValue: [],
+      labelData: [],
+      labelDataLength: []
+    }
+  },
+  watch: {
+    config() {
+      const {calcData} = this
+      calcData()
+    }
+  },
+  methods: {
+    getEventList(val) {
+      debugger
+      let args = {eventTypeIdDl: [], eventTypeId: []}
+      if (val.id != '0') {
+        args.eventTypeIdDl.push(-1)
+        args.eventTypeId.push(val.id)
+      } else {
+        args.eventTypeIdDl.push(val.parentId)
+        args.eventTypeId.push(-1)
+      }
+      this.$emit('setEventTypeId', args)
+
+    },
+    calcData() {
+      const {mergeConfig, calcCapsuleLengthAndLabelData} = this
+
+      mergeConfig()
+
+      calcCapsuleLengthAndLabelData()
+    },
+    mergeConfig() {
+      let {config, defaultConfig} = this
+
+      this.mergedConfig = deepMerge(
+        deepClone(defaultConfig, true),
+        config || {}
+      )
+    },
+    calcCapsuleLengthAndLabelData() {
+      const {data} = this.mergedConfig
+
+      if (!data.length) return
+
+      const capsuleValue = data.map(({value}) => value)
+
+      const maxValue = Math.max(...capsuleValue)
+
+      this.capsuleValue = capsuleValue
+
+      this.capsuleLength = capsuleValue.map(v => (maxValue ? v / maxValue : 0))
+
+      const oneFifth = maxValue / 5
+
+      const labelData = Array.from(
+        new Set(new Array(6).fill(0).map((v, i) => Math.ceil(i * oneFifth)))
+      )
+
+      this.labelData = labelData
+
+      this.labelDataLength = Array.from(labelData).map(v =>
+        maxValue ? v / maxValue : 0
+      )
+    }
+  },
+  mounted() {
+    const {calcData} = this
+
+    calcData()
+  }
+}
+</script>

+ 37 - 7
src/views/leader.vue

@@ -77,7 +77,7 @@
                   <el-collapse-item v-for="(item,index) in xunLinListOne">
                     <template slot="title">
                       <div class="d-l-con sj-collapse"
-                           @click="getWaterRecord(item.id)">
+                           @click="getWaterRecord(item.id, item.patrolTrajectory)">
                         <div class="d-l-l-text">
                           <el-tooltip class="item" effect="dark" placement="left"
                                       style="width:10rem ;" :disabled="(item.taskName.length <= 20)">
@@ -171,8 +171,10 @@
 				indentText: '收起左右栏',
 				indentdisabled: false,
 				visuForestCloudRYBO: [], //人员类型列表
+        personId: null, //人员
 				peopleList: [], //人员列表
 				connectList: [], //画线
+        patrolTrajectory: null, //任务画线
 				xunLinListOne: [], //巡林任务
 				recordList: [], //巡查记录
 				showNothing: false, //暂无信息
@@ -288,25 +290,36 @@
 					this.peopleList = res.data
 				})
 				this.connectList = []
+        this.personId = null;
+				this.xunLinListOne = [];
+				this.patrolTrajectory = null;
 				this.$refs.supermap.clearC()
 			},
 			//点击左侧人员列表获取 巡林计划
 			getPlanList(personId) {
+			  if(this.personId == personId){//当前人员已经被点击一次 不再重复加载
+			    return;
+        }
+        this.personId = personId;
 				this.showNothing = false;
 				this.recordList = [];
 				getPlanList(personId).then(res => {
+          console.log("点击左侧人员列表获取 巡林计划=", res.data)
 					this.xunLinListOne = res.data;
 				})
-				this.$refs.supermap.clearC()
+        this.patrolTrajectory = null;
+				this.$refs.supermap.clearC();
 			},
 			//点击右侧巡林计划获取 巡查记录
-			getWaterRecord(id) {
+			getWaterRecord(id, patrolTrajectory) {
 				this.showNothing = false;
 				this.recordList = [];
 				getWaterRecord(id).then(res => {
+				  console.log("点击右侧巡林计划获取 巡查记录res.data=", res.data)
 					this.recordList = res.data;
 				})
-				this.$refs.supermap.clearC()
+				this.$refs.supermap.clearC();
+        this.setTaskPointList(patrolTrajectory);
 			},
 			//点击右侧巡查记录获取 巡查轨迹
 			getWaterPoint(id) {
@@ -315,7 +328,24 @@
 					this.setPointList(res);
 				})
 			},
-			//点击巡查轨迹时段 巡查轨迹落点
+			//点击巡查人员 巡查任务落点
+			setTaskPointList(patrolTrajectory) {
+				console.log("巡查任务落点", typeof JSON.parse(patrolTrajectory));
+        if(this.patrolTrajectory == patrolTrajectory){
+          this.patrolTrajectory = null;
+        }else {
+          this.patrolTrajectory = patrolTrajectory;
+          this.drawTaskPoint(this.patrolTrajectory);
+        }
+			},
+      // 巡查任务落点
+			drawTaskPoint(patrolTrajectory) {
+        setTimeout(() => {
+          this.$refs.supermap.clearC();
+          this.$refs.supermap.setConnectList(JSON.parse(patrolTrajectory), '#04f');
+        }, 1000)
+			},
+      //点击巡查轨迹时段 巡查轨迹落点
 			setPointList(res) {
 				let that = this;
 				this.connectList = [];
@@ -329,8 +359,8 @@
 						this.connectList.push(latlng)
 					}
 					setTimeout(() => {
-						that.$refs.supermap.clearC()
-						that.$refs.supermap.setConnectList(this.connectList, 'red')
+						// that.$refs.supermap.clearC()
+						that.$refs.supermap.setConnectList(this.connectList, '#f40')
 					}, 1000)
 				} else {
 					that.$refs.supermap.clearC()

+ 78 - 20
src/views/water.vue

@@ -388,12 +388,12 @@
           <div class="forthis">
             <dv-border-box-13 backgroundColor="rgba(12, 19, 38, .90)" style="padding-bottom: 1rem;">
               <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
-              <div class="this-title">
+              <div class="this-title" style="cursor: pointer" @click="setEventTypeId({eventTypeIdDl: [], eventTypeId: []})">
                 <span>事件分类</span>
                 <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;"/>
               </div>
               <div class="i-list-con small-bottom-margin h-19">
-                <dv-capsule-chart v-if="showEventKind" :config="eventKind"
+                <chart v-if="showEventKind" :config="eventKind"  @setEventTypeId="setEventTypeId"
                                   style="width: 90%;height: 18vh; padding:.5rem 1rem"/>
               </div>
             </dv-border-box-13>
@@ -438,6 +438,8 @@
   /** ----------------------------------weosocket结束------------------------------------- */
 
   import {
+    getMenuEventType,
+    getEventPush,
     getBaseInfo,
     getTodayEvents,
     getDeptEventCount,
@@ -459,6 +461,7 @@
   import TVWall from '@/components/TVWall.vue' //电视墙弹窗
   import eventdetailsdialog from '@/views/eventdetailsdialog.vue' //事件详情弹窗
   import firespread from '@/views/firespread.vue' //事件详情弹窗
+  import chart from "./from/dvCapsuleChart.vue";
 
   /** ----------------------------------摄像头预览开始------------------------------------- */
   import {
@@ -474,6 +477,7 @@
     components: {
       Firespread,
       supermap,
+      chart,
       // supermapNotProcessed,
       // supermapProcessed,
       vheader,
@@ -501,6 +505,7 @@
       this.getEventByReportorOrder(this.getCurrentDataStr())
       this.getExposureStage(this.getCurrentDataStr())
       this.getSupermap(this.getCurrentDataStr())
+      this.getMenuEventType()
       /** ----------------------------------weosocket开始------------------------------------- */
       // this.initWebSocket()
       /** ----------------------------------weosocket结束------------------------------------- */
@@ -508,13 +513,13 @@
         if (this.calendarDay == this.getCurrentDataStr()) {
           this.getTodayEvents(this.getCurrentDataStr(), true);
           this.getDeptEventCount(this.getCurrentDataStr(), true);
-          this.getEventList(this.getCurrentDataStr(), this.pageSize, this.pageNum, '', true);
+          // this.getEventList(this.getCurrentDataStr(), this.pageSize, this.pageNum, '', true);
           this.getEventByEventType(this.getCurrentDataStr(), true);
           this.getEventByReportorOrder(this.getCurrentDataStr(), true);
           this.getExposureStage(this.getCurrentDataStr(), true);
-          this.getSupermap(this.getCurrentDataStr(), true);
+          // this.getSupermap(this.getCurrentDataStr(), true);
         }
-      }, 10000)
+      }, 30000)
       this.bottomMenuList() //获取底部公共组件消息和任务
     },
     data() {
@@ -557,6 +562,8 @@
         eventList: [],
         pageSize: 10,
         pageNum: 1,
+        eventTypeIdDl:[],
+        eventTypeId:[],
 
         eventListnew: [],
         eventListAll: [],
@@ -573,6 +580,11 @@
         weosocket: false,
         websock: '',
         setIntervalWesocketPush: null,
+        websockSid: {
+          userId: '',
+          eventTypeDl: '',
+          eventType: '',
+        },
         /** ----------------------------------weosocket结束------------------------------------- */
         /** ----------------------------------摄像头预览开始------------------------------------- */
         activePanel: 'key1',
@@ -594,6 +606,30 @@
     },
     /** ----------------------------------weosocket结束------------------------------------- */
     methods: {
+      getMenuEventType() {
+        let that = this
+        getMenuEventType().then(res => {
+          that.websockSid.userId = Cookies.get('userId')
+          that.websockSid.eventTypeDl = res.data.eventTypeDl
+          that.websockSid.eventType = res.data.eventType
+          that.initWebSocket(that.websockSid.userId, that.websockSid.eventTypeDl, that.websockSid.eventType)
+          console.log(that.websockSid)
+        })
+      },
+      setEventTypeId(data) {
+        // let data = {eventTypeIdDl: [], eventTypeId: []}
+        // let data = {eventTypeIdDl: that.eventTypeIdDl, eventTypeId: that.eventTypeId}
+        let that = this
+        that.eventTypeIdDl = data.eventTypeIdDl
+        that.eventTypeId = data.eventTypeId
+        that.getSupermap(that.calendarDay, false)
+        that.getTodayEvents(that.calendarDay, false)
+        that.getEventByEventType(that.calendarDay, false)
+        that.getExposureStage(that.calendarDay, false)
+        that.getEventByReportorOrder(that.calendarDay, false)
+        that.getDeptEventCount(that.calendarDay, false)
+        that.getEventList(that.calendarDay, that.pageSize, that.pageNum, '', false)
+      },
       // searchEvent(pageSize,pageNum,eventSearch) {
       //   this.pageSize = pageSize;
       //   this.pageNum = pageNum;
@@ -832,7 +868,7 @@
       getTodayEvents(day, loading) {
         let that = this
         //左侧获取事件信息统计
-        getTodayEvents({day: day}, loading).then(res => {
+        getTodayEvents({eventTypeIdDl: that.eventTypeIdDl,eventTypeId: that.eventTypeId,day: day}, loading).then(res => {
           this.aiTotal = res.data.aiTotal
           this.aiTotal_pre = res.data.aiTotal_pre
           this.newReport = res.data.newReport
@@ -851,7 +887,7 @@
       getDeptEventCount(day, loading) {
         let that = this
         //左侧获取事件部门数量
-        getDeptEventCount({day: day}, loading).then(res => {
+        getDeptEventCount({eventTypeIdDl: that.eventTypeIdDl,eventTypeId: that.eventTypeId,day: day}, loading).then(res => {
           this.forestFarm = res.data
         })
       },
@@ -881,7 +917,7 @@
       },
       getSupermap(day, loading) {
         let that = this
-        getNearEvent('', '', day, loading).then(res => {
+        getNearEvent('', '', day, loading, that.eventTypeIdDl, that.eventTypeId).then(res => {
           that.markersList = [];
           if (res.data != null && res.data.length > 0) {
             for (let i = 0; i < res.data.length; i++) {
@@ -980,7 +1016,7 @@
         let that = this
         this.eventList = []
         //右侧获取事件列表
-        getEventList({day: day, pageSize: pageSize, pageNum: pageNum, eventName: eventSearch}, loading).then(res => {
+        getEventList({eventTypeIdDl: that.eventTypeIdDl,eventTypeId: that.eventTypeId, day: day, pageSize: pageSize, pageNum: pageNum, eventName: eventSearch}, loading).then(res => {
           this.eventList = res.data
           if (this.eventList != null && this.eventList.length > 0) {
             if (this.eventList[0].eventStatusValue == 'forest_event_status_1') {
@@ -995,7 +1031,7 @@
       getEventByEventType(day, loading) {
         let that = this
         //右侧获取事件分类
-        getEventByEventType({day: day}, loading).then(res => {
+        getEventByEventType({eventTypeIdDl: that.eventTypeIdDl,eventTypeId: that.eventTypeId, day: day}, loading).then(res => {
           if (res.data != null && res.data.length > 0) {
             this.showEventKind = true
             this.eventKind.data = res.data
@@ -1012,7 +1048,7 @@
       getEventByReportorOrder(day, loading) {
         let that = this
         //右侧获取上报排名
-        getEventByReportorOrder({day: day}, loading).then(res => {
+        getEventByReportorOrder({eventTypeIdDl: that.eventTypeIdDl,eventTypeId: that.eventTypeId,day: day}, loading).then(res => {
           if (res.data != null && res.data.length > 0) {
             this.reportList.data = res.data
             this.reportList = {...this.reportList}
@@ -1033,8 +1069,7 @@
       },
       getWebSocketEvent(data) {
         let that = this
-        const event = JSON.parse(data);
-        //右侧获取事件列表
+        const event = data        //右侧获取事件列表
         that.markersList = []
         let markersMap = {
           lng: 124.59,
@@ -1111,14 +1146,13 @@
       getExposureStage(day, loading) {
         let that = this
         //右侧获取曝光台
-        getExposureStage({day: day}, loading).then(res => {
+        getExposureStage({eventTypeIdDl: that.eventTypeIdDl,eventTypeId: that.eventTypeId,day: day}, loading).then(res => {
           this.exposureStageList = res.data
         })
       },
       /** ----------------------------------weosocket开始------------------------------------- */
-      initWebSocket() { //初始化weosocket
-        // const wsuri = 'ws://127.0.0.1:10003/webSocket/' + Cookies.get('username')
-        const wsuri = 'ws://127.0.0.1:10003/webSocket/admin'
+      initWebSocket(userId, eventTypeDl, eventType) {        //初始化weosocket
+        const wsuri = 'ws://127.0.0.1:10003/eventPush/' + userId + '/' + eventTypeDl + '/' + eventType
         this.websock = new WebSocket(wsuri)
         console.log('建立websocket连接')
         this.websock.onopen = this.websocketonopen
@@ -1131,14 +1165,15 @@
         this.sendPing()
       },
       websocketonerror() { //连接建立失败重连
-        this.initWebSocket()
+        this.initWebSocket(this.websockSid.userId, this.websockSid.eventTypeDl, this.websockSid.eventType,)
       },
       websocketonmessage(e) { //数据接收
         console.log('接收数据', e.data)
         // let data = "{\"fromId\":\"forest\",\"fromUserId\":\""+Cookies.get('username')+"\",\"toUserId\":\""+Cookies.get('username')+"\"}";
         let data = "{\"fromId\":\"forest\",\"fromUserId\":\"admin\",\"toUserId\":\"admin\"}";
         if (this.calendarDay == this.getCurrentDataStr() && data != e.data) {
-          this.getWebSocketEvent(e.data);
+          // 处理收到的消息
+          this.handleWebSoceketEvent(e.data)
 
           // this.getEventListNew();
           // this.getTodayEvents(this.getCurrentDataStr());
@@ -1151,6 +1186,29 @@
           // thes.$refs.up.pause();//停止播放音乐
         }
       },
+      // 处理WebSocket事件
+      handleWebSoceketEvent(val) {
+        let that = this
+        let data = JSON.parse(val)
+        /**
+         * that.markersList.filter( item => data.eventCode == item.parameter).length == 0 如果地图中不存在当前事件则添加
+         * eventPush: 事件列表消息
+         * */
+        if (data.tag == "eventPush" && that.markersList.filter( item => data.eventCode == item.parameter).length == 0) {
+          getEventPush({eventCode: data.eventCode}).then((res) => {
+            if (res.data != undefined) {
+              //插入到第一条
+              this.eventList.unshift(res.data)
+              // 插入后删除最后一条 保证列表中为10条数据
+              if (this.eventList.length > 9)
+                this.eventList.splice(10, 1)
+              // 将收到的数据在地图上添加
+              this.getWebSocketEvent(res.data)
+            }
+          })
+        }
+        console.log(that.eventList[0])
+      },
       websocketsend(Data) { //数据发送
         this.websock.send(Data)
       },
@@ -1173,7 +1231,7 @@
           if (this.weosocket) {
             this.websock.send(JSON.stringify(ping))
           } else {
-            this.initWebSocket()
+            // this.initWebSocket()
           }
         }, time)
       },