Browse Source

增加show

zk 1 year ago
parent
commit
db1afb155c

+ 8 - 3
src/utils/map/Boat.js

@@ -8,6 +8,7 @@ import { fullExtent, clearMap, calculation, changeMap, setCamera,
 } from '@/utils/map/ArcgisUtil'
 import {GetHpjShip} from "@/apis/ship";
 import {nextTick} from "vue";
+import bus from "@/utils/bus";
 
 let boatInterval;
 let showBoat = false;
@@ -101,14 +102,18 @@ function onLocationBoat(){
 }
 
 
-export  function playBoatPath(data) {
+
+bus.on('playBoatPath', (params) => {
     nextTick(() => {
-        setBoatPath(data)
+        setBoatPath(params)
     },{immediate: true});
     nextTick(() => {
         playBoatHistoryPath('start')
     },{immediate: true})
-}
+})
+
+
+
 
 // 设置船舶历史轨迹
 export function setBoatPath(data){

+ 2 - 2
src/views/home/Header.vue

@@ -32,7 +32,7 @@
 <!--    </div>-->
     <MiForChange v-if="miForChangeShow"/>
     <water-level v-if="waterDeepShow"/>
-    <Tools v-if="checkTool" />
+    <Tools v-show="checkTool" />
 
     <LunDuMessage v-if="checkLinDu" :datas="ldData.value"/>
 
@@ -133,6 +133,7 @@ export default {
             calculation('area')
           }
           else if (name == 'qc') {
+            // closeAllLayer()
             clearMap({is_draw: true, is_search:true, layers: ['sketchLayer','bufferLayer','tempLayer','boatLayer','boatPathLayer']})
             i.click =  !i.click ;
             i.checkIoc = !i.checkIoc;
@@ -145,7 +146,6 @@ export default {
           {
             bus.emit('toggle_sxdx', false)
             bus.emit('hiddenWater')
-            closeAllLayer()
           }
 
         }

+ 4 - 2
src/views/home/cpns/boatPanel/BoatGeneral.vue

@@ -178,12 +178,14 @@ export default {
     if(timeRange.time1&&timeRange.time2) {
       playState.value=-1
       // ueCallBoatGuiji(timeRange.time1, timeRange.time2)
-      console.log('轨迹回放'+ props.boatInfo.mmsi)
+      console.log('轨迹回放'+ props.boatInfo)
       let data={
         deviceId:  props.boatInfo.mmsi,
         startTime:timeRange.time1,
         endTime:timeRange.time2}
-      playBoatPath(data)
+
+      bus.emit('playBoatPath', data)
+
       // let timer = setInterval(() => {
       //   if(playState.value===-1) { return }
       //   ueCallBoatDrive()