Quellcode durchsuchen

Merge remote-tracking branch 'origin/master'

wangchao vor 4 Jahren
Ursprung
Commit
9773787bd2

+ 2 - 1
ebc-middle-platform/src/conf/services.js

@ -80,7 +80,8 @@ export default {
80 80
  alarm: {
81 81
    CLOSE_RESCUE: '/alarmManagement/closeRescue', // 关闭救援信息
82 82
    ASSIGN_RESCUER: '/alarmManagement/assignRescuer', // 指派救援者
83
    LOAD_ALARM_DETAILS: '/alarmManagement/loadAlarmDetails' // 实时报警初始化
83
    LOAD_ALARM_DETAILS: '/alarmManagement/loadAlarmDetails', // 实时报警初始化
84
    LOAD_MAP_AREA_TOOL: '/alarmManagement/loadMapAreaTool' // 查询所有地图标记和设备
84 85
  },
85 86
  position: {
86 87
    POSITION: '/position/', // 新增post,修改put,删除delete岗位信息

+ 47 - 104
ebc-middle-platform/src/modules/call-help/current.vue

@ -117,35 +117,6 @@ export default {
117 117
      var la = Ai.WMTSLayer(GIS_SEA_URL)
118 118
      this.map.addLayer(la)
119 119
      this.load()
120
    },
121
    load() {
122
      this.personLayer = new Ai.FeatureGroup()
123
      this.$test
124
        .post(services.alarm.LOAD_ALARM_DETAILS, '')
125
        .then((res) => {
126
          console.log(res)
127
          this.map.addLayer(this.personLayer)
128
          res.data.forEach(element => {
129
            var alarmPoint = null
130
            if (element.rescueTargetEntityPosition) {
131
              alarmPoint = this.point(element)
132
            }
133
            if (element.rescueEntityPosition) {
134
              var rescuerPoint = this.rescuerPoint(element)
135
              var lineWktStr = 'LINESTRING ( ' + element.rescueTargetEntityPosition.longitude + ' ' + element.rescueTargetEntityPosition.latitude + ',' + element.rescueEntityPosition.longitude + ' ' + element.rescueEntityPosition.latitude + ')'
136
              var lineLayer = new Ai.Polyline(lineWktStr, {color: 'red', opacity: 1.0})
137
              alarmPoint.getAttributes().lineLayer = lineLayer
138
              rescuerPoint.getAttributes().lineLayer = lineLayer
139
              alarmPoint.getAttributes().point = rescuerPoint
140
              rescuerPoint.getAttributes().point = alarmPoint
141
              this.map.addLayer(lineLayer)
142
            }
143
          })
144
          // this.map.setViewPort([this.personLayer])
145
        })
146
        .catch((res) => {
147
          // 请求失败处理...
148
        })
149 120
      this.$test
150 121
        .post(services.alarm.LOAD_MAP_AREA_TOOL, {})
151 122
        .then((res) => {
@ -178,6 +149,35 @@ export default {
178 149
        // 请求失败处理...
179 150
        })
180 151
    },
152
    load() {
153
      this.personLayer = new Ai.FeatureGroup()
154
      this.$test
155
        .post(services.alarm.LOAD_ALARM_DETAILS, '')
156
        .then((res) => {
157
          console.log(res)
158
          this.map.addLayer(this.personLayer)
159
          res.data.forEach(element => {
160
            var alarmPoint = null
161
            if (element.rescueTargetEntityPosition) {
162
              alarmPoint = this.point(element)
163
            }
164
            if (element.rescueEntityPosition) {
165
              var rescuerPoint = this.rescuerPoint(element)
166
              var lineWktStr = 'LINESTRING ( ' + element.rescueTargetEntityPosition.longitude + ' ' + element.rescueTargetEntityPosition.latitude + ',' + element.rescueEntityPosition.longitude + ' ' + element.rescueEntityPosition.latitude + ')'
167
              var lineLayer = new Ai.Polyline(lineWktStr, {color: 'red', opacity: 1.0})
168
              alarmPoint.lineLayer = lineLayer
169
              rescuerPoint.lineLayer = lineLayer
170
              alarmPoint.point = rescuerPoint
171
              rescuerPoint.point = alarmPoint
172
              this.map.addLayer(lineLayer)
173
            }
174
          })
175
          // this.map.setViewPort([this.personLayer])
176
        })
177
        .catch((res) => {
178
          // 请求失败处理...
179
        })
180
    },
181 181
    changePoint(msg) {
182 182
      var obj = JSON.parse(msg)
183 183
      if (obj.data.currentEntityPosition) {
@ -189,10 +189,10 @@ export default {
189 189
              flag = false
190 190
              point.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
191 191
              point.getAttributes().rescueEntityPosition = obj.data.currentEntityPosition
192
              if (point.getAttributes().lineLayer) {
192
              if (point.lineLayer) {
193 193
                var lineWktStr = 'LINESTRING ( ' + obj.data.currentEntityPosition.longitude + ' ' + obj.data.currentEntityPosition.latitude + ',' + point.getAttributes().rescueTargetEntityPosition.longitude + ' ' + point.getAttributes().rescueTargetEntityPosition.latitude + ')'
194 194
                console.log(lineWktStr)
195
                point.getAttributes().lineLayer.setPoints(lineWktStr)
195
                point.lineLayer.setPoints(lineWktStr)
196 196
              }
197 197
              if (point.popup) {
198 198
                point.popup.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
@ -219,10 +219,10 @@ export default {
219 219
              flag = false
220 220
              point.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
221 221
              point.getAttributes().rescueTargetEntityPosition = obj.data.currentEntityPosition
222
              if (point.getAttributes().lineLayer) {
222
              if (point.lineLayer) {
223 223
                var lineWktStr = 'LINESTRING ( ' + obj.data.currentEntityPosition.longitude + ' ' + obj.data.currentEntityPosition.latitude + ',' + point.getAttributes().rescueEntityPosition.longitude + ' ' + point.getAttributes().rescueEntityPosition.latitude + ')'
224 224
                console.log(lineWktStr)
225
                point.getAttributes().lineLayer.setPoints(lineWktStr)
225
                point.lineLayer.setPoints(lineWktStr)
226 226
              }
227 227
              if (point.popup) {
228 228
                point.popup.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
@ -245,14 +245,15 @@ export default {
245 245
                '<div>求救时长</div>' +
246 246
                '<div>' + this.getDurationTime(e.alarmTime) + '</div>' +
247 247
                '</div>'
248
                var param = JSON.stringify(e)
248 249
                if (e.isAssignAlarm == '0') {
249 250
                  callHelp = '<div style="display:flex;">' +
250
                "<button class='point-out' onClick='window.Vue.appoint(" + e + ")'><i style='font-size: 20px;' class='aidicon aidicon-user-outline'></i>指派</button>" +
251
                "<button class='close-confirm' onClick='window.Vue.close(" + e + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
251
                "<button class='point-out' onClick='window.Vue.appoint(" + param + ")'><i style='font-size: 20px;' class='aidicon aidicon-user-outline'></i>指派</button>" +
252
                "<button class='close-confirm' onClick='window.Vue.close(" + param + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
252 253
                '</div>'
253 254
                } else {
254 255
                  callHelp = '<div style="display:flex;justify-content: flex-end;">' +
255
                "<button class='close-confirm' onClick='window.Vue.close(" + e + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
256
                "<button class='close-confirm' onClick='window.Vue.close(" + param + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
256 257
                '</div>'
257 258
                }
258 259
                var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>' + e.rescueTargetEntityPosition.name + '</div>' + tips + '</div><div class="middle"><div class="row">' +
@ -287,10 +288,10 @@ export default {
287 288
          var rescuerPoint = this.rescuePoint({rescueEntityPosition: obj.data.currentEntityPosition})
288 289
          var lineWktStr = 'LINESTRING ( ' + obj.data.currentEntityPosition.longitude + ' ' + obj.data.currentEntityPosition.latitude + ',' + targetPoint.getAttributes().rescueTargetEntityPosition.longitude + ' ' + targetPoint.getAttributes().rescueTargetEntityPosition.latitude + ')'
289 290
          var lineLayer = new Ai.Polyline(lineWktStr, {color: 'red', opacity: 1.0})
290
          targetPoint.getAttributes().lineLayer = lineLayer
291
          rescuerPoint.getAttributes().lineLayer = lineLayer
292
          targetPoint.getAttributes().point = rescuerPoint
293
          rescuerPoint.getAttributes().point = targetPoint
291
          targetPoint.lineLayer = lineLayer
292
          rescuerPoint.lineLayer = lineLayer
293
          targetPoint.point = rescuerPoint
294
          rescuerPoint.point = targetPoint
294 295
          this.map.addLayer(lineLayer)
295 296
        }
296 297
      }
@ -467,56 +468,11 @@ export default {
467 468
              this.personLayer.eachLayer(layer => {
468 469
                this.map.removeLayer(layer)
469 470
                this.map.closePopup()
471
                if (layer.lineLayer && this.map.hasLayer(layer.lineLayer)) {
472
                  this.map.removeLayer(layer.lineLayer)
473
                }
470 474
              })
471 475
              this.load()
472
              // var alarmPoint = this.rescuerPoint({rescueEntityPosition: res.data})
473
              // var lineWktStr = 'LINESTRING ( ' + res.data.longitude + ' ' + res.data.latitude + ',' + this.appointAlarm.rescueTargetEntityPosition.longitude + ' ' + this.appointAlarm.rescueTargetEntityPosition.latitude + ')'
474
              // var lineLayer = new Ai.Polyline(lineWktStr, {color: 'red', opacity: 1.0})
475
              // this.personLayer.addLayer(alarmPoint)
476
              // this.map.addLayer(lineLayer)
477
              // var that = this
478
              // this.personLayer.eachLayer(layer => {
479
              //   if (layer.getAttributes().rescueTargetEntityPosition.entityId === that.appointAlarm.rescueTargetEntityPosition.entityId) {
480
              //     var className = 'alarm'
481
              //     if (layer.getAttributes().businessType == '2') {
482
              //       className = 'hand-alarm'
483
              //     } else if (layer.getAttributes().businessType == '4') {
484
              //       className = 'offline'
485
              //     }
486
              //     var tips = '<div class="' + className + '">' + layer.getAttributes().businessTypeZH + '</div>'
487
              //     var content =
488
              //     '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>' + layer.getAttributes().rescueTargetEntityPosition.name + '</div>' + tips + '</div><div class="middle"><div class="row">' +
489
              //     '<div>终端编号</div>' +
490
              //     '<div>' + layer.getAttributes().terminalId + '</div>' +
491
              //     '</div>' +
492
              //     '<div class="row">' +
493
              //     '<div>经度</div>' +
494
              //     '<div>' + layer.getAttributes().rescueTargetEntityPosition.longitude + '</div>' +
495
              //     '</div>' +
496
              //     '<div class="row">' +
497
              //     '<div>纬度</div>' +
498
              //     '<div>' + layer.getAttributes().rescueTargetEntityPosition.latitude + '</div>' +
499
              //     '</div>' + '<div class="row sos">' +
500
              //   '<div>求救时间</div>' +
501
              //   '<div>' + layer.getAttributes().alarmTime + '</div>' +
502
              //   '</div>' + '<div class="row sos">' +
503
              //   '<div>求救时长</div>' +
504
              //   '<div>' + 1 + 'min</div>' +
505
              //   '</div>' +
506
              //     '<div class="row">' +
507
              //     '<div>最新定位时间</div>' +
508
              //     '<div>' + layer.getAttributes().alarmTime + '</div>' +
509
              //     '</div></div></div>' + '<div style="display:flex;justify-content: flex-end;">' +
510
              //   "<button class='close-confirm' onClick='window.Vue.close(" + JSON.stringify(layer.getAttributes()) + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
511
              //   '</div>' +
512
              //     '</div></div>'
513
              //     layer.getAttributes().popup.setContent(content).openOn(this.map)
514
              //     alarmPoint.getAttributes().lineLayer = lineLayer
515
              //     layer.getAttributes().lineLayer = lineLayer
516
              //     alarmPoint.getAttributes().point = layer
517
              //     layer.getAttributes().point = alarmPoint
518
              //   }
519
              // })
520 476
            })
521 477
            .catch((res) => {
522 478
              // 请求失败处理...
@ -537,24 +493,11 @@ export default {
537 493
              this.personLayer.eachLayer(layer => {
538 494
                this.map.removeLayer(layer)
539 495
                this.map.closePopup()
496
                if (layer.lineLayer && this.map.hasLayer(layer.lineLayer)) {
497
                  this.map.removeLayer(layer.lineLayer)
498
                }
540 499
              })
541 500
              this.load()
542
              // var chooseLayer
543
              // this.personLayer.eachLayer(layer => {
544
              //   if (layer.getAttributes().rescueTargetEntityPosition.entityId === item.rescueTargetEntityPosition.entityId) {
545
              //     chooseLayer = layer
546
              //     if (layer.getAttributes().point) {
547
              //       this.map.removeLayer(layer.getAttributes().point)
548
              //       this.map.closePopup(layer.getAttributes().point.popup)
549
              //       this.map.removeLayer(layer.getAttributes().lineLayer)
550
              //     }
551
              //   }
552
              // })
553
              // this.personLayer.removeLayer(chooseLayer)
554
              // if (chooseLayer.getAttributes().point) {
555
              //   this.personLayer.removeLayer(chooseLayer.getAttributes().point)
556
              // }
557
              // this.map.closePopup(chooseLayer.popup)
558 501
            })
559 502
            .catch((res) => {
560 503
            // 请求失败处理...

+ 13 - 0
ebc-middle-platform/src/modules/layouts/BasicLayout.vue

@ -74,8 +74,20 @@ export default {
74 74
    // 镜屏调用
75 75
    this.load()
76 76
    this.connect()
77
    this.getGisToken()
77 78
  },
78 79
  methods: {
80
    async getGisToken() { // 获取GIS token并存入store
81
      await this.$test
82
          .post(services.mapTag.GET_MAP_PARAM, '')
83
          .then((res) => {
84
            this.$store.commit('setGisToken', res.data.ak)
85
            this.$store.commit('setMapParam', {center: [res.data.latitude, res.data.longitude], zoom: res.data.scale})
86
          })
87
          .catch((res) => {
88
            // 请求失败处理...
89
          })
90
    },
79 91
    load() {
80 92
      this.$test
81 93
        .post(services.organization.BIND_DEVICE, {})
@ -154,6 +166,7 @@ export default {
154 166
      this.stompClient.subscribe('alarm', (msg) => {
155 167
        console.log('alarm' + msg)
156 168
        this.alarmOpen(msg)
169
        EventBus.$emit('person', msg.body)
157 170
      })
158 171
      this.stompClient.subscribe('ship', (msg) => {
159 172
        console.log(msg)

+ 39 - 24
ebc-middle-platform/src/modules/orientation/orientation.vue

@ -271,12 +271,14 @@ export default {
271 271
    }
272 272
  },
273 273
  mounted() {
274
    this.getTagType()
275
    this.getToolType()
276
    this.getGisToken().then(() => { // 获取gistoken后加载地图
277
      this.initMap()
278
      this.initTrackMap()
279
      this.initStatusCount()
274
    // this.getGisToken().then(() => { // 获取gistoken后加载地图
275
    // })
276
    this.getTagType().then(() => {
277
      this.getToolType().then(() => {
278
        this.initMap()
279
        this.initTrackMap()
280
        this.initStatusCount()
281
      })
280 282
    })
281 283
    setInterval(() => { // 当前时间
282 284
      this.nowDate = new Date()
@ -301,19 +303,19 @@ export default {
301 303
    })
302 304
  },
303 305
  methods: {
304
    async getGisToken() { // 获取GIS token并存入store
306
    // async getGisToken() { // 获取GIS token并存入store
307
    //   await this.$test
308
    //     .post(services.mapTag.GET_MAP_PARAM, '')
309
    //     .then((res) => {
310
    //       this.$store.commit('setGisToken', res.data.ak)
311
    //       this.$store.commit('setMapParam', {center: [res.data.latitude, res.data.longitude], zoom: res.data.scale})
312
    //     })
313
    //     .catch((res) => {
314
    //       // 请求失败处理...
315
    //     })
316
    // },
317
    async getTagType() {
305 318
      await this.$test
306
        .post(services.mapTag.GET_MAP_PARAM, '')
307
        .then((res) => {
308
          this.$store.commit('setGisToken', res.data.ak)
309
          this.$store.commit('setMapParam', {center: [res.data.latitude, res.data.longitude], zoom: res.data.scale})
310
        })
311
        .catch((res) => {
312
          // 请求失败处理...
313
        })
314
    },
315
    getTagType: function () {
316
      this.$test
317 319
        .post(services.mapTag.MAP_TAG_TYPE, {})
318 320
        .then((res) => {
319 321
          // 请求成功处理...
@ -326,8 +328,8 @@ export default {
326 328
          // 请求失败处理...
327 329
        })
328 330
    },
329
    getToolType: function () {
330
      this.$test.post(services.equipment.EQUIPMENT_TYPE, {}
331
    async getToolType() {
332
      await this.$test.post(services.equipment.EQUIPMENT_TYPE, {}
331 333
      ).then(res => {
332 334
        // 请求成功处理...
333 335
        this.toolTypes = res.data
@ -708,10 +710,10 @@ export default {
708 710
          return 'outline'
709 711
          break
710 712
        case '050': // 自动告警 ------ 红色
711
          return 'sso'
713
          return 'sos'
712 714
          break
713 715
        case '040': // 手动告警 ------ 红色
714
          return 'sso'
716
          return 'sos'
715 717
          break
716 718
        case '030': // 离线 ------ 灰色
717 719
          return 'offline'
@ -806,10 +808,16 @@ export default {
806 808
        .then((res) => {
807 809
          console.log(res)
808 810
          res.data.forEach(e => {
811
            var url = ''
812
            this.toolTypes.forEach(t => {
813
              if (e.resourceToolType == t.resourceToolType) {
814
                url = t.iconUrl
815
              }
816
            })
809 817
            var point = Ai.Point([e.latitude, e.longitude], {
810 818
              icon: Ai.Icon({
811 819
                // 设置图标URL路径
812
                iconUrl: '/static/images/fan.png',
820
                iconUrl: url,
813 821
                // 设置图标大小
814 822
                iconSize: [20, 20],
815 823
                // 设置点对象和图标的相对偏移量
@ -920,7 +928,14 @@ export default {
920 928
            var la = new Ai.FeatureGroup()
921 929
            res.data.forEach(e => {
922 930
              var wktstr = e.mapAreaContent
923
              var polygon = Ai.Polygon(wktstr, {color: 'red'})
931
              debugger
932
              var areaColor = ''
933
              this.markTypes.forEach(m => {
934
                if (m.mapAreaBusinessType == e.businessType) {
935
                  areaColor = m.color
936
                }
937
              })
938
              var polygon = Ai.Polygon(wktstr, {color: areaColor, opacity: 1.0, weight: 1.2})
924 939
              la.addLayer(polygon)
925 940
            })
926 941
            this.trackMap.addLayer(la)