Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

wangchao лет назад: 4
Родитель
Сommit
9773787bd2

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

80
  alarm: {
80
  alarm: {
81
    CLOSE_RESCUE: '/alarmManagement/closeRescue', // 关闭救援信息
81
    CLOSE_RESCUE: '/alarmManagement/closeRescue', // 关闭救援信息
82
    ASSIGN_RESCUER: '/alarmManagement/assignRescuer', // 指派救援者
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
  position: {
86
  position: {
86
    POSITION: '/position/', // 新增post,修改put,删除delete岗位信息
87
    POSITION: '/position/', // 新增post,修改put,删除delete岗位信息

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

117
      var la = Ai.WMTSLayer(GIS_SEA_URL)
117
      var la = Ai.WMTSLayer(GIS_SEA_URL)
118
      this.map.addLayer(la)
118
      this.map.addLayer(la)
119
      this.load()
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
      this.$test
120
      this.$test
150
        .post(services.alarm.LOAD_MAP_AREA_TOOL, {})
121
        .post(services.alarm.LOAD_MAP_AREA_TOOL, {})
151
        .then((res) => {
122
        .then((res) => {
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
    changePoint(msg) {
181
    changePoint(msg) {
182
      var obj = JSON.parse(msg)
182
      var obj = JSON.parse(msg)
183
      if (obj.data.currentEntityPosition) {
183
      if (obj.data.currentEntityPosition) {
189
              flag = false
189
              flag = false
190
              point.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
190
              point.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
191
              point.getAttributes().rescueEntityPosition = obj.data.currentEntityPosition
191
              point.getAttributes().rescueEntityPosition = obj.data.currentEntityPosition
192
              if (point.getAttributes().lineLayer) {
192
              if (point.lineLayer) {
193
                var lineWktStr = 'LINESTRING ( ' + obj.data.currentEntityPosition.longitude + ' ' + obj.data.currentEntityPosition.latitude + ',' + point.getAttributes().rescueTargetEntityPosition.longitude + ' ' + point.getAttributes().rescueTargetEntityPosition.latitude + ')'
193
                var lineWktStr = 'LINESTRING ( ' + obj.data.currentEntityPosition.longitude + ' ' + obj.data.currentEntityPosition.latitude + ',' + point.getAttributes().rescueTargetEntityPosition.longitude + ' ' + point.getAttributes().rescueTargetEntityPosition.latitude + ')'
194
                console.log(lineWktStr)
194
                console.log(lineWktStr)
195
                point.getAttributes().lineLayer.setPoints(lineWktStr)
195
                point.lineLayer.setPoints(lineWktStr)
196
              }
196
              }
197
              if (point.popup) {
197
              if (point.popup) {
198
                point.popup.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
198
                point.popup.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
219
              flag = false
219
              flag = false
220
              point.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
220
              point.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
221
              point.getAttributes().rescueTargetEntityPosition = obj.data.currentEntityPosition
221
              point.getAttributes().rescueTargetEntityPosition = obj.data.currentEntityPosition
222
              if (point.getAttributes().lineLayer) {
222
              if (point.lineLayer) {
223
                var lineWktStr = 'LINESTRING ( ' + obj.data.currentEntityPosition.longitude + ' ' + obj.data.currentEntityPosition.latitude + ',' + point.getAttributes().rescueEntityPosition.longitude + ' ' + point.getAttributes().rescueEntityPosition.latitude + ')'
223
                var lineWktStr = 'LINESTRING ( ' + obj.data.currentEntityPosition.longitude + ' ' + obj.data.currentEntityPosition.latitude + ',' + point.getAttributes().rescueEntityPosition.longitude + ' ' + point.getAttributes().rescueEntityPosition.latitude + ')'
224
                console.log(lineWktStr)
224
                console.log(lineWktStr)
225
                point.getAttributes().lineLayer.setPoints(lineWktStr)
225
                point.lineLayer.setPoints(lineWktStr)
226
              }
226
              }
227
              if (point.popup) {
227
              if (point.popup) {
228
                point.popup.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
228
                point.popup.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
245
                '<div>求救时长</div>' +
245
                '<div>求救时长</div>' +
246
                '<div>' + this.getDurationTime(e.alarmTime) + '</div>' +
246
                '<div>' + this.getDurationTime(e.alarmTime) + '</div>' +
247
                '</div>'
247
                '</div>'
248
                var param = JSON.stringify(e)
248
                if (e.isAssignAlarm == '0') {
249
                if (e.isAssignAlarm == '0') {
249
                  callHelp = '<div style="display:flex;">' +
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
                '</div>'
253
                '</div>'
253
                } else {
254
                } else {
254
                  callHelp = '<div style="display:flex;justify-content: flex-end;">' +
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
                '</div>'
257
                '</div>'
257
                }
258
                }
258
                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">' +
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
          var rescuerPoint = this.rescuePoint({rescueEntityPosition: obj.data.currentEntityPosition})
288
          var rescuerPoint = this.rescuePoint({rescueEntityPosition: obj.data.currentEntityPosition})
288
          var lineWktStr = 'LINESTRING ( ' + obj.data.currentEntityPosition.longitude + ' ' + obj.data.currentEntityPosition.latitude + ',' + targetPoint.getAttributes().rescueTargetEntityPosition.longitude + ' ' + targetPoint.getAttributes().rescueTargetEntityPosition.latitude + ')'
289
          var lineWktStr = 'LINESTRING ( ' + obj.data.currentEntityPosition.longitude + ' ' + obj.data.currentEntityPosition.latitude + ',' + targetPoint.getAttributes().rescueTargetEntityPosition.longitude + ' ' + targetPoint.getAttributes().rescueTargetEntityPosition.latitude + ')'
289
          var lineLayer = new Ai.Polyline(lineWktStr, {color: 'red', opacity: 1.0})
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
          this.map.addLayer(lineLayer)
295
          this.map.addLayer(lineLayer)
295
        }
296
        }
296
      }
297
      }
467
              this.personLayer.eachLayer(layer => {
468
              this.personLayer.eachLayer(layer => {
468
                this.map.removeLayer(layer)
469
                this.map.removeLayer(layer)
469
                this.map.closePopup()
470
                this.map.closePopup()
471
                if (layer.lineLayer && this.map.hasLayer(layer.lineLayer)) {
472
                  this.map.removeLayer(layer.lineLayer)
473
                }
470
              })
474
              })
471
              this.load()
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
            .catch((res) => {
477
            .catch((res) => {
522
              // 请求失败处理...
478
              // 请求失败处理...
537
              this.personLayer.eachLayer(layer => {
493
              this.personLayer.eachLayer(layer => {
538
                this.map.removeLayer(layer)
494
                this.map.removeLayer(layer)
539
                this.map.closePopup()
495
                this.map.closePopup()
496
                if (layer.lineLayer && this.map.hasLayer(layer.lineLayer)) {
497
                  this.map.removeLayer(layer.lineLayer)
498
                }
540
              })
499
              })
541
              this.load()
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
            .catch((res) => {
502
            .catch((res) => {
560
            // 请求失败处理...
503
            // 请求失败处理...

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

74
    // 镜屏调用
74
    // 镜屏调用
75
    this.load()
75
    this.load()
76
    this.connect()
76
    this.connect()
77
    this.getGisToken()
77
  },
78
  },
78
  methods: {
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
    load() {
91
    load() {
80
      this.$test
92
      this.$test
81
        .post(services.organization.BIND_DEVICE, {})
93
        .post(services.organization.BIND_DEVICE, {})
154
      this.stompClient.subscribe('alarm', (msg) => {
166
      this.stompClient.subscribe('alarm', (msg) => {
155
        console.log('alarm' + msg)
167
        console.log('alarm' + msg)
156
        this.alarmOpen(msg)
168
        this.alarmOpen(msg)
169
        EventBus.$emit('person', msg.body)
157
      })
170
      })
158
      this.stompClient.subscribe('ship', (msg) => {
171
      this.stompClient.subscribe('ship', (msg) => {
159
        console.log(msg)
172
        console.log(msg)

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

271
    }
271
    }
272
  },
272
  },
273
  mounted() {
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
    setInterval(() => { // 当前时间
283
    setInterval(() => { // 当前时间
282
      this.nowDate = new Date()
284
      this.nowDate = new Date()
301
    })
303
    })
302
  },
304
  },
303
  methods: {
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
      await this.$test
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
        .post(services.mapTag.MAP_TAG_TYPE, {})
319
        .post(services.mapTag.MAP_TAG_TYPE, {})
318
        .then((res) => {
320
        .then((res) => {
319
          // 请求成功处理...
321
          // 请求成功处理...
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
      ).then(res => {
333
      ).then(res => {
332
        // 请求成功处理...
334
        // 请求成功处理...
333
        this.toolTypes = res.data
335
        this.toolTypes = res.data
708
          return 'outline'
710
          return 'outline'
709
          break
711
          break
710
        case '050': // 自动告警 ------ 红色
712
        case '050': // 自动告警 ------ 红色
711
          return 'sso'
713
          return 'sos'
712
          break
714
          break
713
        case '040': // 手动告警 ------ 红色
715
        case '040': // 手动告警 ------ 红色
714
          return 'sso'
716
          return 'sos'
715
          break
717
          break
716
        case '030': // 离线 ------ 灰色
718
        case '030': // 离线 ------ 灰色
717
          return 'offline'
719
          return 'offline'
806
        .then((res) => {
808
        .then((res) => {
807
          console.log(res)
809
          console.log(res)
808
          res.data.forEach(e => {
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
            var point = Ai.Point([e.latitude, e.longitude], {
817
            var point = Ai.Point([e.latitude, e.longitude], {
810
              icon: Ai.Icon({
818
              icon: Ai.Icon({
811
                // 设置图标URL路径
819
                // 设置图标URL路径
812
                iconUrl: '/static/images/fan.png',
820
                iconUrl: url,
813
                // 设置图标大小
821
                // 设置图标大小
814
                iconSize: [20, 20],
822
                iconSize: [20, 20],
815
                // 设置点对象和图标的相对偏移量
823
                // 设置点对象和图标的相对偏移量
920
            var la = new Ai.FeatureGroup()
928
            var la = new Ai.FeatureGroup()
921
            res.data.forEach(e => {
929
            res.data.forEach(e => {
922
              var wktstr = e.mapAreaContent
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
              la.addLayer(polygon)
939
              la.addLayer(polygon)
925
            })
940
            })
926
            this.trackMap.addLayer(la)
941
            this.trackMap.addLayer(la)