wangkang3 %!s(int64=4) %!d(string=hace) años
padre
commit
33bb67ddb7

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

@ -73,8 +73,14 @@ export default {
73 73
    INIT_STATUS_COUNT: '/locationManagement/loadEmployeeStatusCount', // 初始化顶部状态人数统计
74 74
    INIT_LOCATION_DETAILS: '/locationManagement/loadLocationDetails', // 位置信息,围栏数据的初始化
75 75
    BIND_DEVICE: '/workEmployee/queryEmployeeBindDeviceList', // 查询绑定的人员列表
76
    FENCE_BY_DEPARTMENT: '/mapTag/queryAllMapTagByOrg', // 按部门查询查询围栏
77
    EQUIPMENT_NOT_BIND: '/equipment/queryAllEquipmentNotBind' // 查询所有未绑定的设备
76
    FENCE_BY_DEPARTMENT: '/mapTag/queryAllMapAreaByOrg', // 按部门查询查询围栏
77
    EQUIPMENT_NOT_BIND: '/equipment/queryAllEquipmentNotBind', // 查询所有未绑定的设备
78
    EMPLOYEE_TRACE: '/locationManagement/queryEmployeeTrace' // 按时间段查询定位信息
79
  },
80
  alarm: {
81
    CLOSE_RESCUE: '/alarmManagement/closeRescue', // 关闭救援信息
82
    ASSIGN_RESCUER: '/alarmManagement/assignRescuer', // 指派救援者
83
    LOAD_ALARM_DETAILS: '/alarmManagement/loadAlarmDetails' // 实时报警初始化
78 84
  },
79 85
  position: {
80 86
    POSITION: '/position/', // 新增post,修改put,删除delete岗位信息

+ 9 - 0
ebc-middle-platform/src/modules/call-help/current.scss

@ -167,6 +167,15 @@
167 167
      height: 25px;
168 168
      line-height: 25px;
169 169
    }
170
    .offline{
171
      color: #000000;
172
      background-color: #D9D9D9;
173
      margin: 7.5px 0 0 5px;
174
      padding: 0 5px;
175
      font-size: 8px;
176
      height: 25px;
177
      line-height: 25px;
178
    }
170 179
  }
171 180
  .middle{
172 181
    padding-left: 20px;

+ 247 - 143
ebc-middle-platform/src/modules/call-help/current.vue

@ -1,36 +1,5 @@
1 1
<template>
2 2
  <div class="current-container">
3
    <!-- <t-scroll-bar :auto-hide="false" class="left">
4
      <div v-for="(item,index) in alarmList" :key="index" :class="[{active:index == activeIndex},'item']" @click="choose(item,index)">
5
        <div class="top">
6
          <div class="user-pic"></div>
7
          <div>{{ item.name }}</div>
8
          <div :class="item.type==1?'alarm':'hand-alarm'">{{ item.type==1?'落水报警':'手动报警' }}</div>
9
        </div>
10
        <div class="middle">
11
          <div class="row">
12
            <div>终端编号</div>
13
            <div>{{ item.number }}</div>
14
          </div>
15
          <div class="row">
16
            <div>救援人</div>
17
            <div>{{ item.rescue==''?'--':item.rescue }}</div>
18
          </div>
19
          <div class="row">
20
            <div>报警时间</div>
21
            <div>{{ item.alarmTime }}</div>
22
          </div>
23
          <div class="row">
24
            <div>最新定位时间</div>
25
            <div>{{ item.positionTime }}</div>
26
          </div>
27
        </div>
28
        <div class="footer">
29
          <t-button v-show="item.rescue==''" icon="user-outline" color="primary" @click="showModal(item)">指派</t-button>
30
          <t-button icon="close" color="primary" @click="close(item)">关闭</t-button>
31
        </div>
32
      </div>
33
    </t-scroll-bar> -->
34 3
    <div class="right">
35 4
      <div id="current-map"></div>
36 5
    </div>
@ -38,7 +7,7 @@
38 7
      <t-form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80" label-position="left">
39 8
        <t-form-item label="救援人员" prop="rescue">
40 9
          <t-select v-model="formValidate.rescue" placeholder="请选择">
41
            <t-option v-for="(item, index) in rescuer" :key="index+'rescuer'" :value="item.ID">{{ item.NAME }}</t-option>
10
            <t-option v-for="(item, index) in rescuer" :key="index+'rescuer'" :value="item.workEmployeeId">{{ item.workEmployeeName }}</t-option>
42 11
          </t-select>
43 12
        </t-form-item>
44 13
      </t-form>
@ -125,6 +94,14 @@ export default {
125 94
      console.log(msg)
126 95
      this.changePoint(msg)
127 96
    })
