瀏覽代碼

优化等

wangkang3 4 年之前
父節點
當前提交
65a3c4d468

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

@ -152,13 +152,10 @@ export default {
152 152
  },
153 153
  equipment: {
154 154
    EQUIPMENT_TYPE: '/equipment/loadAllResourceToolType', // 获取所有设备类型
155
    GET_ALL_EQUIPMENT: '/equipment/queryAllEquipmentInfo', // 查询所有设备信息
156 155
    GET_EQUIPMENT: '/equipment/queryEquipmentInfo', // 查询设备管理信息
157 156
    CREATE_EQUIPMENT: '/equipment/createEquipmentInfo', // 新增设备管理信息
158 157
    UPDATE_EQUIPMENT: '/equipment/modifyEquipmentInfo',
159
    DEL_EQUIPMENT: '/equipment/deleteEquipmentInfo', // 删除设备管理信息
160
    REPETITION_EQUIPMENT: '/equipment/verifyEquipmentInfoRepetition', // 删除设备管理信息
161
    GET_ONE_EQUIPMENT: '/equipment/queryOneEquipmentInfo' // 查询单个设备信息
158
    DEL_EQUIPMENT: '/equipment/deleteEquipmentInfo' // 删除设备管理信息
162 159
  },
163 160
  device: {
164 161
    GET_ASSOCIATINFO: '/device/queryAssociatInfo', // 关联列表信息查询

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

@ -182,6 +182,12 @@
182 182
        text-align: left;
183 183
      }
184 184
    }
185
    .sos{
186
      color:#F5222D;
187
      font-size: 8px;
188
      height: 25px;
189
      line-height: 25px;
190
    }
185 191
  }
186 192
  .point-out{
187 193
    color: #fff;
@ -199,4 +205,22 @@
199 205
      margin: 7.5px 10px 0 0;
200 206
    }
201 207
  }
208
}
209
210
.myicon-lv img{
211
  width: 20px;
212
  height: 20px;
213
  animation:myicon 1s ease infinite;
214
  -webkit-animation:myicon 1s ease infinite;
215
}
216
@keyframes myicon{
217
  0% {
218
    opacity: 0;
219
  }
220
  30% {
221
    opacity: 0;
222
  }
223
  100%{
224
    opacity: 1;
225
  }
202 226
}

+ 146 - 25
ebc-middle-platform/src/modules/call-help/current.vue

@ -38,14 +38,13 @@
38 38
      <t-form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80" label-position="left">
39 39
        <t-form-item label="救援人员" prop="rescue">
40 40
          <t-select v-model="formValidate.rescue" placeholder="请选择">
41
            <t-option>张三</t-option>
42
            <t-option>李四</t-option>
41
            <t-option v-for="(item, index) in rescuer" :key="index+'rescuer'" :value="item.ID">{{ item.NAME }}</t-option>
43 42
          </t-select>
44 43
        </t-form-item>
45 44
      </t-form>
46 45
      <div slot="footer">
47 46
        <t-button @click="cancel">取消</t-button>
48
        <t-button class="submit-button" @click="appoint()">指派</t-button>
47
        <t-button class="submit-button" @click="appointSubmit()">指派</t-button>
49 48
      </div>
50 49
    </t-modal>
51 50
  </div>
@ -54,6 +53,7 @@
54 53
import './current.scss'
55 54
import {GIS_SEA_LAYER_URL, GIS_SEA_URL} from '../../constants'
56 55
import services from '../../conf/services'
56
import EventBus from '../../bus'
57 57
export default {
58 58
  data() {
59 59
    return {
@ -100,48 +100,98 @@ export default {
100 100
        rescue: [{
101 101
          required: true,
102 102
          message: '救援人员不能为空',
103
          trigger: 'blur'
103
          trigger: 'blur',
104
          validator(rule, value, callback) {
105
            console.log(value)
106
            if (!value) {
107
              callback(rule.message)
108
            } else {
109
              callback()
110
            }
111
          }
104 112
        }]
105 113
      },
106 114
      map: null,
107 115
      alarmPoint: null,
108 116
      rescuePoint: null,
109 117
      polyline: null,
110
      personLayer: new Ai.FeatureGroup()
118
      personLayer: new Ai.FeatureGroup(),
119
      rescuer: []
111 120
    }
112 121
  },
113 122
  mounted() {
114
    window.Vue = this
115
    this.map = new Ai.Map('current-map', {
116
      ak: this.$store.getters.getGisToken,
117
      center: [39.915599, 116.406568],
118
      zoom: 5
123
    this.loadMap()
124
    EventBus.$on('person', (msg) => { // 获取镜屏推送消息
125
      console.log(msg)
126
      this.changePoint(msg)
119 127
    })
120
    var maplayer = null
121
    maplayer = Ai.TileLayer(GIS_SEA_LAYER_URL)
122
    this.map.addLayer(maplayer)
123
    var la = Ai.WMTSLayer(GIS_SEA_URL)
124
    this.map.addLayer(la)
125
    this.load()
126 128
  },
127 129
  methods: {
130
    loadMap() {
131
      window.Vue = this
132
      this.map = new Ai.Map('current-map', {
133
        ak: this.$store.getters.getGisToken,
134
        center: this.$store.getters.getMapParam.center,
135
        zoom: this.$store.getters.getMapParam.zoom
136
      })
137
      var maplayer = null
138
      maplayer = Ai.TileLayer(GIS_SEA_LAYER_URL)
139
      this.map.addLayer(maplayer)
140
      var la = Ai.WMTSLayer(GIS_SEA_URL)
141
      this.map.addLayer(la)
142
      this.load()
143
    },
128 144
    load() {
145
      this.personLayer = new Ai.FeatureGroup()
129 146
      this.$test
130 147
        .post(services.rescue.RESCUE_LOCATION, '')
131 148
        .then((res) => {
132 149
          console.log(res)
133 150
          res.data.dataList.forEach(element => {
134
            this.point(element.alarm)
151
            if (element.alarm) {
152
              var alarmPoint = this.point(element.alarm)
153
            }
135 154
            if (element.rescuer) {
136
              this.point(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)
158
              var lineLayer = new Ai.Polyline(lineWktStr, {color: 'red', opacity: 1.0})
159
              alarmPoint.getAttributes().lineLayer = lineLayer
160
              rescuerPoint.getAttributes().lineLayer = lineLayer
161
              alarmPoint.getAttributes().point = rescuerPoint
162
              rescuerPoint.getAttributes().point = alarmPoint
163
              this.map.addLayer(lineLayer)
137 164
            }
138 165
          })
166
          console.log(this.personLayer)
139 167
          this.map.addLayer(this.personLayer)
168
          this.map.setViewPort([this.personLayer])
140 169
        })
141 170
        .catch((res) => {
142 171
          // 请求失败处理...
143 172
        })
144 173
    },
174
    changePoint(msg) {
175
      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
            }
182
            if (point.getAttributes().lineLayer) {
183
              point.getAttributes().lineLayer.remove()
184
            }
185
          } else {
186
            point.setLatLng([obj.latitude, obj.longitude])
187
            if (point.getAttributes().lineLayer) {
188
              var lineWktStr = 'LINESTRING ( ' + obj.longitude + ' ' + obj.latitude + ',' + point.getAttributes().point.getLng() + ' ' + point.getAttributes().point.getLat() + ')'
189
              point.getAttributes().lineLayer.setPoints(lineWktStr)
190
            }
191
          }
192
        }
193
      })
194
    },
