pan>
        </div>
63
        <div :class="mapShow.chuanbo?'':'cancel'" @click="showOrHide(layer.chuanboLayer,'chuanbo')">
67
        <div :class="mapShow.chuanbo?'':'cancel'" @click="showOrHide(layer.equipmentLayer,'chuanbo',['001'])">
64 68
          <div class="chuanbo"></div>
65 69
          <div>船舶</div>
66 70
        </div>
67 71
      </div>
68 72
      <div class="item">
69
        <div :class="mapShow.zyqy?'':'cancel'" @click="showOrHide(layer.zyqyLayer,'zyqy')">
73
        <div :class="mapShow.zyqy?'':'cancel'" @click="showOrHide(layer.areaLayer,'zyqy',['2'])">
70 74
          <div class="zyqy"></div>
71 75
          <div>作业区域</div>
72 76
        </div>
73
        <div :class="mapShow.dzwl?'':'cancel'" @click="showOrHide(layer.dzwlLayer,'dzwl')">
77
        <div :class="mapShow.dzwl?'':'cancel'" @click="showOrHide(layer.areaLayer,'dzwl',['3'])">
74 78
          <div class="dzwl"></div>
75 79
          <div>电子围栏</div>
76 80
        </div>
@ -162,13 +166,9 @@
162 166
163 167
<script>
164 168
import './orientation.scss'
165
import {GIS_SEA_LAYER_URL, GIS_SEA_URL} from '../../constants'
166 169
import services from '../../conf/services'
167 170
import EventBus from '../../bus'
168
import {
169
  GIS_CENTER,
170
  GIS_ZOOM
171
} from '@/constants'
171
import { GIS_CENTER, GIS_ZOOM, GIS_SEA_LAYER_URL, GIS_SEA_URL } from '@/constants'
172 172
export default {
173 173
  filters: {
174 174
    dateFormat(value) {
@ -205,10 +205,15 @@ export default {
205 205
    return {
206 206
      map: null,
207 207
      pointsarr: null,
208
      personStatistics: {
209
        all: 0,
210
        offLine: 0,
211
        outLine: 0,
212
        sos: 0,
213
        normal: 0
214
      },
208 215
      polylinearr:
209 216
        '122.0352 32.4444,122.0372 32.4444,122.0400 32.4366,122.2922 32.4233',
210
      polygonarr:
211
        '122.2302 32.5444,122.2302 32.3444, 122.4302 32.3444,122.4302 32.6044,122.2302 32.5444',
212 217
      popup: null,
213 218
      shadow: false,
214 219
      dataList: [
@ -297,15 +302,9 @@ export default {
297 302
        ]
298 303
      },
299 304
      layer: {
300
        dzwlLayer: new Ai.FeatureGroup(),
301
        zyqyLayer: new Ai.FeatureGroup(),
302
        fenjiLayer: new Ai.FeatureGroup(),
303
        chuanboLayer: new Ai.FeatureGroup(),
304
        shengyazhanLayer: new Ai.FeatureGroup(),
305
        sosLayer: new Ai.FeatureGroup(),
306
        offLineLayer: new Ai.FeatureGroup(),
307
        outLineLayer: new Ai.FeatureGroup(),
308
        normalLayer: new Ai.FeatureGroup()
305
        areaLayer: new Ai.FeatureGroup(),
306
        equipmentLayer: new Ai.FeatureGroup(),
307
        personLayer: new Ai.FeatureGroup()
309 308
      },
310 309
      mapShow: {
311 310
        dzwl: true,
@ -346,39 +345,9 @@ export default {
346 345
    },
347 346
    changeLocation(msg) {
348 347
      var obj = JSON.parse(msg.body)
349
      this.layer.normalLayer.eachLayer((e) => {
350
        console.log(e.getAttributes().deviceNo)
348
      this.layer.personLayer.eachLayer((e) => {
351 349
        if (e.getAttributes().deviceId == obj.deviceId) {
352
          console.log(obj.latitude, obj.longitude)
353 350
          e.setLatLng([obj.latitude, obj.longitude])
354
          e.off()
355
          this.popupContent(obj, e)
356
        }
357
      })
358
      this.layer.offLineLayer.eachLayer((e) => {
359
        console.log(e.getAttributes().deviceNo)
360
        if (e.getAttributes().deviceId == obj.deviceId) {
361
          console.log(obj.latitude, obj.longitude)
362
          e.setLatLng([obj.latitude, obj.longitude])
363
          e.off()
364
          this.popupContent(obj, e)
365
        }
366
      })
367
      this.layer.outLineLayer.eachLayer((e) => {
368
        console.log(e.getAttributes().deviceNo)
369
        if (e.getAttributes().deviceId == obj.deviceId) {
370
          console.log(obj.latitude, obj.longitude)
371
          e.setLatLng([obj.latitude, obj.longitude])
372
          e.off()
373
          this.popupContent(obj, e)
374
        }
375
      })
376
      this.layer.sosLayer.eachLayer((e) => {
377
        console.log(e.getAttributes().deviceNo)
378
        if (e.getAttributes().deviceId == obj.deviceId) {
379
          console.log(obj.latitude, obj.longitude)
380
          e.setLatLng([obj.latitude, obj.longitude])
381
          e.off()
382 351
          this.popupContent(obj, e)
383 352
        }
384 353
      })
@ -388,12 +357,37 @@ export default {
388 357
      var icon, tips
389 358
      var callHelp = ''
390 359
      var other = ''
360
      var attributes = point.getAttributes()
391 361
      if (e.locationStatus == '0') {
392 362
        icon = '/static/images/normalworker.png'
393 363
        tips = '<div class="normal">正常</div>'
364
        if (attributes.locationStatus !== e.locationStatus) {
365
          if (attributes.locationStatus == '1') {
366
            this.personStatistics.normal++
367
            this.personStatistics.offLine--
368
          } else if (attributes.locationStatus == '2' || attributes.locationStatus == '3') {
369
            this.personStatistics.normal++
370
            this.personStatistics.outLine--
371
          } else if (attributes.locationStatus == '4' || attributes.locationStatus == '5') {
372
            this.personStatistics.normal++
373
            this.personStatistics.sos--
374
          }
375
        }
394 376
      } else if (e.locationStatus == '1') {
395 377
        icon = '/static/images/offlineworker.png'
396 378
        tips = '<div class="offline">离线</div>'
379
        if (attributes.locationStatus !== e.locationStatus) {
380
          if (attributes.locationStatus == '0') {
381
            this.personStatistics.offLine++
382
            this.personStatistics.normal--
383
          } else if (attributes.locationStatus == '2' || attributes.locationStatus == '3') {
384
            this.personStatistics.offLine++
385
            this.personStatistics.outLine--
386
          } else if (attributes.locationStatus == '4' || attributes.locationStatus == '5') {
387
            this.personStatistics.offLine++
388
            this.personStatistics.sos--
389
          }
390
        }
397 391
      } else if (e.locationStatus == '2' || e.locationStatus == '3') {
398 392
        icon = '/static/images/outlineworker.png'
399 393
        tips = '<div class="outline">违规</div>'
@ -408,6 +402,18 @@ export default {
408 402
                  '<div>' + e.inDate + '</div>' +
409 403
                  '</div>'
410 404
        }
405
        if (attributes.locationStatus !== e.locationStatus) {
406
          if (attributes.locationStatus == '0') {
407
            this.personStatistics.outLine++
408
            this.personStatistics.normal--
409
          } else if (attributes.locationStatus == '1') {
410
            this.personStatistics.outLine++
411
            this.personStatistics.offLine--
412
          } else if (attributes.locationStatus == '4' || attributes.locationStatus == '5') {
413
            this.personStatistics.outLine++
414
            this.personStatistics.sos--
415
          }
416
        }
411 417
      } else if (e.locationStatus == '4' || e.locationStatus == '5') {
412 418
        icon = '/static/images/sosworker.png'
413 419
        other = '<div class="row sos">' +
@ -422,6 +428,18 @@ export default {
422 428
                  '<button class="point-out" onClick="window.Vue.rescueModal=true"><i style="font-size: 20px;" class="aidicon aidicon-user-outline"></i>指派</button>' +
423 429
                  '<button class="close-confirm" onClick="window.Vue.close()"><i style="font-size: 20px;" class="aidicon aidicon-close"></i>关闭</button>' +
424 430
                  '</div>'
431
        if (attributes.locationStatus !== e.locationStatus) {
432
          if (attributes.locationStatus == '0') {
433
            this.personStatistics.sos++
434
            this.personStatistics.normal--
435
          } else if (attributes.locationStatus == '1') {
436
            this.personStatistics.sos++
437
            this.personStatistics.offLine--
438
          } else if (attributes.locationStatus == '2' || attributes.locationStatus == '3') {
439
            this.personStatistics.sos++
440
            this.personStatistics.outLine--
441
          }
442
        }
425 443
      }
426 444
      point.setIcon(Ai.Icon({
427 445
        // 设置图标URL路径
@ -431,6 +449,7 @@ export default {
431 449
        // 设置点对象和图标的相对偏移量
432 450
        iconAnchor: [0, 0]
433 451
      }))
452
      point.setAttributes(e)
434 453
      point.on('click', (pointE) => {
435 454
        var content =
436 455
                  '<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">' +
@ -512,7 +531,8 @@ export default {
512 531
                opacity: 1.0,
513 532
                weight: 0
514 533
              })
515
              this.layer.dzwlLayer.addLayer(polygon)
534
              polygon.setAttributes(e)
535
              this.layer.areaLayer.addLayer(polygon)
516 536
              // this.fitBounds.push(polygon)
517 537
            } else if (e.MAP_TAG_TYPE === '2') { // 作业区域
518 538
              var polygon = Ai.Polygon(e.MAP_TAG_SHAPE, {
@ -520,12 +540,12 @@ export default {
520 540
                opacity: 1.0,
521 541
                weight: 0
522 542
              })
523
              this.layer.zyqyLayer.addLayer(polygon)
543
              polygon.setAttributes(e)
544
              this.layer.areaLayer.addLayer(polygon)
524 545
              // this.fitBounds.push(polygon)
525 546
            }
526 547
          })
527
          this.map.addLayer(this.layer.dzwlLayer)
528
          this.map.addLayer(this.layer.zyqyLayer)
548
          this.map.addLayer(this.layer.areaLayer)
529 549
          // console.log(this.fitBounds)
530 550
          // this.map.fitBoundsForLayers(this.fitBounds)
531 551
        })
@ -544,55 +564,46 @@ export default {
544 564
          // 请求成功处理...
545 565
          console.log(res.data)
546 566
          res.data.dataList.forEach((e) => {
567
            var icon = ''
547 568
            if (e.FACILITY_TYPE === '001') { // 船舶
548
              this.layer.chuanboLayer.addLayer(Ai.Point([e.LATITUDE, e.LONGITUDE], {
549
                icon: Ai.Icon({
550
                  // 设置图标URL路径
551
                  iconUrl: '/static/images/船舶.png',
552
                  // 设置图标大小
553
                  iconSize: [20, 20],
554
                  // 设置点对象和图标的相对偏移量
555
                  iconAnchor: [0, 0]
556
                })
557
              }))
569
              icon = '/static/images/船舶.png'
558 570
            } else if (e.FACILITY_TYPE === '002') { // 风机
559
              this.layer.fenjiLayer.addLayer(Ai.Point([e.LATITUDE, e.LONGITUDE], {
560
                icon: Ai.Icon({
561
                  // 设置图标URL路径
562
                  iconUrl: '/static/images/风机.png',
563
                  // 设置图标大小
564
                  iconSize: [20, 20],
565
                  // 设置点对象和图标的相对偏移量
566
                  iconAnchor: [0, 0]
567
                })
568
              }))
571
              icon = '/static/images/风机.png'
569 572
            } else if (e.FACILITY_TYPE === '003') { // 升压站
570
              this.layer.shengyazhanLayer.addLayer(Ai.Point([e.LATITUDE, e.LONGITUDE], {
571
                icon: Ai.Icon({
572
                  // 设置图标URL路径
573
                  iconUrl: '/static/images/升压站画面.png',
574
                  // 设置图标大小
575
                  iconSize: [20, 20],
576
                  // 设置点对象和图标的相对偏移量
577
                  iconAnchor: [0, 0]
578
                })
579
              }))
573
              icon = '/static/images/升压站画面.png'
580 574
            }
575
            var point = Ai.Point([e.LATITUDE, e.LONGITUDE], {
576
              icon: Ai.Icon({
577
                // 设置图标URL路径
578
                iconUrl: icon,
579
                // 设置图标大小
580
                iconSize: [20, 20],
581
                // 设置点对象和图标的相对偏移量
582
                iconAnchor: [0, 0]
583
              })
584
            })
585
            point.setAttributes(e)
586
            this.layer.equipmentLayer.addLayer(point)
581 587
          })
582
          this.map.addLayer(this.layer.chuanboLayer)
583
          this.map.addLayer(this.layer.fenjiLayer)
584
          this.map.addLayer(this.layer.shengyazhanLayer)
588
          this.map.addLayer(this.layer.equipmentLayer)
585 589
        })
586 590
        .catch((res) => {
587 591
          // 请求失败处理...
588 592
        })
589 593
    },
590 594
    loadPerson() { // 加载地图人员
595
      this.personStatistics = {
596
        all: 0,
597
        offLine: 0,
598
        outLine: 0,
599
        sos: 0,
600
        normal: 0
601
      }
591 602
      var params = new FormData()
592 603
      this.$test
593 604
        .post(services.organization.PERSON_LOCATION, params)
594 605
        .then((res) => {
595
          console.log(res.data)
606
          this.personStatistics.all = res.data.dataList.length
596 607
          var layer
597 608
          res.data.dataList.forEach((e) => {
598 609
            var icon, tips
@ -601,14 +612,17 @@ export default {
601 612
              icon = '/static/images/normalworker.png'
602 613
              layer = this.layer.normalLayer
603 614
              tips = '<div class="normal">正常</div>'
615
              this.personStatistics.normal++
604 616
            } else if (e.locationStatus === '1') {
605 617
              icon = '/static/images/offlineworker.png'
606 618
              layer = this.layer.offLineLayer
607 619
              tips = '<div class="offline">离线</div>'
620
              this.personStatistics.offLine++
608 621
            } else if (e.locationStatus === '2' || e.locationStatus === '3') {
609 622
              icon = '/static/images/outlineworker.png'
610 623
              layer = this.layer.outLineLayer
611 624
              tips = '<div class="outline">违规</div>'
625
              this.personStatistics.outLine++
612 626
            } else if (e.locationStatus === '4' || e.locationStatus === '5') {
613 627
              icon = '/static/images/sosworker.png'
614 628
              layer = this.layer.sosLayer
@ -617,6 +631,7 @@ export default {
617 631
                  '<button class="point-out" onClick="window.Vue.rescueModal=true"><i style="font-size: 20px;" class="aidicon aidicon-user-outline"></i>指派</button>' +
618 632
                  '<button class="close-confirm" onClick="window.Vue.close()"><i style="font-size: 20px;" class="aidicon aidicon-close"></i>关闭</button>' +
619 633
                  '</div>'
634
              this.personStatistics.sos++
620 635
            }
621 636
            var point = Ai.Point([e.latitude, e.longitude], {
622 637
              icon: Ai.Icon({
@ -659,25 +674,38 @@ export default {
659 674
                .setContent(content)
660 675
                .openOn(this.map)
661 676
            })
662
            layer.addLayer(point)
677
            // layer.addLayer(point)
678
            this.layer.personLayer.addLayer(point)
663 679
          })
664
          this.map.addLayer(this.layer.sosLayer)
665
          this.map.addLayer(this.layer.outLineLayer)
666
          this.map.addLayer(this.layer.offLineLayer)
667
          this.map.addLayer(this.layer.normalLayer)
680
          // this.map.addLayer(this.layer.sosLayer)
681
          // this.map.addLayer(this.layer.outLineLayer)
682
          // this.map.addLayer(this.layer.offLineLayer)
683
          // this.map.addLayer(this.layer.normalLayer)
684
          this.map.addLayer(this.layer.personLayer)
668 685
        })
669 686
        .catch((res) => {
670 687
          // 请求失败处理...
671 688
        })
672 689
    },
673
    showOrHide(layer, type) {
674
      if (this.map.hasLayer(layer)) {
675
        this.map.removeLayer(layer)
676
        this.mapShow[type] = false
677
      } else {
678
        this.map.addLayer(layer)
679
        this.mapShow[type] = true
680
      }
690
    showOrHide(layer, type, arr) {
691
      layer.eachLayer((e) => {
692
        if (arr.indexOf(e.getAttributes().locationStatus) != -1 || arr.indexOf(e.getAttributes().FACILITY_TYPE) != -1 || arr.indexOf(e.getAttributes().MAP_TAG_TYPE) != -1) {
693
          if (this.map.hasLayer(e)) {
694
            this.map.removeLayer(e)
695
            this.mapShow[type] = false
696
          } else {
697
            this.map.addLayer(e)
698
            this.mapShow[type] = true
699
          }
700
        }
701
      })
702
      // if (this.map.hasLayer(layer)) {
703
      //   this.map.removeLayer(layer)
704
      //   this.mapShow[type] = false
705
      // } else {
706
      //   this.map.addLayer(layer)
707
      //   this.mapShow[type] = true
708
      // }
681 709
    },
682 710
    changeTrackTime(index) {
683 711
      this.trackQueryCondition.currentIndex = index

@新增:环境切换 配置 · a2108c1190 - Nuosi Git Service
Parcourir la Source

@新增:环境切换 配置

liuyf23 2 ans auparavant
Parent
commit
a2108c1190
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      show-client/app/src/main/assets/mobile-action.xml

+ 6 - 0
show-client/app/src/main/assets/mobile-action.xml

@ -296,4 +296,10 @@
296 296
	<!--前后台切换-->
297 297
	<action name="addForeBackGroundListner" class="com.ai.ipu.mobile.plugin.IpuLifeCyclePlugin" method="addForeBackGroundListner" />
298 298
	<action name="deleteForeBackGroundListner" class="com.ai.ipu.mobile.plugin.IpuLifeCyclePlugin" method="deleteForeBackGroundListner" />
299
300
	<!--环境切换-->
301
	<action name="setMobileConfig" class="com.ai.ipu.mobile.common.config.MobileJsConfig" method="setMobileConfig" />
302
	<action name="setMobileConfigNoRestart" class="com.ai.ipu.mobile.common.config.MobileJsConfig" method="setMobileConfigNoRestart" />
303
	<action name="resetMobileConfig" class="com.ai.ipu.mobile.common.config.MobileJsConfig" method="resetMobileConfig" />
304
	<action name="resetMobileConfigNoRestart" class="com.ai.ipu.mobile.common.config.MobileJsConfig" method="resetMobileConfigNoRestart" />
299 305
</actions>