97
    EventBus.$on('reload', (msg) => { // 获取镜屏推送消息
98
      this.personLayer.eachLayer(layer => {
99
        this.map.removeLayer(layer)
100
        this.map.closePopup()
101
      })
102
      this.load()
103
    })
104
    // this.changePoint('1')
128 105
  },
129 106
  methods: {
130 107
    loadMap() {
@ -144,17 +121,18 @@ export default {
144 121
    load() {
145 122
      this.personLayer = new Ai.FeatureGroup()
146 123
      this.$test
147
        .post(services.rescue.RESCUE_LOCATION, '')
124
        .post(services.alarm.LOAD_ALARM_DETAILS, '')
148 125
        .then((res) => {
149 126
          console.log(res)
150
          res.data.dataList.forEach(element => {
151
            if (element.alarm) {
152
              var alarmPoint = this.point(element.alarm)
127
          this.map.addLayer(this.personLayer)
128
          res.data.forEach(element => {
129
            var alarmPoint = null
130
            if (element.rescueTargetEntityPosition) {
131
              alarmPoint = this.point(element)
153 132
            }
154
            if (element.rescuer) {
155
              var rescuerPoint = this.point(element.rescuer)
156
              var lineWktStr = 'LINESTRING ( ' + element.alarm.longitude + ' ' + element.alarm.latitude + ',' + element.rescuer.longitude + ' ' + element.rescuer.latitude + ')'
157
              console.log(lineWktStr)
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 + ')'
158 136
              var lineLayer = new Ai.Polyline(lineWktStr, {color: 'red', opacity: 1.0})
159 137
              alarmPoint.getAttributes().lineLayer = lineLayer
160 138
              rescuerPoint.getAttributes().lineLayer = lineLayer
@ -163,74 +141,102 @@ export default {
163 141
              this.map.addLayer(lineLayer)
164 142
            }
165 143
          })
166
          console.log(this.personLayer)
167
          this.map.addLayer(this.personLayer)
168
          this.map.setViewPort([this.personLayer])
144
          // this.map.setViewPort([this.personLayer])
169 145
        })
170 146
        .catch((res) => {
171 147
          // 请求失败处理...
172 148
        })
149
      this.$test
150
        .post(services.organization.EQUIPMENT_NOT_BIND, {})
151
        .then((res) => {
152
          console.log(res)
153
          res.data.forEach(e => {
154
          })
155
        })
156
        .catch((res) => {
157
        // 请求失败处理...
158
        })
173 159
    },
174 160
    changePoint(msg) {
175 161
      var obj = JSON.parse(msg)
176
      this.personLayer.eachLayer((point) => {
177
        if (point.getAttributes().deviceId == obj.deviceId) {
178
          if (obj.locationStatus === '0' || obj.locationStatus === '1' || obj.locationStatus === '2' || obj.locationStatus === '3') {
179
            if (point.getAttributes().point) {
180
              point.getAttributes().point.remove()
181
            }
162
      if (obj.data.currentEntityPosition) {
163
        this.personLayer.eachLayer((point) => {
164
          if (point.getAttributes().rescueEntityPosition && point.getAttributes().rescueEntityPosition.entityId == obj.data.currentEntityPosition.entityId) {
165
            point.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
166
            point.getAttributes().rescueEntityPosition = obj.data.currentEntityPosition
182 167
            if (point.getAttributes().lineLayer) {
183
              point.getAttributes().lineLayer.remove()
168
              var lineWktStr = 'LINESTRING ( ' + obj.data.currentEntityPosition.longitude + ' ' + obj.data.currentEntityPosition.latitude + ',' + point.getAttributes().rescueTargetEntityPosition.longitude + ' ' + point.getAttributes().rescueTargetEntityPosition.latitude + ')'
169
              console.log(lineWktStr)
170
              point.getAttributes().lineLayer.setPoints(lineWktStr)
171
            }
172
            if (point.getAttributes().popup) {
173
              point.getAttributes().popup.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
174
              var tips
175
              tips = '<div class="hand-alarm">救援人员</div>'
176
              var content =
177
                  '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>' + obj.data.currentEntityPosition.name + '</div>' + tips + '</div><div class="middle">' +
178
                  '<div class="row">' +
179
                  '<div>经度</div>' +
180
                  '<div>' + obj.data.currentEntityPosition.longitude + '</div>' +
181
                  '</div>' +
182
                  '<div class="row">' +
183
                  '<div>纬度</div>' +
184
                  '<div>' + obj.data.currentEntityPosition.latitude + '</div>' +
185
                  '</div>' +
186
                  '<div class="row">' +
187
                  '<div>最新定位时间</div>' +
188
                  '<div>' + new Date(obj.data.currentEntityPosition.createDate) + '</div>' +
189
                  '</div></div></div>' +
190
                  '</div></div>'
191
              point.getAttributes().popup.setContent(content)
184 192
            }
185
          } else {
186
            point.setLatLng([obj.latitude, obj.longitude])
193
          } else if (point.getAttributes().rescueTargetEntityPosition && point.getAttributes().rescueTargetEntityPosition.entityId == obj.data.currentEntityPosition.entityId) {
194
            point.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
195
            point.getAttributes().rescueTargetEntityPosition = obj.data.currentEntityPosition
187 196
            if (point.getAttributes().lineLayer) {
188
              var lineWktStr = 'LINESTRING ( ' + obj.longitude + ' ' + obj.latitude + ',' + point.getAttributes().point.getLng() + ' ' + point.getAttributes().point.getLat() + ')'
197
              var lineWktStr = 'LINESTRING ( ' + obj.data.currentEntityPosition.longitude + ' ' + obj.data.currentEntityPosition.latitude + ',' + point.getAttributes().rescueEntityPosition.longitude + ' ' + point.getAttributes().rescueEntityPosition.latitude + ')'
198
              console.log(lineWktStr)
189 199
              point.getAttributes().lineLayer.setPoints(lineWktStr)
190 200
            }
201
            if (point.getAttributes().popup) {
202
              point.getAttributes().popup.setLatLng([obj.data.currentEntityPosition.latitude, obj.data.currentEntityPosition.longitude])
203
              // point.getAttributes().popup.setContent(content)
204
            }
191 205
          }
192
        }
193
      })
206
        })
207
      }
194 208
    },
195 209
    point(e) {
210
      console.log(e)
196 211
      var icon, tips
197 212
      var callHelp = ''
198 213
      var other = ''
199
      if (e.locationStatus === '4' || e.locationStatus === '5') {
200
        icon = '/static/images/sosworker.png'
201
        tips = '<div class="alarm">报警人员</div>'
202
        other = '<div class="row sos">' +
203
                  '<div>求救时间</div>' +
204
                  '<div>' + e.alarmDate + '</div>' +
205
                  '</div>' + '<div class="row sos">' +
206
                  '<div>求救时长</div>' +
207
                  '<div>' + e.alarmLong + 'min</div>' +
208
                  '</div>'
209
        if (e.isNewAlarm === '1') {
210
          callHelp = '<div style="display:flex;">' +
211
                  "<button class='point-out' onClick='window.Vue.appoint(" + JSON.stringify(e) + ")'><i style='font-size: 20px;' class='aidicon aidicon-user-outline'></i>指派</button>" +
212
                  "<button class='close-confirm' onClick='window.Vue.close(" + JSON.stringify(e) + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
213
                  '</div>'
214
        } else {
215
          callHelp = '<div style="display:flex;justify-content: flex-end;">' +
216
                  "<button class='close-confirm' onClick='window.Vue.close(" + JSON.stringify(e) + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
217
                  '</div>'
218
        }
219
      } else if (e.locationStatus === '6') {
220
        icon = '/static/images/outlineworker.png'
221
        tips = '<div class="hand-alarm">救援人员</div>'
214
      var className = 'alarm'
215
      icon = '/static/images/sosworker.png'
216
      if (e.businessType == '2') {
217
        className = 'hand-alarm'
218
      } else if (e.businessType == '4') {
219
        className = 'offline'
222 220
      }
223
      // var point = Ai.Point([e.latitude, e.longitude], {
224
      //   icon: Ai.Icon({
225
      //     // 设置图标URL路径
226
      //     iconUrl: icon,
227
      //     // 设置图标大小
228
      //     iconSize: [20, 20],
229
      //     // 设置点对象和图标的相对偏移量
230
      //     iconAnchor: [0, 0]
231
      //   })
232
      // })
233
      var point = Ai.Point([e.latitude, e.longitude], {
221
      tips = '<div class="' + className + '">' + e.businessTypeZH + '</div>'
222
      other = '<div class="row sos">' +
223
                '<div>求救时间</div>' +
224
                '<div>' + e.alarmTime + '</div>' +
225
                '</div>' + '<div class="row sos">' +
226
                '<div>求救时长</div>' +
227
                '<div>' + 1 + 'min</div>' +
228
                '</div>'
229
      if (e.isAssignAlarm == '0') {
230
        callHelp = '<div style="display:flex;">' +
231
                "<button class='point-out' onClick='window.Vue.appoint(" + JSON.stringify(e) + ")'><i style='font-size: 20px;' class='aidicon aidicon-user-outline'></i>指派</button>" +
232
                "<button class='close-confirm' onClick='window.Vue.close(" + JSON.stringify(e) + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
233
                '</div>'
234
      } else {
235
        callHelp = '<div style="display:flex;justify-content: flex-end;">' +
236
                "<button class='close-confirm' onClick='window.Vue.close(" + JSON.stringify(e) + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
237
                '</div>'
238
      }
239
      var point = Ai.Point([e.rescueTargetEntityPosition.latitude, e.rescueTargetEntityPosition.longitude], {
234 240
        icon: Ai.DivIcon({
235 241
          html: '<img src="' + icon + '"/>',
236 242
          className: 'myicon-lv',
@ -241,37 +247,86 @@ export default {
241 247
        })
242 248
      })
243 249
      point.setAttributes(e)
244
      point.on('click', (pointE) => {
245
        var content =
246
                  '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>' + e.userName + '</div>' + tips + '</div><div class="middle"><div class="row">' +
250
      var content =
251
                  '<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">' +
247 252
                  '<div>终端编号</div>' +
248
                  '<div>' + e.deviceNo + '</div>' +
253
                  '<div>' + e.terminalId + '</div>' +
249 254
                  '</div>' +
250 255
                  '<div class="row">' +
251 256
                  '<div>经度</div>' +
252
                  '<div>' + e.longitude + '</div>' +
257
                  '<div>' + e.rescueTargetEntityPosition.longitude + '</div>' +
253 258
                  '</div>' +
254 259
                  '<div class="row">' +
255 260
                  '<div>纬度</div>' +
256
                  '<div>' + e.latitude + '</div>' +
261
                  '<div>' + e.rescueTargetEntityPosition.latitude + '</div>' +
257 262
                  '</div>' + other +
258 263
                  '<div class="row">' +
259 264
                  '<div>最新定位时间</div>' +
260
                  '<div>' + e.newDate + '</div>' +
265
                  '<div>' + e.alarmTime + '</div>' +
261 266
                  '</div></div></div>' + callHelp +
262 267
                  '</div></div>'
263
        var popup = Ai.Popup({
264
          minWidth: 300,
265
          offset: [0, -10],
266
          autoClose: true,
267
          closeButton: false
268
        })
268
      var popup = Ai.Popup({
269
        minWidth: 300,
270
        offset: [0, -10],
271
        autoClose: false,
272
        closeButton: true
273
      })
269 274
        // 设置弹出框弹出位置
270
        popup.setLatLng(point.getLatLng())
275
        .setLatLng(point.getLatLng())
271 276
        // 设置弹出框弹出内容
272
        popup.setContent(content)
277
        .setContent(content)
278
        .openOn(this.map)
279
      point.on('click', (pointE) => {
280
        popup.openOn(this.map)
281
      })
282
      point.getAttributes().popup = popup
283
      this.personLayer.addLayer(point)
284
      return point
285
    },
286
    rescuerPoint(e) {
287
      var icon, tips
288
      icon = '/static/images/outlineworker.png'
289
      tips = '<div class="hand-alarm">救援人员</div>'
290
      var point = Ai.Point([e.rescueEntityPosition.latitude, e.rescueEntityPosition.longitude], {
291
        icon: Ai.DivIcon({
292
          html: '<img src="' + icon + '"/>',
293
          className: 'myicon-lv',
294
          // 设置图标大小
295
          iconSize: [20, 20],
296
          // 设置点对象和图标的相对偏移量
297
          iconAnchor: [10, 20]
298
        })
299
      })
300
      point.setAttributes(e)
301
      var content =
302
                  '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>' + e.rescueEntityPosition.name + '</div>' + tips + '</div><div class="middle">' +
303
                  '<div class="row">' +
304
                  '<div>经度</div>' +
305
                  '<div>' + e.rescueEntityPosition.longitude + '</div>' +
306
                  '</div>' +
307
                  '<div class="row">' +
308
                  '<div>纬度</div>' +
309
                  '<div>' + e.rescueEntityPosition.latitude + '</div>' +
310
                  '</div>' +
311
                  '<div class="row">' +
312
                  '<div>最新定位时间</div>' +
313
                  '<div>' + e.rescueEntityPosition.doneDate + '</div>' +
314
                  '</div></div></div>' +
315
                  '</div></div>'
316
      var popup = Ai.Popup({
317
        minWidth: 300,
318
        offset: [0, -10],
319
        autoClose: false,
320
        closeButton: true
321
      })
322
      // 设置弹出框弹出位置
323
      popup.setLatLng(point.getLatLng())
324
      // 设置弹出框弹出内容
325
      popup.setContent(content)
326
      popup.openOn(this.map)
327
      point.getAttributes().popup = popup
328
      point.on('click', (pointE) => {
273 329
        popup.openOn(this.map)
274
        point.getAttributes().popup = popup
275 330
      })
276 331
      this.personLayer.addLayer(point)
277 332
      return point
@ -283,72 +338,121 @@ export default {
283 338
      this.modal = false
284 339
    },
285 340
    appoint(item) { // 打开指派Modal
286
      console.log(item)
341
      this.modal = true
287 342
      this.$test
288
        .post(services.rescue.RESCUER_LIST, '')
343
        .post(services.organization.BIND_DEVICE, {})
289 344
        .then((res) => {
290
          this.modal = true
291 345
          console.log(res)
292
          this.appointAlarmId = item.alarmLogId
293
          this.rescuer = res.data.dataList
346
          this.rescuer = res.data
294 347
        })
295 348
        .catch((res) => {
296
349
          // 请求失败处理...
297 350
        })
351
      this.appointAlarm = item
298 352
    },
299 353
    appointSubmit() { // 指派
300 354
      console.log(this.formValidate.rescue)
301 355
      this.$refs['formValidate'].validate(valid => {
302 356
        console.log(valid)
303 357
        if (valid) {
304
          var params = new FormData()
305
          params.append('data', JSON.stringify({
306
            alarmLogId: this.appointAlarmId,
307
            rescuersId: this.formValidate.rescue
308
          }))
309 358
          this.$test
310
            .post(services.rescue.ASSIGN_RESCUER, params)
359
            .post(services.alarm.ASSIGN_RESCUER, {workTaskId: this.appointAlarm.workTaskId, rescuersId: this.formValidate.rescue})
311 360
            .then((res) => {
312
              if (res.data.result) {
313
                this.$Message.success('指派成功!')
314
                this.load()
315
                this.modal = false
316
              } else {
317
                this.$Message.danger('指派失败!')
318
                this.modal = false
319
              }
361
              this.modal = false
362
              this.personLayer.eachLayer(layer => {
363
                this.map.removeLayer(layer)
364
                this.map.closePopup()
365
              })
366
              this.load()
367
              // var alarmPoint = this.rescuerPoint({rescueEntityPosition: res.data})
368
              // var lineWktStr = 'LINESTRING ( ' + res.data.longitude + ' ' + res.data.latitude + ',' + this.appointAlarm.rescueTargetEntityPosition.longitude + ' ' + this.appointAlarm.rescueTargetEntityPosition.latitude + ')'
369
              // var lineLayer = new Ai.Polyline(lineWktStr, {color: 'red', opacity: 1.0})
370
              // this.personLayer.addLayer(alarmPoint)
371
              // this.map.addLayer(lineLayer)
372
              // var that = this
373
              // this.personLayer.eachLayer(layer => {
374
              //   if (layer.getAttributes().rescueTargetEntityPosition.entityId === that.appointAlarm.rescueTargetEntityPosition.entityId) {
375
              //     var className = 'alarm'
376
              //     if (layer.getAttributes().businessType == '2') {
377
              //       className = 'hand-alarm'
378
              //     } else if (layer.getAttributes().businessType == '4') {
379
              //       className = 'offline'
380
              //     }
381
              //     var tips = '<div class="' + className + '">' + layer.getAttributes().businessTypeZH + '</div>'
382
              //     var content =
383
              //     '<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">' +
384
              //     '<div>终端编号</div>' +
385
              //     '<div>' + layer.getAttributes().terminalId + '</div>' +
386
              //     '</div>' +
387
              //     '<div class="row">' +
388
              //     '<div>经度</div>' +
389
              //     '<div>' + layer.getAttributes().rescueTargetEntityPosition.longitude + '</div>' +
390
              //     '</div>' +
391
              //     '<div class="row">' +
392
              //     '<div>纬度</div>' +
393
              //     '<div>' + layer.getAttributes().rescueTargetEntityPosition.latitude + '</div>' +
394
              //     '</div>' + '<div class="row sos">' +
395
              //   '<div>求救时间</div>' +
396
              //   '<div>' + layer.getAttributes().alarmTime + '</div>' +
397
              //   '</div>' + '<div class="row sos">' +
398
              //   '<div>求救时长</div>' +
399
              //   '<div>' + 1 + 'min</div>' +
400
              //   '</div>' +
401
              //     '<div class="row">' +
402
              //     '<div>最新定位时间</div>' +
403
              //     '<div>' + layer.getAttributes().alarmTime + '</div>' +
404
              //     '</div></div></div>' + '<div style="display:flex;justify-content: flex-end;">' +
405
              //   "<button class='close-confirm' onClick='window.Vue.close(" + JSON.stringify(layer.getAttributes()) + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
406
              //   '</div>' +
407
              //     '</div></div>'
408
              //     layer.getAttributes().popup.setContent(content).openOn(this.map)
409
              //     alarmPoint.getAttributes().lineLayer = lineLayer
410
              //     layer.getAttributes().lineLayer = lineLayer
411
              //     alarmPoint.getAttributes().point = layer
412
              //     layer.getAttributes().point = alarmPoint
413
              //   }
414
              // })
320 415
            })
321 416
            .catch((res) => {
322
417
              // 请求失败处理...
323 418
            })
324 419
        }
325 420
      })
326 421
    },
327 422
    close(item) {
328 423
      this.$Confirm.confirm({
329
        title: '确认要关闭张三落水报警吗?',
424
        title: '确认要关闭' + item.rescueTargetEntityPosition.name + item.businessTypeZH + '吗?',
330 425
        content: '关闭后将不再进行报警显示',
331 426
        ok: () => {
332
          console.log(item.alarmLogId)
333
          var params = new FormData()
334
          params.append('data', JSON.stringify({
335
            alarmLogId: item.alarmLogId
336
          }))
427
          console.log(item)
337 428
          this.$test
338
            .post(services.rescue.CLOSE_RESCUE, params)
429
            .post(services.alarm.CLOSE_RESCUE, {workTaskId: item.workTaskId, isAssignAlarm: item.isAssignAlarm})
339 430
            .then((res) => {
340
              console.log(res.data.result)
341
              if (res.data.result) {
342
                this.layer.personLayer.eachLayer(layer => {
343
                  if (layer.getAttributes().deviceId === item.deviceId) {
344
                    item.locationStatus = '0'
345
                    this.popupContent(item, layer)
346
                  }
347
                })
348
              }
431
              console.log(res)
432
              this.personLayer.eachLayer(layer => {
433
                this.map.removeLayer(layer)
434
                this.map.closePopup()
435
              })
436
              this.load()
437
              // var chooseLayer
438
              // this.personLayer.eachLayer(layer => {
439
              //   if (layer.getAttributes().rescueTargetEntityPosition.entityId === item.rescueTargetEntityPosition.entityId) {
440
              //     chooseLayer = layer
441
              //     if (layer.getAttributes().point) {
442
              //       this.map.removeLayer(layer.getAttributes().point)
443
              //       this.map.closePopup(layer.getAttributes().point.popup)
444
              //       this.map.removeLayer(layer.getAttributes().lineLayer)
445
              //     }
446
              //   }
447
              // })
448
              // this.personLayer.removeLayer(chooseLayer)
449
              // if (chooseLayer.getAttributes().point) {
450
              //   this.personLayer.removeLayer(chooseLayer.getAttributes().point)
451
              // }
452
              // this.map.closePopup(chooseLayer.popup)
349 453
            })
350 454
            .catch((res) => {
351
455
            // 请求失败处理...
352 456
            })
353 457
        },
354 458
        cancel: () => {

+ 71 - 16
ebc-middle-platform/src/modules/layouts/BasicLayout.vue

@ -26,16 +26,15 @@
26 26
      <div class="rescue">
27 27
        <div>救援人员:</div>
28 28
        <div>
29
          <t-select placeholder="请选择救援人员" width="150">
30
            <t-option>张三(zhangsan)</t-option>
31
            <t-option>李四(lisi)</t-option>
29
          <t-select v-model="rescue" placeholder="请选择救援人员" width="150">
30
            <t-option v-for="(item,index) in personList" :key="index" :value="item.workEmployeeId">{{ item.workEmployeeName }}</t-option>
32 31
          </t-select>
33 32
        </div>
34 33
      </div>
35 34
      <div slot="footer">
36
        <t-button @click="closeAlarmModal">直接关闭报警</t-button>
37
        <t-button color="success" @click="closeAlarmModal">确认并稍后指派</t-button>
38
        <t-button color="success" @click="closeAlarmModal">确认并立即指派</t-button>
35
        <t-button @click="closeModal">直接关闭报警</t-button>
36
        <t-button color="success" @click="close">确认并稍后指派</t-button>
37
        <t-button color="success" @click="closeModalAndAppoint">确认并立即指派</t-button>
39 38
      </div>
40 39
    </t-modal>
41 40
  </global-layout>
@ -46,6 +45,7 @@ import GlobalLayout from '../page/GlobalLayout.vue'
46 45
import EventBus from '../../bus'
47 46
import StompClient from '../../stomp/ipu-stomp'
48 47
import {socketUrl} from '../../constants'
48
import services from '../../conf/services'
49 49
export default {
50 50
  name: 'BasicLayout',
51 51
  components: {
@ -55,9 +55,12 @@ export default {
55 55
    return {
56 56
      modal: false,
57 57
      stompClient: null,
58
      personList: [],
59
      rescue: '',
58 60
      alarmObj: {
59 61
        alarmType: '',
60 62
        alarmLocation: '',
63
        workTaskId: '',
61 64
        userName: ''
62 65
      }
63 66
    }
@ -69,21 +72,70 @@ export default {
69 72
  },
70 73
  mounted() {
71 74
    // 镜屏调用
75
    this.load()
72 76
    this.connect()
73 77
  },
74 78
  methods: {
75
    closeAlarmModal() {
76
      this.modal = false
79
    load() {
80
      this.$test
81
        .post(services.organization.BIND_DEVICE, {})
82
        .then((res) => {
83
          console.log(res)
84
          this.personList = res.data
85
        })
86
        .catch((res) => {
87
          // 请求失败处理...
88
        })
89
    },
90
    closeModalAndAppoint() {
91
      if (!this.rescue) {
92
        this.$Message.warning('请选择救援人!')
93
        return
94
      }
95
      this.$test
96
        .post(services.alarm.ASSIGN_RESCUER, {workTaskId: this.alarmObj.workTaskId, rescuersId: this.rescue})
97
        .then((res) => {
98
          this.modal = false
99
          EventBus.$emit('reload', true)
100
        })
101
        .catch((res) => {
102
          // 请求失败处理...
103
        })
104
    },
105
    closeModal() {
106
      this.$Confirm.confirm({
107
        title: '请确认',
108
        content: '是否关闭?关闭后不可恢复',
109
        ok: () => {
110
          this.$test
111
            .post(services.alarm.CLOSE_RESCUE, {workTaskId: this.alarmObj.workTaskId, isAssignAlarm: 0})
112
            .then((res) => {
113
              this.modal = false
114
            })
115
            .catch((res) => {
116
              // 请求失败处理...
117
            })
118
        }
119
      })
120
    },
121
    close() {
122
      this.$Confirm.confirm({
123
        title: '请确认',
124
        content: '是否关闭稍后指派?',
125
        ok: () => {
126
          this.modal = false
127
          EventBus.$emit('reload', true)
128
        }
129
      })
77 130
    },
78 131
    alarmOpen(msg) {
79 132
      console.log(msg)
80
      var obj = JSON.parse(msg)
81
      if (obj.isNewAlarm == '1') {
82
        this.alarmObj.alarmType = obj.alarmType
83
        this.alarmObj.alarmLocation = obj.longitude + ' , ' + obj.latitude
84
        this.alarmObj.userName = obj.userName
85
        this.modal = true
86
      }
133
      var obj = JSON.parse(msg.body)
134
      this.alarmObj.alarmType = obj.data.businessTypeZH
135
      this.alarmObj.alarmLocation = obj.data.longitude + ' , ' + obj.data.latitude
136
      this.alarmObj.userName = obj.data.employeeName
137
      this.alarmObj.workTaskId = obj.data.workTaskId
138
      this.modal = true
87 139
    },
88 140
    connect() {
89 141
      if (this.stompClient == null || !this.stompClient.connected()) {
@ -97,9 +149,12 @@ export default {
97 149
      console.log('connectCallback')
98 150
      this.stompClient.subscribe('personnel', (msg) => {
99 151
        console.log(msg)
100
        this.alarmOpen(msg.body)
101 152
        EventBus.$emit('person', msg.body)
102 153
      })
154
      this.stompClient.subscribe('alarm', (msg) => {
155
        console.log('alarm' + msg)
156
        this.alarmOpen(msg)
157
      })
103 158
      this.stompClient.subscribe('ship', (msg) => {
104 159
        console.log(msg)
105 160
        EventBus.$emit('ship', msg.body)

+ 57 - 40
ebc-middle-platform/src/modules/orientation/orientation.vue

@ -90,7 +90,7 @@
90 90
            style="width: 200px"
91 91
          ></t-input>
92 92
          <div>
93
            <div v-for="(item,index) in personList" :class="trackPerson==item.code?'active':''" :key="index" @click="personTrack(item)">{{ item.name }}</div>
93
            <div v-for="(item,index) in personList" :class="trackPerson.workEmployeeCode==item.workEmployeeCode?'active':''" :key="index" @click="personTrack(item)">{{ item.workEmployeeName }}</div>
94 94
          </div>
95 95
        </div>
96 96
        <div class="track-modal-right">
@ -115,13 +115,13 @@
115 115
              placeholder="请选择时间"
116 116
              @date-change="onChangeDate">
117 117
            </t-date-picker>
118
            <div style="display: flex;line-height:32.5px;width: 120px;">
118
            <!-- <div style="display: flex;line-height:32.5px;width: 120px;">
119 119
              <div>速度</div>
120 120
              <t-select>
121 121
                <t-option>1x</t-option>
122 122
                <t-option>2x</t-option>
123 123
              </t-select>
124
            </div>
124
            </div> -->
125 125
            <t-button color="success" icon="video-outline" @click="playback()">回放</t-button>
126 126
            <t-button color="secondary" icon="upload-outline" @click="toExport"
127 127
            >导出至Excel</t-button
@ -224,6 +224,7 @@ export default {
224 224
        currentIndex: 0
225 225
      },
226 226
      trackMap: null,
227
	  trackPath: null,
227 228
      rangeDate: '',
228 229
      rescueModal: false,
229 230
      formValidate: {
@ -875,7 +876,12 @@ export default {
875 876
    },
876 877
    personTrack(item) {
877 878
      console.log(item)
878
      this.trackPerson = item.code
879
      console.log(this.trackMap.hasLayer(this.trackPath))
880
      if (this.trackMap.hasLayer(this.trackPath)) {
881
        this.trackMap.removeLayer(this.trackPath)
882
        this.trackPath.hideTraceFrom(this.trackMap)
883
      }
884
      this.trackPerson = item
879 885
      if (this.orgId !== item.orgId) {
880 886
        this.$test
881 887
          .post(services.organization.FENCE_BY_DEPARTMENT, {entityId: item.orgId})
@ -896,46 +902,57 @@ export default {
896 902
      }
897 903
    },
898 904
    playback() {
899
      var coords = [[40.026037, 116.323928, '1'], [40.017886, 116.328048], [40.00763, 116.336631], [39.99132, 116.338348], [39.97527, 116.341094], [39.96685, 116.346244], [39.96633, 116.354827], [39.96580, 116.37233], [39.96659, 116.38538], [39.96685, 116.40048], [39.96685, 116.41834], [39.96028, 116.419029], [39.95501, 116.41937], [39.92501, 116.41937], [39.91501, 116.41937], [39.90501, 116.41937], [39.87501, 116.41937]]
900
      var defaultOptions = {
901
        paused: false,
902
        reverse: false,
903
        delay: 800,
904
        dashArray: [10, 20],
905
        weight: 5,
906
        opacity: 0.9,
907
        color: '#0000ff',
908
        pulseColor: '#FFFFFF',
909
        playerTrack: true,
910
        traceTitle: true,
911
        traceIcon: new Ai.Icon({
912
          iconUrl: 'http://192.168.74.189:9999/gisapi/images/man-or32.png',
913
          iconSize: [36, 36],
914
          iconAnchor: [18, 36]
915
        }),
916
        titleOptions: {
917
          className: 'trace_title',
918
          iconSize: null,
919
          iconAnchor: [48, 57]
905
      console.log(this.trackQueryCondition.currentIndex)
906
      var params = {}
907
      if (this.trackQueryCondition.currentIndex === 3) {
908
        if (!this.rangeDate) {
909
          this.$Message.warning('请选择时间!')
910
          return
911
        } else {
912
          params = {
913
            entityId: this.trackPerson.workEmployeeId,
914
            timeType: (this.trackQueryCondition.currentIndex + 1),
915
            startTime: this.rangeDate[0],
916
            endTime: this.rangeDate[1]
917
          }
918
        }
919
      } else {
920
        params = {
921
          entityId: this.trackPerson.workEmployeeId,
922
          timeType: (this.trackQueryCondition.currentIndex + 1)
920 923
        }
921 924
      }
922
      var path = new Ai.DynamicPath(coords, defaultOptions)
923
      this.trackMap.addLayer(path)
924
      path.playTraceOn(this.trackMap)
925
      // path1.playTraceOn(this.trackMap)
926
      var params = new FormData()
927
      params.append('data', JSON.stringify({
928
        deviceId: '981453',
929
        timeType: 4,
930
        pageNum: 1,
931
        pageSize: 20,
932
        beginTime: '2020-11-05 14:01:01',
933
        endTime: '2020-11-05 14:18:14'
934
      }))
925
      console.log(this.rangeDate)
935 926
      this.$test
936
        .post(services.device.DEVICE_TRACK, params)
927
        .post(services.organization.EMPLOYEE_TRACE, params)
937 928
        .then((res) => {
938
          console.log(res.data)
929
          console.log(res)
930
          var coords = res.data.coordArray
931
          var defaultOptions = {
932
            paused: false,
933
            reverse: false,
934
            delay: 800,
935
            dashArray: [10, 20],
936
            weight: 5,
937
            opacity: 0.9,
938
            color: '#0000ff',
939
            pulseColor: '#FFFFFF',
940
            playerTrack: true,
941
            traceTitle: false,
942
            traceIcon: new Ai.Icon({
943
              iconUrl: '/static/images/normalworker.png',
944
              iconSize: [16, 16],
945
              iconAnchor: [8, 8]
946
            }),
947
            titleOptions: {
948
              className: 'trace_title',
949
              iconSize: null,
950
              iconAnchor: [48, 57]
951
            }
952
          }
953
          this.trackPath = new Ai.DynamicPath(coords, defaultOptions)
954
          this.trackMap.addLayer(this.trackPath)
955
          this.trackPath.playTraceOn(this.trackMap)
939 956
        })
940 957
        .catch((res) => {
941 958
          // 请求失败处理...