145 195
    point(e) {
146 196
      var icon, tips
147 197
      var callHelp = ''
@ -170,14 +220,24 @@ export default {
170 220
        icon = '/static/images/outlineworker.png'
171 221
        tips = '<div class="hand-alarm">救援人员</div>'
172 222
      }
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
      // })
173 233
      var point = Ai.Point([e.latitude, e.longitude], {
174
        icon: Ai.Icon({
175
          // 设置图标URL路径
176
          iconUrl: icon,
234
        icon: Ai.DivIcon({
235
          html: '<img src="' + icon + '"/>',
236
          className: 'myicon-lv',
177 237
          // 设置图标大小
178 238
          iconSize: [20, 20],
179 239
          // 设置点对象和图标的相对偏移量
180
          iconAnchor: [0, 0]
240
          iconAnchor: [10, 20]
181 241
        })
182 242
      })
183 243
      point.setAttributes(e)
@ -203,7 +263,8 @@ export default {
203 263
        var popup = Ai.Popup({
204 264
          minWidth: 300,
205 265
          offset: [0, -10],
206
          autoClose: true
266
          autoClose: true,
267
          closeButton: false
207 268
        })
208 269
        // 设置弹出框弹出位置
209 270
        popup.setLatLng(point.getLatLng())
@ -213,6 +274,7 @@ export default {
213 274
        point.getAttributes().popup = popup
214 275
      })
215 276
      this.personLayer.addLayer(point)
277
      return point
216 278
    },
217 279
    showModal(item) {
218 280
      this.modal = true
@ -220,15 +282,74 @@ export default {
220 282
    cancel() {
221 283
      this.modal = false
222 284
    },
223
    appoint() {
285
    appoint(item) { // 打开指派Modal
286
      console.log(item)
287
      this.$test
288
        .post(services.rescue.RESCUER_LIST, '')
289
        .then((res) => {
290
          this.modal = true
291
          console.log(res)
292
          this.appointAlarmId = item.alarmLogId
293
          this.rescuer = res.data.dataList
294
        })
295
        .catch((res) => {
296
297
        })
298
    },
299
    appointSubmit() { // 指派
300
      console.log(this.formValidate.rescue)
301
      this.$refs['formValidate'].validate(valid => {
302
        console.log(valid)
303
        if (valid) {
304
          var params = new FormData()
305
          params.append('data', JSON.stringify({
306
            alarmLogId: this.appointAlarmId,
307
            rescuersId: this.formValidate.rescue
308
          }))
309
          this.$test
310
            .post(services.rescue.ASSIGN_RESCUER, params)
311
            .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
              }
320
            })
321
            .catch((res) => {
224 322
323
            })
324
        }
325
      })
225 326
    },
226 327
    close(item) {
227 328
      this.$Confirm.confirm({
228 329
        title: '确认要关闭张三落水报警吗?',
229 330
        content: '关闭后将不再进行报警显示',
230 331
        ok: () => {
231
          console.log('点击了确定')
332
          console.log(item.alarmLogId)
333
          var params = new FormData()
334
          params.append('data', JSON.stringify({
335
            alarmLogId: item.alarmLogId
336
          }))
337
          this.$test
338
            .post(services.rescue.CLOSE_RESCUE, params)
339
            .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
              }
349
            })
350
            .catch((res) => {
351
352
            })
232 353
        },
233 354
        cancel: () => {
234 355
          console.log('点击了取消')

+ 74 - 0
ebc-middle-platform/src/modules/orientation/orientation.scss

@ -283,6 +283,9 @@ background: #344979!important;
283 283
    padding-left: 20px;
284 284
    font-size: 12px;
285 285
    color: #ffffff;
286
    div{
287
      margin-right: 15px;
288
    }
286 289
    .user-pic{
287 290
      width: 25px;
288 291
      height: 25px;
@ -291,6 +294,13 @@ background: #344979!important;
291 294
      background-size: 100% 100%;
292 295
      margin: 7.5px 5px 0 0;
293 296
    }
297
    .fengji{
298
      width: 25px;
299
      height: 25px;
300
      background-size: 100% 100%;
301
      background-image: url(/static/images/风机.png);
302
      margin-top: 7.5px;
303
    }
294 304
    .alarm{
295 305
      color: #F5222D;
296 306
      background-color: #343E6B;
@ -372,6 +382,36 @@ background: #344979!important;
372 382
    background-color: #147BD1;
373 383
    border: 1px solid #147BD1
374 384
  }
385
  .container{
386
    display: flex;
387
    flex-wrap: wrap;
388
    padding: 10px 0 10px 12px;
389
    div{
390
      width: 25%;
391
      color: #ffffff;
392
      font-size: 10px;
393
      line-height: 20px;
394
      height: 20px;
395
      margin: 10px;
396
      text-align: center;
397
      border-radius: 3px;
398
    }
399
    .sos{
400
      background-color: #F5222D;
401
      animation:pointsos 1s ease infinite;
402
      -webkit-animation:pointsos 1s ease infinite;
403
    }
404
    .normal{
405
      background-color: #19BB20;
406
    }
407
    .outline{
408
      background-color: #FAAD14;
409
    }
410
    .offline{
411
      background-color: #D9D9D9;
412
      color: #000000;
413
    }
414
  }
375 415
  .footer{
376 416
    height: 40px;
377 417
    border-top: 1px solid #E0E0E0;
@ -383,4 +423,38 @@ background: #344979!important;
383 423
      margin: 7.5px 10px 0 0;
384 424
    }
385 425
  }
426
}
427
@keyframes pointsos{
428
  0% {
429
    opacity: 0;
430
  }
431
  30% {
432
    opacity: 0;
433
  }
434
  100%{
435
    opacity: 1;
436
  }
437
}
438
.person-count{
439
  div{
440
    width: 30px;
441
    height: 30px;
442
    text-align: center;
443
    line-height: 30px;
444
    border-radius: 50%;
445
    color: #ffffff;
446
  }
447
  .sos{
448
    background-color: #F5222D;
449
  }
450
  .normal{
451
    background-color: #19BB20;
452
  }
453
  .outline{
454
    background-color: #FAAD14;
455
  }
456
  .offline{
457
    background-color: #D9D9D9;
458
    color: #000000;
459
  }
386 460
}

+ 60 - 465
ebc-middle-platform/src/modules/orientation/orientation.vue

@ -32,7 +32,6 @@
32 32
          @click="
33 33
            () => {
34 34
              trackModal = true;
35
              personTrack()
36 35
            }
37 36
          "
38 37
        >轨迹</t-button
@ -103,7 +102,7 @@
103 102
            style="width: 200px"
104 103
          ></t-input>
105 104
          <div>
106
            <div v-for="(item,index) in personList" :class="item.checked?'active':''" :key="index" @click="personTrack(item)">{{ item.userName }}</div>
105
            <div v-for="(item,index) in personList" :class="trackPerson==item.deviceId?'active':''" :key="index" @click="personTrack(item)">{{ item.userName }}</div>
107 106
          </div>
108 107
        </div>
109 108
        <div class="track-modal-right">
@ -143,7 +142,7 @@
143 142
                <t-option>2x</t-option>
144 143
              </t-select>
145 144
            </div>
146
            <t-button color="success" icon="video-outline">回放</t-button>
145
            <t-button color="success" icon="video-outline" @click="playback()">回放</t-button>
147 146
            <t-button color="secondary" icon="upload-outline" @click="toExport"
148 147
            >导出至Excel</t-button
149 148
            >
@ -162,7 +161,7 @@
162 161
      >
163 162
        <t-form-item label="救援人员" prop="rescue">
164 163
          <t-select v-model="formValidate.rescue" placeholder="请选择">
165
            <t-option v-for="(item, index) in rescuer" :key="index+'rescuer'" :value="item.id">{{ item.userName }}</t-option>
164
            <t-option v-for="(item, index) in rescuer" :key="index+'rescuer'" :value="item.ID">{{ item.NAME }}</t-option>
166 165
          </t-select>
167 166
        </t-form-item>
168 167
      </t-form>
@ -337,7 +336,8 @@ export default {
337 336
      },
338 337
      personList: [],
339 338
      rescuer: [],
340
      appointAlarmId: ''
339
      appointAlarmId: '',
340
      trackPerson: ''
341 341
    }
342 342
  },
343 343
  mounted() {
@ -369,220 +369,6 @@ export default {
369 369
          // 请求失败处理...
370 370
        })
371 371
    },
372
    changeLocation(msg) { // 修改人员信息状态等
373
      var obj = JSON.parse(msg)
374
      console.log('person' + obj)
375
      var flag = false
376
      this.layer.personLayer.eachLayer((point) => { // 遍历人员layer找到推送人员并修改
377
        if (point.getAttributes().deviceId == obj.deviceId) {
378
          flag = true
379
          point.setLatLng([obj.latitude, obj.longitude])
380
          this.popupContent(obj, point)
381
        }
382
      })
383
      if (!flag) {
384
        var point = Ai.Point([obj.latitude, obj.longitude], {
385
          icon: Ai.Icon({
386
            iconUrl: '/static/images/normalworker.png',
387
            // 设置图标大小
388
            iconSize: [20, 20],
389
            // 设置点对象和图标的相对偏移量
390
            iconAnchor: [0, 0]
391
          })
392
        })
393
        point.setAttributes(obj)
394
        this.layer.personLayer.addLayer(point)
395
        this.popupContent(obj, point)
396
      }
397
    },
398
    changeShip(msg) {
399
      var obj = JSON.parse(msg)
400
      console.log('ship' + obj)
401
      this.layer.equipmentLayer.eachLayer((point) => {
402
        if (point.getAttributes().DEVICE_NO == obj.deviceNo) {
403
          point.setLatLng([obj.latitude, obj.longitude])
404
          this.popupContentShip(obj, point)
405
        }
406
      })
407
    },
