Browse Source

Merge branch '1105' into feature-bd

# Conflicts:
#	ruoyi-ui/src/views/bd/roomlocation/roommap/index.vue
#	ruoyi-ui/src/views/bd/roomlocation/roommap/video/video.vue
#	ruoyi-ui/version
chen.cheng 6 months ago
parent
commit
3cd471494d

+ 29 - 40
ruoyi-ui/src/views/bd/roomlocation/roommap/index.vue

@@ -1,18 +1,18 @@
 <template>
   <el-dialog
-      title="室内定位融合"
-      :visible.sync="centerDialogVisible"
-      width="70vw"
-      @closed="onDialogClose"
-      @opened="play"
-      center>
+    title="室内定位融合"
+    :visible.sync="centerDialogVisible"
+    width="70vw"
+    @closed="onDialogClose"
+    @opened="play"
+    center>
     <div style="width: 100%;height: 70vh;position: relative">
       <bd-map :loaded="loaded" map-id="room-map"/>
-      <video-p/>
+      <video-p ref="videoP"/>
       <socket-message
-          v-if="centerDialogVisible"
-          :key="`device_uwb001`" :onMessage="onMessage"
-          :ws="`/ws/point/uwb001`"></socket-message>
+        v-if="centerDialogVisible"
+        :key="`device_uwb001`" :onMessage="onMessage"
+        :ws="`/ws/point/uwb001`"></socket-message>
     </div>
   </el-dialog>
 </template>
@@ -26,7 +26,7 @@ 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";
+// import {uuid} from "@/utils";
 
 export default {
   name: 'room-map',
@@ -86,19 +86,19 @@ export default {
         deviceId,
       } = data;
       const marker = new BDLayers.Lib.Overlays.MarkerImg(
-          `marker${deviceId}`,
-          [longitude, latitude],
-          {
-            imgurl: position,
-            iconSize: [25, 30],
-            symbol: {
-              'textName': 'm4',
-              'textSize': 14,
-              'markerFile': position,
-              'markerHorizontalAlignment': 'middle', // left, middle(默认), right
-              'markerVerticalAlignment': 'middle', // top, middle, bottom(默认)
-            },
+        `marker${deviceId}`,
+        [longitude, latitude],
+        {
+          imgurl: position,
+          iconSize: [25, 30],
+          symbol: {
+            'textName': 'm4',
+            'textSize': 14,
+            'markerFile': position,
+            'markerHorizontalAlignment': 'middle', // left, middle(默认), right
+            'markerVerticalAlignment': 'middle', // top, middle, bottom(默认)
           },
+        },
       );
       this.markLayer.addMarker(marker);
       return marker;
@@ -152,7 +152,7 @@ export default {
         this.locationMarkers[deviceId] = this.addMarker(data);
         return;
       }
-      this.locationMarkers[deviceId].moveMarker([longitude, latitude], 2000, false);
+      this.locationMarkers[deviceId].moveMarker([longitude, latitude], 1500, false);
     },
     play() {
       if (!this.mapIns) {
@@ -164,31 +164,18 @@ export default {
         [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.0132017368011],
         [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],
@@ -198,6 +185,9 @@ export default {
       let i = 0;
       this.playInterval && clearInterval(this.playInterval);
       this.playInterval = setInterval(() => {
+        if (i === 0) {
+          this.$refs.videoP.play();
+        }
         pushDevcLocation({
           devcKey: 'uwb001',
           lat: gps[i][1],
@@ -217,8 +207,7 @@ export default {
         //   labelText: `${i}`
         // });
         // marker.getMarker().addTo(this.mapIns.map);
-        if (i === gps.length - 1) {
-          i = 0;
+        if (i === gps.length - 2) {
           return;
         }
         i++;

+ 5 - 2
ruoyi-ui/src/views/bd/roomlocation/roommap/video/video.vue

@@ -45,7 +45,7 @@ export default {
         height: "100px",
         width: "200px",
         playbackRates: [0.5], // 可选的播放速度
-        autoplay: true, // 如果为true,浏览器准备好时开始回放
+        autoplay: false, // 如果为true,浏览器准备好时开始回放
         muted: false, // 默认情况下静音播放
         loop: false, // 是否视频一结束就重新开始
         preload: "auto", // 建议浏览器在<video>加载元素后是否应该开始下载视频数据,auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持)
@@ -119,7 +119,10 @@ export default {
     pause() {
       // 视频播放器的方法调用,要使用this.$refs.videoPlayer.player这个对象去调用
       this.$refs.videoPlayer.player.pause()
-    }
+    },
+    play() {
+      this.$refs.videoPlayer.player.play()
+    },
   },
 };
 </script>

+ 1 - 1
ruoyi-ui/version

@@ -1 +1 @@
-2.5
+3.0