|
@@ -6,30 +6,33 @@
|
|
|
@closed="onDialogClose"
|
|
|
@opened="play"
|
|
|
center>
|
|
|
- <div style="width: 100%;height: 70vh;">
|
|
|
- <bd-map :loaded="loaded" map-id="room-map" />
|
|
|
+ <div style="width: 100%;height: 70vh;position: relative">
|
|
|
+ <bd-map :loaded="loaded" map-id="room-map"/>
|
|
|
+ <video-p/>
|
|
|
<socket-message
|
|
|
v-if="centerDialogVisible"
|
|
|
:key="`device_uwb001`" :onMessage="onMessage"
|
|
|
:ws="`/ws/point/uwb001`"></socket-message>
|
|
|
</div>
|
|
|
-
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
-import { pushDevcLocation } from '@/api/bd/fenceInfo';
|
|
|
+import {listFenceInfo, pushDevcLocation} from '@/api/bd/fenceInfo';
|
|
|
import SocketMessage from '@/components/WebsocketMessage/index.vue';
|
|
|
import BdMap from '@/views/bd/map/index.vue';
|
|
|
import maphandle from '@/views/bd/map/maphandle';
|
|
|
import position from '@/views/bd/realtimeLocation/icon/position.png';
|
|
|
import dayjs from 'dayjs';
|
|
|
+import VideoP from "@/views/bd/roomlocation/roommap/video/video.vue";
|
|
|
+import {uuid} from "@/utils";
|
|
|
|
|
|
export default {
|
|
|
name: 'room-map',
|
|
|
mixins: [maphandle],
|
|
|
components: {
|
|
|
+ VideoP,
|
|
|
BdMap,
|
|
|
SocketMessage,
|
|
|
},
|
|
@@ -39,18 +42,19 @@ export default {
|
|
|
locationMarkers: {},
|
|
|
mapIns: null,
|
|
|
playInterval: null,
|
|
|
+ fencePolyLayer: null,
|
|
|
};
|
|
|
},
|
|
|
// 组件卸载前清空图层信息
|
|
|
beforeDestroy() {
|
|
|
- this.markLayer && window.map.removeLayersById('markerLayer');
|
|
|
+ this.markLayer && this.mapIns.removeLayersById('markerLayer');
|
|
|
+ this.fencePolyLayer && this.fencePolyLayer.cust.clearLayer()
|
|
|
this.playInterval && clearInterval(this.playInterval);
|
|
|
},
|
|
|
created() {
|
|
|
|
|
|
},
|
|
|
mounted() {
|
|
|
-
|
|
|
},
|
|
|
methods: {
|
|
|
dayjs,
|
|
@@ -68,7 +72,9 @@ export default {
|
|
|
map.addCustomLayers(this.markLayer);
|
|
|
this.mapIns = map;
|
|
|
map.setPitch(0);
|
|
|
- map.setCenter([118.86895,32.01326]);
|
|
|
+ map.setCenter([118.86895, 32.01326]);
|
|
|
+ this.fencePolyLayer = this.createLayer(map);
|
|
|
+ this.getFenceList();
|
|
|
},
|
|
|
show() {
|
|
|
this.centerDialogVisible = true;
|
|
@@ -97,6 +103,43 @@ export default {
|
|
|
this.markLayer.addMarker(marker);
|
|
|
return marker;
|
|
|
},
|
|
|
+ async getFenceList() {
|
|
|
+ const {rows} = await listFenceInfo({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ fenceType: 2,
|
|
|
+ });
|
|
|
+ if (!rows || rows.length < 1) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const result = [];
|
|
|
+ rows.forEach(item => {
|
|
|
+ const {
|
|
|
+ id,
|
|
|
+ defenceName,
|
|
|
+ poly,
|
|
|
+ } = item;
|
|
|
+ const polygon = this.drawPoly({
|
|
|
+ name: defenceName,
|
|
|
+ coordinates: this.polygonToCoordinates(poly),
|
|
|
+ symbol: {
|
|
|
+ lineColor: 'rgba(241,0,23,0.49)',
|
|
|
+ lineWidth: 2,
|
|
|
+ polygonFill: 'rgba(241,0,23,0.49)',
|
|
|
+ polygonOpacity: 0.4,
|
|
|
+ },
|
|
|
+ bizAttr: {
|
|
|
+ id,
|
|
|
+ name: defenceName,
|
|
|
+ },
|
|
|
+ }, this.fencePolyLayer);
|
|
|
+ result.push({
|
|
|
+ id,
|
|
|
+ name: defenceName,
|
|
|
+ polygon,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
onMessage(a) {
|
|
|
const data = JSON.parse(a.data);
|
|
|
const {
|
|
@@ -117,81 +160,41 @@ export default {
|
|
|
}
|
|
|
this.mapIns.setZoom(22)
|
|
|
const gps = [
|
|
|
- [118.869125003231, 32.0132579193923],
|
|
|
- [118.869114609672, 32.0132582036815],
|
|
|
- [118.869115950776, 32.013238303438],
|
|
|
- [118.869116286052, 32.0132195403474],
|
|
|
- [118.869116286052, 32.0132144231402],
|
|
|
- [118.869113939119, 32.0132064630396],
|
|
|
- [118.869105557216, 32.0132021986996],
|
|
|
- [118.869093822552, 32.0132021986996],
|
|
|
- [118.869086111201, 32.0132021986996],
|
|
|
- [118.869077394021, 32.0132021986996],
|
|
|
- [118.869073370708, 32.0132021986996],
|
|
|
- [118.869070688499, 32.0132044730143],
|
|
|
- [118.869070353223, 32.013218118901],
|
|
|
- [118.869070353223, 32.0132323333641],
|
|
|
- [118.869071359051, 32.0132479692711],
|
|
|
- [118.869069012118, 32.0132536550547],
|
|
|
- [118.869064988805, 32.0132579193923],
|
|
|
- [118.869048224998, 32.0132570665248],
|
|
|
- [118.869028778983, 32.0132570665248],
|
|
|
- [118.869008327139, 32.0132525178981],
|
|
|
- [118.868998939408, 32.0132579193923],
|
|
|
- [118.868995586647, 32.0132604779947],
|
|
|
- [118.868992233885, 32.0132604779947],
|
|
|
- [118.868991228057, 32.0132621837296],
|
|
|
- [118.868982510878, 32.0132601937055],
|
|
|
- [118.868976140631, 32.0132601937055],
|
|
|
- [118.868968764556, 32.0132607622839],
|
|
|
- [118.868963735414, 32.0132607622839],
|
|
|
- [118.868965411795, 32.0132525178981],
|
|
|
- [118.868965747071, 32.0132394405949],
|
|
|
- [118.868965747071, 32.0132334705211],
|
|
|
- [118.868966082347, 32.0132127174044],
|
|
|
- [118.868965747071, 32.0132036201463],
|
|
|
- [118.868976811183, 32.0132002086742],
|
|
|
- [118.868985193087, 32.0132056101716],
|
|
|
- [118.868987204743, 32.0132175503224],
|
|
|
- [118.86898485781, 32.0132354605458],
|
|
|
- [118.868985528363, 32.0132402934625],
|
|
|
- [118.868999274684, 32.0132445578007],
|
|
|
- [118.869013021005, 32.0132439892223],
|
|
|
- [118.869029784811, 32.0132454106683],
|
|
|
- [118.869033472849, 32.0132431363547],
|
|
|
- [118.869036155058, 32.0132391563057],
|
|
|
- [118.869036155058, 32.0132320490749],
|
|
|
- [118.869037160886, 32.0132215303724],
|
|
|
- [118.869035484506, 32.0132067473289],
|
|
|
- [118.869035484506, 32.0132002086742],
|
|
|
- [118.86902039708, 32.0131987872275],
|
|
|
- [118.869002962721, 32.0131993558062],
|
|
|
- [118.868989551676, 32.0131993558062],
|
|
|
- [118.868975805355, 32.0131982186489],
|
|
|
- [118.86896239431, 32.0131976500702],
|
|
|
- [118.868952336026, 32.0131976500702],
|
|
|
- [118.868940266086, 32.0131996400956],
|
|
|
- [118.868936913324, 32.0131996400956],
|
|
|
- [118.868934231115, 32.0131996400956],
|
|
|
- [118.868921155346, 32.0131999243849],
|
|
|
- [118.868917132033, 32.0132010615423],
|
|
|
- [118.868910091234, 32.013200777253],
|
|
|
- [118.868910091234, 32.0132138545616],
|
|
|
- [118.868909085406, 32.0132272161577],
|
|
|
- [118.868909755958, 32.0132391563057],
|
|
|
- [118.868910091234, 32.0132488221386],
|
|
|
- [118.868910761786, 32.013257350814],
|
|
|
- [118.868909755958, 32.0132636051754],
|
|
|
- [118.868942277742, 32.0132627523079],
|
|
|
- [118.868973123146, 32.0132644580428],
|
|
|
- [118.869001621617, 32.0132638894645],
|
|
|
- [118.869058618558, 32.0132636051754],
|
|
|
- [118.869081082059, 32.0132624680188],
|
|
|
- [118.869094157828, 32.0132624680188],
|
|
|
- [118.869112933291, 32.0132624680188],
|
|
|
- [118.869124332679, 32.0132604779947],
|
|
|
- [118.869125003231, 32.0132579193923],
|
|
|
- ];
|
|
|
+ [118.868928794571, 32.0132512031322],
|
|
|
+ [118.868928459294, 32.0132364200935],
|
|
|
+ [118.868929129847, 32.0132159512668],
|
|
|
+ [118.868929129847, 32.0132108340593],
|
|
|
+ [118.868929129847, 32.0132057168517],
|
|
|
+ [118.868930135675, 32.0132017368011],
|
|
|
+ [118.868963998564, 32.0132008839331],
|
|
|
+ [118.868967686601, 32.0132025896691],
|
|
|
+ [118.868967351325, 32.0132116869273],
|
|
|
+ [118.868968021877, 32.0132185098704],
|
|
|
+ [118.868967016049, 32.0132259013915],
|
|
|
+ [118.868966680773, 32.0132313028872],
|
|
|
+ [118.868967016049, 32.0132440959023],
|
|
|
+ [118.868967016049, 32.0132500659755],
|
|
|
+ [118.868967016049, 32.0132526245781],
|
|
|
+ [118.868974056848, 32.0132523402889],
|
|
|
+ [118.86897908599, 32.0132523402889],
|
|
|
+ [118.868979756542, 32.0132458016376],
|
|
|
+ [118.868979756542, 32.0132406844318],
|
|
|
+ [118.86898076237, 32.0132392629857],
|
|
|
+ [118.868983444579, 32.0132352829366],
|
|
|
+ [118.868986462064, 32.0132369886719],
|
|
|
+ [118.868990820654, 32.0132375572504],
|
|
|
+ [118.868992497035, 32.0132440959023],
|
|
|
+ [118.868998196729, 32.0132449487699],
|
|
|
+ [118.869004566975, 32.0132483602403],
|
|
|
+ [118.869004902251, 32.0132543303132],
|
|
|
+ [118.869005572804, 32.013257457494],
|
|
|
+ [118.869014625259, 32.0132580260723],
|
|
|
+ [118.8690266952, 32.0132577417831],
|
|
|
+ [118.869029712685, 32.0132577417831],
|
|
|
+ [118.869031724342, 32.0132577417831],
|
|
|
+ [118.869032394894, 32.0132625746988],
|
|
|
+ [118.868924100705, 32.0132523402889]
|
|
|
+ ]
|
|
|
let i = 0;
|
|
|
this.playInterval && clearInterval(this.playInterval);
|
|
|
this.playInterval = setInterval(() => {
|
|
@@ -200,6 +203,20 @@ export default {
|
|
|
lat: gps[i][1],
|
|
|
lng: gps[i][0],
|
|
|
});
|
|
|
+ // this.onMessage({
|
|
|
+ // data: JSON.stringify({
|
|
|
+ // latitude: gps[i][1],
|
|
|
+ // longitude: gps[i][0],
|
|
|
+ // deviceId: 'uwb001',
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // );
|
|
|
+ // var marker = new BDLayers.Lib.Overlays.MarkerIcon(`marker${uuid()}`, gps[i], {
|
|
|
+ // iconSize: 45,
|
|
|
+ // iconColor: 'red',
|
|
|
+ // labelText: `${i}`
|
|
|
+ // });
|
|
|
+ // marker.getMarker().addTo(this.mapIns.map);
|
|
|
if (i === gps.length - 1) {
|
|
|
i = 0;
|
|
|
return;
|