408
    popupContentShip(e, point) {
409
      point.on('click', (pointE) => {
410
        var content =
411
                  '<div class="tips-item"><div class="top"><div>' + e.shipName + '</div></div><div class="middle"><div class="row">' +
412
                  '<div>设备编号</div>' +
413
                  '<div>' + e.deviceNo + '</div>' +
414
                  '</div>' +
415
                  '<div class="row">' +
416
                  '<div>经度</div>' +
417
                  '<div>' + e.longitude + '</div>' +
418
                  '</div>' +
419
                  '<div class="row">' +
420
                  '<div>纬度</div>' +
421
                  '<div>' + e.latitude + '</div>' +
422
                  '</div>' +
423
                  '<div class="row">' +
424
                  '<div>最新定位时间</div>' +
425
                  '<div>' + e.newDate + '</div>' +
426
                  '</div>' +
427
                  '</div></div>' +
428
                  '</div></div>'
429
        Ai.Popup({
430
          minWidth: 300,
431
          offset: [0, -10],
432
          autoClose: true
433
        })
434
        // 设置弹出框弹出位置
435
          .setLatLng(point.getLatLng())
436
        // 设置弹出框弹出内容
437
          .setContent(content)
438
          .openOn(this.map)
439
      })
440
    },
441
    popupContent(e, point) { // 修改点的信息
442
      window.Vue = this
443
      var icon, tips
444
      var callHelp = ''
445
      var other = ''
446
      var attributes = point.getAttributes()
447
      if (e.locationStatus == '0') {
448
        icon = '/static/images/normalworker.png'
449
        tips = '<div class="normal">正常</div>'
450
        if (attributes.locationStatus !== e.locationStatus) {
451
          if (attributes.locationStatus == '1') {
452
            this.personStatistics.normal++
453
            this.personStatistics.offLine--
454
          } else if (attributes.locationStatus == '2' || attributes.locationStatus == '3') {
455
            this.personStatistics.normal++
456
            this.personStatistics.outLine--
457
          } else if (attributes.locationStatus == '4' || attributes.locationStatus == '5') {
458
            this.personStatistics.normal++
459
            this.personStatistics.sos--
460
          }
461
        }
462
      } else if (e.locationStatus == '1') {
463
        icon = '/static/images/offlineworker.png'
464
        tips = '<div class="offline">离线</div>'
465
        callHelp = '<div style="display:flex;">' +
466
                  "<button class='point-out' onClick='window.Vue.appoint(" + JSON.stringify(e) + ")'><i style='font-size: 20px;' class='aidicon aidicon-user-outline'></i>指派</button>" +
467
                  "<button class='close-confirm' onClick='window.Vue.close(" + JSON.stringify(e) + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
468
                  '</div>'
469
        if (attributes.locationStatus !== e.locationStatus) {
470
          if (attributes.locationStatus == '0') {
471
            this.personStatistics.offLine++
472
            this.personStatistics.normal--
473
          } else if (attributes.locationStatus == '2' || attributes.locationStatus == '3') {
474
            this.personStatistics.offLine++
475
            this.personStatistics.outLine--
476
          } else if (attributes.locationStatus == '4' || attributes.locationStatus == '5') {
477
            this.personStatistics.offLine++
478
            this.personStatistics.sos--
479
          }
480
        }
481
      } else if (e.locationStatus == '2' || e.locationStatus == '3') {
482
        icon = '/static/images/outlineworker.png'
483
        tips = '<div class="outline">违规</div>'
484
        if (e.locationStatus == '2') {
485
          other = '<div class="row outline">' +
486
                  '<div>定点停留超时</div>' +
487
                  '<div>已停留' + e.fixedLong + 'min</div>' +
488
                  '</div>'
489
        } else {
490
          other = '<div class="row outline">' +
491
                  '<div>进入时间</div>' +
492
                  '<div>' + e.inDate + '</div>' +
493
                  '</div>'
494
        }
495
        if (attributes.locationStatus !== e.locationStatus) {
496
          if (attributes.locationStatus == '0') {
497
            this.personStatistics.outLine++
498
            this.personStatistics.normal--
499
          } else if (attributes.locationStatus == '1') {
500
            this.personStatistics.outLine++
501
            this.personStatistics.offLine--
502
          } else if (attributes.locationStatus == '4' || attributes.locationStatus == '5') {
503
            this.personStatistics.outLine++
504
            this.personStatistics.sos--
505
          }
506
        }
507
      } else if (e.locationStatus == '4' || e.locationStatus == '5') {
508
        icon = '/static/images/sosworker.png'
509
        other = '<div class="row sos">' +
510
                  '<div>求救时间</div>' +
511
                  '<div>' + e.alarmDate + '</div>' +
512
                  '</div>' + '<div class="row sos">' +
513
                  '<div>求救时长</div>' +
514
                  '<div>' + e.alarmLong + 'min</div>' +
515
                  '</div>'
516
        tips = '<div class="sos">SOS</div>'
517
        if (e.isNewAlarm === '1') {
518
          callHelp = '<div style="display:flex;">' +
519
                  "<button class='point-out' onClick='window.Vue.appoint(" + JSON.stringify(e) + ")'><i style='font-size: 20px;' class='aidicon aidicon-user-outline'></i>指派</button>" +
520
                  "<button class='close-confirm' onClick='window.Vue.close(" + JSON.stringify(e) + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
521
                  '</div>'
522
        } else {
523
          callHelp = '<div style="display:flex;justify-content: flex-end;">' +
524
                  "<button class='close-confirm' onClick='window.Vue.close(" + JSON.stringify(e) + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
525
                  '</div>'
526
        }
527
        if (attributes.locationStatus !== e.locationStatus) {
528
          if (attributes.locationStatus == '0') {
529
            this.personStatistics.sos++
530
            this.personStatistics.normal--
531
          } else if (attributes.locationStatus == '1') {
532
            this.personStatistics.sos++
533
            this.personStatistics.offLine--
534
          } else if (attributes.locationStatus == '2' || attributes.locationStatus == '3') {
535
            this.personStatistics.sos++
536
            this.personStatistics.outLine--
537
          }
538
        }
539
      }
540
      if (!(e.locationStatus == '6')) {
541
        point.setIcon(Ai.Icon({
542
        // 设置图标URL路径
543
          iconUrl: icon,
544
          // 设置图标大小
545
          iconSize: [20, 20],
546
          // 设置点对象和图标的相对偏移量
547
          iconAnchor: [0, 0]
548
        }))
549
        point.setAttributes(e)
550
        point.on('click', (pointE) => {
551
          var content =
552
                  '<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">' +
553
                  '<div>终端编号</div>' +
554
                  '<div>' + e.deviceNo + '</div>' +
555
                  '</div>' +
556
                  '<div class="row">' +
557
                  '<div>经度</div>' +
558
                  '<div>' + e.longitude + '</div>' +
559
                  '</div>' +
560
                  '<div class="row">' +
561
                  '<div>纬度</div>' +
562
                  '<div>' + e.latitude + '</div>' +
563
                  '</div>' + other +
564
                  '<div class="row">' +
565
                  '<div>最新定位时间</div>' +
566
                  '<div>' + e.newDate + '</div>' +
567
                  '</div></div></div>' + callHelp +
568
                  '</div></div>'
569
          var popup = Ai.Popup({
570
            minWidth: 300,
571
            offset: [0, -10],
572
            autoClose: true
573
          })
574
          // 设置弹出框弹出位置
575
          popup.setLatLng(point.getLatLng())
576
          // 设置弹出框弹出内容
577
          popup.setContent(content)
578
          popup.openOn(this.map)
579
          point.getAttributes().popup = popup
580
        })
581
      }
582
      console.log(attributes.popup)
583
      var popup = attributes.popup
584
      popup.remove()
585
    },
586 372
    initMap() { // 加载主屏地图
587 373
      if (this.map != null && this.map != '') {
588 374
        this.map.remove()
@ -603,230 +389,61 @@ export default {
603 389
604 390
      Ai.Scale({ position: 'bottomright' }).addTo(this.map)
605 391
      Ai.Zoom({ type: 'small' }).addTo(this.map)
606
      // this.polyline()
607
      this.polygon()
608
      this.loadEquipment()
609
      this.loadPerson()
392
      this.loadMapArea()
610 393
    },
611
    polygon() { // 加载地图围栏
612
      var params = new FormData()
613
      this.$test
614
        .post(services.mapTag.GET_ALL_MAP_TAG, params)
615
        .then((res) => {
616
          // 请求成功处理...
617
          res.data.dataList.forEach((e) => {
618
            if (e.MAP_TAG_TYPE === '3') { // 电子围栏
619
              var polygon = Ai.Polygon(e.MAP_TAG_SHAPE, {
620
                color: '#A74B5C',
621
                opacity: 1.0,
622
                weight: 0
623
              })
624
              polygon.setAttributes(e)
625
              this.layer.areaLayer.addLayer(polygon)
626
            } else if (e.MAP_TAG_TYPE === '2') { // 作业区域
627
              var polygon = Ai.Polygon(e.MAP_TAG_SHAPE, {
628
                color: '#438D65',
629
                opacity: 1.0,
630
                weight: 0
631
              })
632
              polygon.setAttributes(e)
633
              this.layer.areaLayer.addLayer(polygon)
634
            }
635
          })
636
          this.map.addLayer(this.layer.areaLayer)
637
        })
638
        .catch((res) => {
639
          // 请求失败处理...
640
        })
641
    },
642
    loadEquipment() { // 加载地图设备
643
      var params = new FormData()
644
      this.$test
645
        .post(services.equipment.GET_ALL_EQUIPMENT, params)
646
        .then((res) => {
647
          // 请求成功处理...
648
          console.log(res.data)
649
          res.data.dataList.forEach((e) => {
650
            if (e.LATITUDE && e.LONGITUDE) {
651
              var icon = ''
652
              if (e.FACILITY_TYPE === '001') { // 船舶
653
                icon = '/static/images/船舶.png'
654
              } else if (e.FACILITY_TYPE === '002') { // 风机
655
                icon = '/static/images/风机.png'
656
              } else if (e.FACILITY_TYPE === '003') { // 升压站
657
                icon = '/static/images/升压站画面.png'
658
              }
659
              var point = Ai.Point([e.LATITUDE, e.LONGITUDE], {
660
                icon: Ai.Icon({
661
                  // 设置图标URL路径
662
                  iconUrl: icon,
663
                  // 设置图标大小
664
                  iconSize: [20, 20],
665
                  // 设置点对象和图标的相对偏移量
666
                  iconAnchor: [0, 0]
667
                })
668
              })
669
              point.setAttributes(e)
670
              point.on('click', (pointE) => {
671
                var deviceContent = e.DEVICE_NO ? ('<div class="row"><div>设备编号</div><div>' + e.DEVICE_NO + '</div></div>') : ''
672
                var dateCOntent = e.NEW_DATE ? ('<div class="row"><div>最新定位时间</div><div>' + e.NEW_DATE + '</div></div>') : ''
673
                var content =
674
                    '<div class="tips-item"><div class="top"><div>' + e.FACILITY_NAME + '</div></div><div class="middle">' +
675
                    deviceContent +
676
                    '<div class="row">' +
677
                    '<div>经度</div>' +
678
                    '<div>' + e.LONGITUDE + '</div>' +
679
                    '</div>' +
680
                    '<div class="row">' +
681
                    '<div>纬度</div>' +
682
                    '<div>' + e.LATITUDE + '</div>' +
683
                    '</div>' +
684
                    dateCOntent +
685
                    '</div></div>' +
686
                    '</div></div>'
687
                Ai.Popup({
688
                  minWidth: 300,
689
                  offset: [0, -10],
690
                  autoClose: true
691
                })
692
                  // 设置弹出框弹出位置
693
                  .setLatLng(point.getLatLng())
694
                  // 设置弹出框弹出内容
695
                  .setContent(content)
696
                  .openOn(this.map)
697
              })
698
              if (['001', '002', '003'].indexOf(e.FACILITY_TYPE) !== -1) {
699
                this.layer.equipmentLayer.addLayer(point)
700
              }
701
            }
702
          })
703
          this.map.addLayer(this.layer.equipmentLayer)
704
        })
705
        .catch((res) => {
706
          // 请求失败处理...
707
        })
394
    loadMapView() {
395
      // this.$test
396
      //   .post(services.mapTag.GET_MAP_PARAM, {})
397
      //   .then((res) => {
398
      //     if (res.data.success) {
399
      //     }
400
      //   })
401
      //   .catch((res) => {
402
      //     // 请求失败处理...
403
      //   })
708 404
    },
709
    loadPerson() { // 加载地图人员
710
      window.Vue = this
711
      this.personStatistics = {
712
        all: 0,
713
        offLine: 0,
714
        outLine: 0,
715
        sos: 0,
716
        normal: 0
717
      }
718
      var params = new FormData()
719
      this.$test
720
        .post(services.organization.PERSON_LOCATION, params)
721
        .then((res) => {
722
          this.personList = res.data.dataList
723
          this.personStatistics.all = res.data.dataList.length
724
          res.data.dataList.forEach((e) => {
725
            var icon, tips
726
            var callHelp = ''
727
            var other = ''
728
            if (e.locationStatus === '0') {
729
              icon = '/static/images/normalworker.png'
730
              tips = '<div class="normal">正常</div>'
731
              this.personStatistics.normal++
732
            } else if (e.locationStatus === '1') {
733
              icon = '/static/images/offlineworker.png'
734
              tips = '<div class="offline">离线</div>'
735
              callHelp = '<div style="display:flex;">' +
736
                 "<button class='point-out' onClick='window.Vue.appoint(" + JSON.stringify(e) + ")'><i style='font-size: 20px;' class='aidicon aidicon-user-outline'></i>指派</button>" +
737
                  "<button class='close-confirm' onClick='window.Vue.close(" + JSON.stringify(e) + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
738
                  '</div>'
739
              this.personStatistics.offLine++
740
            } else if (e.locationStatus === '2' || e.locationStatus === '3') {
741
              icon = '/static/images/outlineworker.png'
742
              tips = '<div class="outline">违规</div>'
743
              this.personStatistics.outLine++
744
              if (e.locationStatus == '2') {
745
                other = '<div class="row outline">' +
746
                        '<div>定点停留超时</div>' +
747
                        '<div>已停留' + e.fixedLong + 'min</div>' +
748
                        '</div>'
749
              } else {
750
                other = '<div class="row outline">' +
751
                        '<div>进入时间</div>' +
752
                        '<div>' + e.inDate + '</div>' +
753
                        '</div>'
754
              }
755
            } else if (e.locationStatus === '4' || e.locationStatus === '5') {
756
              icon = '/static/images/sosworker.png'
757
              tips = '<div class="sos">SOS</div>'
758
              other = '<div class="row sos">' +
759
                  '<div>求救时间</div>' +
760
                  '<div>' + e.alarmDate + '</div>' +
761
                  '</div>' + '<div class="row sos">' +
762
                  '<div>求救时长</div>' +
763
                  '<div>' + e.alarmLong + 'min</div>' +
764
                  '</div>'
765
              if (e.isNewAlarm === '1') {
766
                callHelp = '<div style="display:flex;">' +
767
                  "<button class='point-out' onClick='window.Vue.appoint(" + JSON.stringify(e) + ")'><i style='font-size: 20px;' class='aidicon aidicon-user-outline'></i>指派</button>" +
768
                  "<button class='close-confirm' onClick='window.Vue.close(" + JSON.stringify(e) + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
769
                  '</div>'
770
              } else {
771
                callHelp = '<div style="display:flex;justify-content: flex-end;">' +
772
                  "<button class='close-confirm' onClick='window.Vue.close(" + JSON.stringify(e) + ")'><i style='font-size: 20px;' class='aidicon aidicon-close'></i>关闭</button>" +
773
                  '</div>'
774
              }
775
776
              this.personStatistics.sos++
777
            }
778
            if (!(e.locationStatus === '6')) {
779
              var point = Ai.Point([e.latitude, e.longitude], {
780
                icon: Ai.Icon({
781
                // 设置图标URL路径
782
                  iconUrl: icon,
783
                  // 设置图标大小
784
                  iconSize: [20, 20],
785
                  // 设置点对象和图标的相对偏移量
786
                  iconAnchor: [0, 0]
787
                })
788
              })
789
              point.setAttributes(e)
790
              point.on('click', (pointE) => {
791
                var content =
792
                  '<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">' +
793
                  '<div>终端编号</div>' +
794
                  '<div>' + e.deviceNo + '</div>' +
795
                  '</div>' +
796
                  '<div class="row">' +
797
                  '<div>经度</div>' +
798
                  '<div>' + e.longitude + '</div>' +
799
                  '</div>' +
800
                  '<div class="row">' +
801
                  '<div>纬度</div>' +
802
                  '<div>' + e.latitude + '</div>' +
803
                  '</div>' + other +
804
                  '<div class="row">' +
805
                  '<div>最新定位时间</div>' +
806
                  '<div>' + e.newDate + '</div>' +
807
                  '</div></div></div>' + callHelp +
808
                  '</div></div>'
809
                var popup = Ai.Popup({
810
                  minWidth: 300,
811
                  offset: [0, -10],
812
                  autoClose: true
813
                })
814
                // 设置弹出框弹出位置
815
                popup.setLatLng(point.getLatLng())
816
                // 设置弹出框弹出内容
817
                popup.setContent(content)
818
                popup.openOn(this.map)
819
                point.getAttributes().popup = popup
820
              })
821
              this.layer.personLayer.addLayer(point)
822
            }
823
          })
824
          this.map.addLayer(this.layer.personLayer)
825
          console.log(this.layer.personLayer)
405
    loadMapArea() {
406
      // data.forEach(element => {
407
      // })
408
      var point = Ai.Point([32.04533333333333, 125.4221944444444], {
409
        icon: Ai.DivIcon({
410
          html: '<div class="sos">4人</div>',
411
          className: 'person-count',
412
          // 设置图标大小
413
          // iconSize: [20, 20],
414
          // 设置点对象和图标的相对偏移量
415
          iconAnchor: [15, 50]
826 416
        })
827
        .catch((res) => {
828
          // 请求失败处理...
417
      })
418
      var point2 = Ai.Point([32.04533333333333, 125.4221944444444], {
419
        icon: Ai.Icon({
420
          // 设置图标URL路径
421
          iconUrl: '/static/images/风机.png',
422
          // 设置图标大小
423
          iconSize: [20, 20],
424
          // 设置点对象和图标的相对偏移量
425
          iconAnchor: [0, 0]
829 426
        })
427
      })
428
      var layer = new Ai.FeatureGroup()
429
      layer.addLayer(point)
430
      layer.addLayer(point2)
431
      this.map.addLayer(layer)
432
      var popup = Ai.Popup({
433
        minWidth: 300,
434
        offset: [0, -40],
435
        autoClose: true,
436
        closeButton: false
437
      })
438
      var content =
439
                  '<div class="tips-item"><div class="top"><div class="fengji"></div><div>风机</div><div>FJ001</div></div><div class="container">' +
440
                  '<div class="sos">张三</div><div class="normal">张三</div><div class="outline">张三</div><div class="offline">张三</div><div class="sos">张三</div>' +
441
                 '</div></div>'
442
      // 设置弹出框弹出位置
443
      popup.setLatLng(point.getLatLng())
444
      // 设置弹出框弹出内容
445
      popup.setContent(content)
446
      popup.openOn(this.map)
830 447
    },
831 448
    showOrHide(layer, type, arr) { // 地图设备人员围栏显示和隐藏
832 449
      layer.eachLayer((e) => {
@ -942,7 +559,10 @@ export default {
942 559
      })
943 560
    },
944 561
    personTrack(item) {
945
      // item.checked = !item.checked
562
      console.log(item)
563
      this.trackPerson = item.deviceId
564
    },
565
    playback() {
946 566
      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]]
947 567
      var defaultOptions = {
948 568
        paused: false,
@ -967,33 +587,8 @@ export default {
967 587
        }
968 588
      }
969 589
      var path = new Ai.DynamicPath(coords, defaultOptions)
970
      var coords1 = [[39.87501, 116.41937], [39.860736, 116.394740], [39.779519, 116.534789], [39.676013, 116.681703], [39.704545, 116.915117], [39.740458, 117.009856]]
971
      var defaultOptions1 = {
972
        paused: false,
973
        reverse: false,
974
        delay: 800,
975
        dashArray: [10, 20],
976
        weight: 5,
977
        opacity: 0.9,
978
        color: '#0000ff',
979
        pulseColor: '#FFFFFF',
980
        playerTrack: true,
981
        traceTitle: true,
982
        traceIcon: new Ai.Icon({
983
          iconUrl: 'http://192.168.74.189:9999/gisapi/images/man-or32.png',
984
          iconSize: [36, 36],
985
          iconAnchor: [18, 36]
986
        }),
987
        titleOptions: {
988
          className: 'trace_title',
989
          iconSize: null,
990
          iconAnchor: [48, 57]
991
        }
992
      }
993
      var path1 = new Ai.DynamicPath(coords1, defaultOptions1)
994 590
      this.trackMap.addLayer(path)
995 591
      path.playTraceOn(this.trackMap)
996
      this.trackMap.addLayer(path1)
997 592
      // path1.playTraceOn(this.trackMap)
998 593
      var params = new FormData()
999 594
      params.append('data', JSON.stringify({

+ 11 - 4
ebc-middle-platform/src/modules/system-management/map-mark.scss

@ -22,18 +22,25 @@
22 22
          display: flex; 
23 23
          margin: 0 20px 16px 0;    
24 24
          line-height: 2;
25
          .label{
26
            min-width: 60px;
27
          }
25 28
        }
26 29
        .input-rule{
27 30
          flex: 1;
28 31
          margin:0 0 0 20px;
32
          width: 200px;
29 33
          .dropdown{
30 34
            width: 100%
31 35
          }
32 36
        }
33 37
      }
34
      .btns button{
35
        margin: 0 2px;
36
      }
38
      .btns{
39
        min-width: 330px;
40
        button{
41
          margin: 0 2px;
42
        }
43
      } 
37 44
    }
38 45
  }
39 46
  .table-pager{
@ -88,7 +95,7 @@
88 95
    }
89 96
    .right{
90 97
      width: 1200px;
91
      height: 700px;
98
      height: 600px;
92 99
    }
93 100
  }
94 101
}

+ 259 - 190
ebc-middle-platform/src/modules/system-management/map-mark.vue

@ -4,11 +4,21 @@
4 4
      <div class="search-ctn">
5 5
        <div>
6 6
          <div class="label-content">
7
            <div class="label">部门:</div>
8
            <div class="input-rule">
9
              <t-select-tree
10
                v-model="queryCondition.department"
11
                :node-data="cloneNodes"
12
                node-key="id"
13
              ></t-select-tree>
14
            </div>
15
          </div>
16
          <div class="label-content">
7 17
            <div class="label">标记名称:</div>
8 18
            <div class="input-rule">
9 19
              <t-input
10
                  v-model="queryCondition.userName"
11
                  placeholder="请输入..."
20
                v-model="queryCondition.userName"
21
                placeholder="请输入..."
12 22
              ></t-input>
13 23
            </div>
14 24
          </div>
@ -46,16 +56,16 @@
46 56
          </template>
47 57
        </t-table-column>
48 58
        <t-table-column
49
            :formatter="timestampToTime"
50
            prop="CREATE_DATE"
51
            label="创建时间"
59
          :formatter="timestampToTime"
60
          prop="CREATE_DATE"
61
          label="创建时间"
52 62
        ></t-table-column>
53 63
        <t-table-column fixed="right" label="操作" width="120">
54 64
          <template slot-scope="scope">
55 65
            <a
56
                href="javascript:void(0)"
57
                size="sm"
58
                @click="handleClick(scope.row)"
66
              href="javascript:void(0)"
67
              size="sm"
68
              @click="handleClick(scope.row)"
59 69
            >编辑</a
60 70
            >
61 71
            <span class="mod-line">|</span>
@ -66,37 +76,47 @@
66 76
        </t-table-column>
67 77
      </t-table>
68 78
      <t-pager
69
          :total="table.pager.total"
70
          :current.sync="table.pager.currentPage"
71
          :page-size.sync="table.pager.size"
72
          :sizer-range="[10, 20, 50]"
73
          class="px-24 pt-16 float-right"
74
          show-elevator
75
          show-sizer
76
          @on-size-change="onSizeChange"
77
          @on-change="onPagerChange"
79
        :total="table.pager.total"
80
        :current.sync="table.pager.currentPage"
81
        :page-size.sync="table.pager.size"
82
        :sizer-range="[10, 20, 50]"
83
        class="px-24 pt-16 float-right"
84
        show-elevator
85
        show-sizer
86
        @on-size-change="onSizeChange"
87
        @on-change="onPagerChange"
78 88
      >
79 89
      </t-pager>
80 90
    </div>
81 91
    <t-modal
82
        :visibled.sync="addMark"
83
        :ok="submitMark"
84
        :cancel="cancel"
85
        :mask-closable="false"
86
        class="modal"
87
        title="地图标记"
88
        ok-text="保存"
89
        width="80%"
92
      :visibled.sync="addMark"
93
      :ok="submitMark"
94
      :cancel="cancel"
95
      :mask-closable="false"
96
      class="modal"
97
      title="地图标记"
98
      ok-text="保存"
99
      width="80%"
90 100
    >
91 101
      <div class="top">
92 102
        <div>
103
          <div class="label">部门:</div>
104
          <div class="input-rule">
105
            <t-select-tree v-model="department"
106
                           :node-data="cloneNodes"
107
                           style="width:200px"
108
                           node-key="id"
109
            ></t-select-tree>
110
          </div>
111
        </div>
112
        <div>
93 113
          <div class="label">标记类型:</div>
94 114
          <div class="input-rule">
95
            <t-select v-model="markType" width="200" placeholder="请输入...">
115
            <t-select v-model="markType" style="width:100px" placeholder="请输入...">
96 116
              <t-option
97
                  v-for="item in markTypes"
98
                  :key="item.id"
99
                  :value="item.id"
117
                v-for="item in markTypes"
118
                :key="item.id"
119
                :value="item.id"
100 120
              >{{ item.type }}</t-option
101 121
              >
102 122
            </t-select>
@ -106,9 +126,9 @@
106 126
          <div class="label">标记名称:</div>
107 127
          <div class="input-rule">
108 128
            <t-input
109
                v-model="markName"
110
                placeholder="请输入..."
111
                style="width: 200px"
129
              v-model="markName"
130
              placeholder="请输入..."
131
              style="width: 200px"
112 132
            ></t-input>
113 133
          </div>
114 134
        </div>
@ -116,9 +136,9 @@
116 136
          <div class="label">停留时长:</div>
117 137
          <div class="input-rule">
118 138
            <t-input
119
                v-model="residenceTimeLength"
120
                placeholder="请输入..."
121
                style="width: 100px"
139
              v-model="residenceTimeLength"
140
              placeholder="请输入..."
141
              style="width: 100px"
122 142
            ></t-input>
123 143
          </div>
124 144
          <div class="label">min</div>
@ -133,11 +153,11 @@
133 153
              >导入</a
134 154
              >
135 155
              <input
136
                  id="file"
137
                  type="file"
138
                  accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
139
                  style="display: none"
140
                  @change="handleFile($event)"
156
                id="file"
157
                type="file"
158
                accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
159
                style="display: none"
160
                @change="handleFile($event)"
141 161
              />
142 162
              <span class="mod-line">|</span>
143 163
              <a href="javascript:void(0)" size="sm" @click="downloadTemplate()"
@ -148,21 +168,21 @@
148 168
          <div>
149 169
            <t-table :data="modalData" size="sm" height="500">
150 170
              <t-table-column
151
                  align="center"
152
                  type="index"
153
                  label="坐标名称"
171
                align="center"
172
                type="index"
173
                label="坐标名称"
154 174
              ></t-table-column>
155 175
              <t-table-column
156
                  :formatter="lngOrLatFormatter"
157
                  align="center"
158
                  prop="lng"
159
                  label="经度"
176
                :formatter="lngOrLatFormatter"
177
                align="center"
178
                prop="lng"
179
                label="经度"
160 180
              ></t-table-column>
161 181
              <t-table-column
162
                  :formatter="lngOrLatFormatter"
163
                  align="center"
164
                  prop="lat"
165
                  label="纬度"
182
                :formatter="lngOrLatFormatter"
183
                align="center"
184
                prop="lat"
185
                label="纬度"
166 186
              ></t-table-column>
167 187
            </t-table>
168 188
          </div>
@ -195,7 +215,9 @@ export default {
195 215
          total: 0
196 216
        }
197 217
      },
218
      departments: [],
198 219
      queryCondition: {
220
        department: '',
199 221
        userName: ''
200 222
      },
201 223
      rangeDate: '',
@ -227,13 +249,60 @@ export default {
227 249
      polygonDrawer: null
228 250
    }
229 251
  },
252
  computed: {
253
    cloneNodes() {
254
      return this.departments.map((item) => {
255
        let obj = {
256
          label: item.label,
257
          title: item.title,
258
          id: item.id,
259
          data: item.data
260
        }
261
        if (item.pid) {
262
          obj.pid = item.pid
263
        }
264
        return obj
265
      })
266
    }
267
  },
230 268
  created() {
269
    this.getDepartmentsList()
231 270
    this.getList()
232 271
  },
233 272
  mounted() {
234 273
    this.loadMap()
235 274
  },
236 275
  methods: {
276
    getDepartmentsList() {
277
      this.$test
278
        .post(services.workEmployee.GET_ALL_ORGANIZE, {})
279
        .then((res) => {
280
          // 请求成功处理...
281
          // this.departments = res.data
282
          this.departments = []
283
          for (let i = 0; i < res.data.length; i++) {
284
            if (res.data[i].parentCode > 0) {
285
              this.departments.push({
286
                label: res.data[i].name,
287
                title: res.data[i].name,
288
                id: res.data[i].code,
289
                data: res.data[i].id,
290
                pid: res.data[i].parentCode
291
              })
292
            } else {
293
              this.departments.push({
294
                label: res.data[i].name,
295
                title: res.data[i].name,
296
                id: res.data[i].code,
297
                data: res.data[i].id
298
              })
299
            }
300
          }
301
        })
302
        .catch((res) => {
303
          // 请求失败处理...
304
        })
305
    },
237 306
    loadMap() {
238 307
      this.map = new Ai.Map('modalMap', {
239 308
        ak: this.$store.getters.getGisToken,
@ -242,8 +311,8 @@ export default {
242 311
      })
243 312
      this.map.addLayer(Ai.TileLayer(GIS_SEA_LAYER_URL))
244 313
      this.map.addLayer(Ai.WMTSLayer(
245
          GIS_SEA_URL,
246
          { opacity: 0.5 }
314
        GIS_SEA_URL,
315
        { opacity: 0.5 }
247 316
      ))
248 317
      this.loadPolygonDrawer()
249 318
    },
@ -278,24 +347,24 @@ export default {
278 347
    getList() {
279 348
      var params = new FormData()
280 349
      params.append(
281
          'data',
282
          JSON.stringify({
283
            pageNum: this.table.pager.currentPage,
284
            pageSize: this.table.pager.size,
285
            mapTagName: this.queryCondition.userName
286
          })
350
        'data',
351
        JSON.stringify({
352
          pageNum: this.table.pager.currentPage,
353
          pageSize: this.table.pager.size,
354
          mapTagName: this.queryCondition.userName
355
        })
287 356
      )
288 357
      this.$test
289
          .post(services.mapTag.GET_MAP_TAG, params)
290
          .then((res) => {
291
            // 请求成功处理...
292
            this.table.data = res.data.dataList
293
            this.table.pager.total = res.data.dataNum
294
            // this.table.pager.currentPage = pageNum
295
          })
296
          .catch((res) => {
297
            // 请求失败处理...
298
          })
358
        .post(services.mapTag.GET_MAP_TAG, params)
359
        .then((res) => {
360
          // 请求成功处理...
361
          this.table.data = res.data.dataList
362
          this.table.pager.total = res.data.dataNum
363
          // this.table.pager.currentPage = pageNum
364
        })
365
        .catch((res) => {
366
          // 请求失败处理...
367
        })
299 368
    },
300 369
    onChange(value) {
301 370
      console.log('date change:' + value)
@ -313,26 +382,26 @@ export default {
313 382
      var params = new FormData()
314 383
      var name = this.queryCondition.userName
315 384
      params.append(
316
          'data',
317
          JSON.stringify({
318
            params: {
319
              MAP_TAG_NAME: name
320
            }
321
          })
385
        'data',
386
        JSON.stringify({
387
          params: {
388
            MAP_TAG_NAME: name
389
          }
390
        })
322 391
      )
323 392
      // window.open('http://localhost:8088/ipu/ExportToExcel/exportMapTagInfoToExcel?data=' + params)
324 393
      //
325 394
      this.$test
326
          .post(services.excel.EXPROT_MAP_TAG, params)
327
          .then((res) => {
328
            // 请求成功处理...
329
            // debugger
330
            console.log(res)
331
            this.downloadDoc(res.data)
332
          })
333
          .catch((res) => {
334
            // 请求失败处理...
335
          })
395
        .post(services.excel.EXPROT_MAP_TAG, params)
396
        .then((res) => {
397
          // 请求成功处理...
398
          // debugger
399
          console.log(res)
400
          this.downloadDoc(res.data)
401
        })
402
        .catch((res) => {
403
          // 请求失败处理...
404
        })
336 405
    },
337 406
    downloadDoc(response) {
338 407
      // debugger
@ -370,8 +439,8 @@ export default {
370 439
      var Y = date.getFullYear() + '-'
371 440
      var M =
372 441
          (date.getMonth() + 1 < 10
373
              ? '0' + (date.getMonth() + 1)
374
              : date.getMonth() + 1) + '-'
442
            ? '0' + (date.getMonth() + 1)
443
            : date.getMonth() + 1) + '-'
375 444
      var D = date.getDate()
376 445
      var h = date.getHours()
377 446
      var m = date.getMinutes()
@ -415,57 +484,57 @@ export default {
415 484
      var params = new FormData()
416 485
      if (this.update) {
417 486
        params.append(
418
            'data',
419
            JSON.stringify({
420
              mapTagName: this.markName,
421
              mapTagType: this.markType,
422
              residenceTimeLength: this.residenceTimeLength,
423
              mapTagShape: arr,
424
              mapTagId: this.updateId
425
            })
487
          'data',
488
          JSON.stringify({
489
            mapTagName: this.markName,
490
            mapTagType: this.markType,
491
            residenceTimeLength: this.residenceTimeLength,
492
            mapTagShape: arr,
493
            mapTagId: this.updateId
494
          })
426 495
        )
427 496
        this.$test
428
            .post(services.mapTag.UPD_MAP_TAG, params)
429
            .then((res) => {
430
              // 请求成功处理...
431
              this.getList()
432
              this.polygonDrawer.disable()
433
              this.modalData = []
434
              this.markName = ''
435
              this.$Message.success('操作成功')
436
              this.map.removeLayer(this.layer)
437
              this.update = false
438
            })
439
            .catch((res) => {
440
              // 请求失败处理...
441
            })
497
          .post(services.mapTag.UPD_MAP_TAG, params)
498
          .then((res) => {
499
            // 请求成功处理...
500
            this.getList()
501
            this.polygonDrawer.disable()
502
            this.modalData = []
503
            this.markName = ''
504
            this.$Message.success('操作成功')
505
            this.map.removeLayer(this.layer)
506
            this.update = false
507
          })
508
          .catch((res) => {
509
            // 请求失败处理...
510
          })
442 511
      } else {
443 512
        params.append(
444
            'data',
445
            JSON.stringify({
446
              mapTagName: this.markName,
447
              mapTagType: this.markType,
448
              residenceTimeLength: this.residenceTimeLength,
449
              mapTagShape: arr
450
            })
513
          'data',
514
          JSON.stringify({
515
            mapTagName: this.markName,
516
            mapTagType: this.markType,
517
            residenceTimeLength: this.residenceTimeLength,
518
            mapTagShape: arr
519
          })
451 520
        )
452 521
453 522
        this.update = false
454 523
        this.$test
455
            .post(services.mapTag.ADD_MAP_TAG, params)
456
            .then((res) => {
457
              // 请求成功处理...
458
              this.$Message.success('操作成功')
459
              this.map.removeLayer(this.layer)
460
              this.polygonDrawer.disable()
461
              this.modalData = []
462
              this.markName = ''
463
              this.residenceTimeLength = ''
464
              this.getList()
465
            })
466
            .catch((res) => {
467
              // 请求失败处理...
468
            })
524
          .post(services.mapTag.ADD_MAP_TAG, params)
525
          .then((res) => {
526
            // 请求成功处理...
527
            this.$Message.success('操作成功')
528
            this.map.removeLayer(this.layer)
529
            this.polygonDrawer.disable()
530
            this.modalData = []
531
            this.markName = ''
532
            this.residenceTimeLength = ''
533
            this.getList()
534
          })
535
          .catch((res) => {
536
            // 请求失败处理...
537
          })
469 538
      }
470 539
    },
471 540
    getTime() {
@ -502,47 +571,47 @@ export default {
502 571
    handleClick(row) {
503 572
      var params = new FormData()
504 573
      params.append(
505
          'data',
506
          JSON.stringify({
507
            mapTagId: row.MAP_TAG_ID
508
          })
574
        'data',
575
        JSON.stringify({
576
          mapTagId: row.MAP_TAG_ID
577
        })
509 578
      )
510 579
      this.$test
511
          .post(services.mapTag.GET_ONE_MAP_TAG, params)
512
          .then((res) => {
513
            // 请求成功处理...
514
            this.modalData = []
515
            var coverWktStr_blue = res.data.resultData.MAP_TAG_SHAPE
516
            // debugger
517
            // var arr = coverWktStr_blue.replace('POLYGON((','').split(',')[0].split(' ')
518
            // this.map.setView([arr[1], arr[0]], 10)
519
            console.log(res.data.resultData.MAP_TAG_SHAPE)
520
            var color
521
            if (row.MAP_TAG_TYPE == '3') {
522
              color = 'red'
523
            } else if (row.MAP_TAG_TYPE == '2') {
524
              color = 'green'
525
            } else {
526
              color = 'blue'
527
            }
528
            var coverLayer_blue = new Ai.Polygon(coverWktStr_blue, {color: color, opacity: 1.0})
529
            // this.map.addLayer(coverLayer_blue)
530
            // 面设为编辑状态
531
            coverLayer_blue.snapediting = new Ai.PolylineSnap(
532
                this.map,
533
                coverLayer_blue
534
            )
535
            coverLayer_blue.snapediting.enable()
536
            this.layer = coverLayer_blue
537
            this.map.addLayer(coverLayer_blue)
538
            this.polygonDrawer.editing(this.layer)
539
            this.modalData = coverLayer_blue._latlngs[0]
540
            this.polygonDrawer.disable()
541
            this.map.setViewPort([this.layer])
542
          })
543
          .catch((res) => {
544
            // 请求失败处理...
545
          })
580
        .post(services.mapTag.GET_ONE_MAP_TAG, params)
581
        .then((res) => {
582
          // 请求成功处理...
583
          this.modalData = []
584
          var coverWktStr_blue = res.data.resultData.MAP_TAG_SHAPE
585
          // debugger
586
          // var arr = coverWktStr_blue.replace('POLYGON((','').split(',')[0].split(' ')
587
          // this.map.setView([arr[1], arr[0]], 10)
588
          console.log(res.data.resultData.MAP_TAG_SHAPE)
589
          var color
590
          if (row.MAP_TAG_TYPE == '3') {
591
            color = 'red'
592
          } else if (row.MAP_TAG_TYPE == '2') {
593
            color = 'green'
594
          } else {
595
            color = 'blue'
596
          }
597
          var coverLayer_blue = new Ai.Polygon(coverWktStr_blue, {color: color, opacity: 1.0})
598
          // this.map.addLayer(coverLayer_blue)
599
          // 面设为编辑状态
600
          coverLayer_blue.snapediting = new Ai.PolylineSnap(
601
            this.map,
602
            coverLayer_blue
603
          )
604
          coverLayer_blue.snapediting.enable()
605
          this.layer = coverLayer_blue
606
          this.map.addLayer(coverLayer_blue)
607
          this.polygonDrawer.editing(this.layer)
608
          this.modalData = coverLayer_blue._latlngs[0]
609
          this.polygonDrawer.disable()
610
          this.map.setViewPort([this.layer])
611
        })
612
        .catch((res) => {
613
          // 请求失败处理...
614
        })
546 615
      this.markName = row.MAP_TAG_NAME
547 616
      this.markType = parseInt(row.MAP_TAG_TYPE)
548 617
      this.updateId = row.MAP_TAG_ID
@ -588,7 +657,7 @@ export default {
588 657
        // console.log(workbook)
589 658
        /* 其中workbook.SheetNames[0]是表名下对应的数据 sheet数据 */
590 659
        let arr = XLSX.utils.sheet_to_json(
591
            workbook.Sheets[workbook.SheetNames[0]]
660
          workbook.Sheets[workbook.SheetNames[0]]
592 661
        )
593 662
        that.modalData = []
594 663
        var coverWktStr_blue = 'POLYGON (( '
@ -600,14 +669,14 @@ export default {
600 669
          coverWktStr_blue += arr[i]['经度'] + ' ' + arr[i]['纬度'] + ','
601 670
        }
602 671
        that.map.setView(
603
            [parseFloat(arr[0]['纬度']), parseFloat(arr[0]['经度'])],
604
            5
672
          [parseFloat(arr[0]['纬度']), parseFloat(arr[0]['经度'])],
673
          5
605 674
        ) // 地图定位
606 675
        // that.map.center =  []
607 676
        // debugger
608 677
        coverWktStr_blue = coverWktStr_blue.substring(
609
            0,
610
            coverWktStr_blue.length - 1
678
          0,
679
          coverWktStr_blue.length - 1
611 680
        )
612 681
        coverWktStr_blue += '))'
613 682
        var coverLayer_blue = new Ai.Polygon(coverWktStr_blue, {
@ -616,8 +685,8 @@ export default {
616 685
        that.map.addLayer(coverLayer_blue)
617 686
        // 面设为编辑状态
618 687
        coverLayer_blue.snapediting = new Ai.PolylineSnap(
619
            that.map,
620
            coverLayer_blue
688
          that.map,
689
          coverLayer_blue
621 690
        )
622 691
        coverLayer_blue.snapediting.enable()
623 692
        that.layer = coverLayer_blue
@ -636,23 +705,23 @@ export default {
636 705
        ok: function () {
637 706
          var params = new FormData()
638 707
          params.append(
639
              'data',
640
              JSON.stringify({
641
                mapTagId: row.MAP_TAG_ID
642
              })
708
            'data',
709
            JSON.stringify({
710
              mapTagId: row.MAP_TAG_ID
711
            })
643 712
          )
644 713
          // debugger
645 714
          this.$test
646
              .post(services.mapTag.DEL_MAP_TAG, params)
647
              .then((res) => {
648
                // 请求成功处理...
649
                // debugger
650
                this.$Message.success('操作成功')
651
                that.getList()
652
              })
653
              .catch((res) => {
654
                // 请求失败处理...
655
              })
715
            .post(services.mapTag.DEL_MAP_TAG, params)
716
            .then((res) => {
717
              // 请求成功处理...
718
              // debugger
719
              this.$Message.success('操作成功')
720
              that.getList()
721
            })
722
            .catch((res) => {
723
              // 请求失败处理...
724
            })
656 725
        }
657 726
      }
658 727
      this.$Confirm.confirm(confirm)

+ 12 - 4
ebc-middle-platform/src/modules/system-management/user-management.scss

@ -16,12 +16,17 @@
16 16
      justify-content: space-between;
17 17
      >div{
18 18
        display: flex; 
19
        margin: 0 20px 16px 0;    
20 19
        line-height: 2;
21 20
        .label-content{
22 21
          display: flex; 
23 22
          margin: 0 20px 16px 0;    
24 23
          line-height: 2;
24
          .label{
25
            min-width: 70px;
26
          }
27
          .label-s{
28
            min-width: 45px;
29
          }
25 30
        }
26 31
        .input-rule{
27 32
          flex: 1;
@ -31,9 +36,12 @@
31 36
          }
32 37
        }
33 38
      }
34
      .btns button{
35
        margin: 0 2px;
36
      }
39
      .btns{
40
        min-width: 395px;
41
        button{
42
          margin: 0 2px;
43
        }
44
      } 
37 45
    }
38 46
  }
39 47
  .table-pager{

+ 68 - 68
ebc-middle-platform/src/modules/system-management/user-management.vue

@ -4,28 +4,28 @@
4 4
      <div class="search-ctn">
5 5
        <div>
6 6
          <div class="label-content">
7
            <div class="label">部门:</div>
7
            <div class="label-s">部门:</div>
8 8
            <div class="input-rule">
9 9
              <!--              <t-select v-model="queryCondition.department" width="200" placeholder="请选择">-->
10 10
              <!--                <t-option v-for="(item, index) in departments" :key="index" :value="item.id">{{ item.userName }}</t-option>-->
11 11
              <!--              </t-select>-->
12
              <t-select-tree
13
                  v-model="queryCondition.department"
14
                  :node-data="cloneNodes"
15
                  node-key="id"
12
              <t-select-tree v-model="queryCondition.department"
13
                             :node-data="cloneNodes"
14
                             style="width:200px"
15
                             node-key="id"
16 16
              ></t-select-tree>
17 17
            </div>
18 18
          </div>
19 19
          <div class="label-content">
20
            <div class="label">姓名:</div>
20
            <div class="label-s">姓名:</div>
21 21
            <div class="input-rule">
22
              <t-input v-model="queryCondition.employeeName" placeholder="请输入..."></t-input>
22
              <t-input v-model="queryCondition.employeeName" style="width:200px" placeholder="请输入..."></t-input>
23 23
            </div>
24 24
          </div>
25 25
          <div class="label-content">
26 26
            <div class="label">员工编号:</div>
27 27
            <div class="input-rule">
28
              <t-input v-model="queryCondition.employeeNo" placeholder="请输入..."></t-input>
28
              <t-input v-model="queryCondition.employeeNo" style="width:200px" placeholder="请输入..."></t-input>
29 29
            </div>
30 30
          </div>
31 31
          <div class="btns">
@ -54,9 +54,9 @@
54 54
        <t-table-column prop="age" label="年龄"></t-table-column>
55 55
        <t-table-column prop="mainWirelessCall" label="手机"></t-table-column>
56 56
        <t-table-column
57
            fixed="right"
58
            label="操作"
59
            width="240"
57
          fixed="right"
58
          label="操作"
59
          width="240"
60 60
        >
61 61
          <template slot-scope="scope">
62 62
            <a href="javascript:void(0)" size="sm" @click="handleClick(scope.row)">编辑</a>
@ -84,9 +84,9 @@
84 84
        </t-form-item>
85 85
        <t-form-item label="部门" prop="department">
86 86
          <t-select-tree
87
              v-model="formValidate.department"
88
              :node-data="cloneNodes"
89
              node-key="id"
87
            v-model="formValidate.department"
88
            :node-data="cloneNodes"
89
            node-key="id"
90 90
          ></t-select-tree>
91 91
        </t-form-item>
92 92
        <t-form-item label="职务" prop="job">
@ -98,7 +98,7 @@
98 98
        </t-form-item>
99 99
        <t-form-item label="出生年月" prop="age">
100 100
          <!--          <t-input v-model="formValidate.age" placeholder="请输入数字"></t-input>-->
101
          <t-date-picker style="width:250px" v-model="formValidate.age"
101
          <t-date-picker v-model="formValidate.age"
102 102
                         placeholder="请选择出生年月"></t-date-picker>
103 103
        </t-form-item>
104 104
        <t-form-item label="手机" prop="phone">
@ -255,53 +255,53 @@ export default {
255 255
  methods: {
256 256
    getList: function () {
257 257
      this.$test
258
          .post(services.workEmployee.GET_WORK_EMPLOYEE, {
259
            data: {
260
              orgId: this.queryCondition.department,
261
              code: this.queryCondition.employeeNo,
262
              name: this.queryCondition.employeeName
263
            },
264
            pageNumber: this.table.pager.currentPage,
265
            pageSize: this.table.pager.size
266
          })
267
          .then((res) => {
268
            // 请求成功处理...
269
            this.table.data = res.data.data
270
            this.table.pager.total = res.data.total
271
          })
272
          .catch((res) => {
273
            // 请求失败处理...
274
          })
258
        .post(services.workEmployee.GET_WORK_EMPLOYEE, {
259
          data: {
260
            orgId: this.queryCondition.department,
261
            code: this.queryCondition.employeeNo,
262
            name: this.queryCondition.employeeName
263
          },
264
          pageNumber: this.table.pager.currentPage,
265
          pageSize: this.table.pager.size
266
        })
267
        .then((res) => {
268
          // 请求成功处理...
269
          this.table.data = res.data.data
270
          this.table.pager.total = res.data.total
271
        })
272
        .catch((res) => {
273
          // 请求失败处理...
274
        })
275 275
    },
276 276
    getDepartmentsList: function () {
277 277
      this.$test
278
          .post(services.workEmployee.GET_ALL_ORGANIZE, {})
279
          .then((res) => {
280
            // 请求成功处理...
281
            // this.departments = res.data
282
            this.departments = []
283
            for (let i = 0; i < res.data.length; i++) {
284
              if (res.data[i].parentCode > 0) {
285
                this.departments.push({
286
                  label: res.data[i].name,
287
                  title: res.data[i].name,
288
                  id: res.data[i].code,
289
                  data: res.data[i].id,
290
                  pid: res.data[i].parentCode
291
                })
292
              } else {
293
                this.departments.push({
294
                  label: res.data[i].name,
295
                  title: res.data[i].name,
296
                  id: res.data[i].code,
297
                  data: res.data[i].id
298
                })
299
              }
278
        .post(services.workEmployee.GET_ALL_ORGANIZE, {})
279
        .then((res) => {
280
          // 请求成功处理...
281
          // this.departments = res.data
282
          this.departments = []
283
          for (let i = 0; i < res.data.length; i++) {
284
            if (res.data[i].parentCode > 0) {
285
              this.departments.push({
286
                label: res.data[i].name,
287
                title: res.data[i].name,
288
                id: res.data[i].code,
289
                data: res.data[i].id,
290
                pid: res.data[i].parentCode
291
              })
292
            } else {
293
              this.departments.push({
294
                label: res.data[i].name,
295
                title: res.data[i].name,
296
                id: res.data[i].code,
297
                data: res.data[i].id
298
              })
300 299
            }
301
          })
302
          .catch((res) => {
303
            // 请求失败处理...
304
          })
300
          }
301
        })
302
        .catch((res) => {
303
          // 请求失败处理...
304
        })
305 305
    },
306 306
    onChange(value) {
307 307
      console.log('date change:' + value)
@ -388,16 +388,16 @@ export default {
388 388
      this.$refs.formValidate.validate(valid => {
389 389
        if (valid) {
390 390
          that.$test.post(services.workEmployee.ADD_WORK_EMPLOYEE, {
391
                name: that.formValidate.name,
392
                code: that.formValidate.number,
393
                organizeCode: that.formValidate.department,
394
                mainJobPosition: that.formValidate.job.value,
395
                birthday: that.formValidate.age,
396
                // cardType: "居民身份证",
397
                // cardNo: "43252345455412305567X",
398
                // gender: "男",
399
                mainWirelessCall: that.formValidate.phone
400
              }
391
            name: that.formValidate.name,
392
            code: that.formValidate.number,
393
            organizeCode: that.formValidate.department,
394
            mainJobPosition: that.formValidate.job.value,
395
            birthday: that.formValidate.age,
396
            // cardType: "居民身份证",
397
            // cardNo: "43252345455412305567X",
398
            // gender: "男",
399
            mainWirelessCall: that.formValidate.phone
400
          }
401 401
          ).then(res => {
402 402
            // 请求成功处理...
403 403
            if (res.data) {