Browse Source

点击设备拉镜头

wangfumin 6 days ago
parent
commit
89a49ff7ec
3 changed files with 12 additions and 11 deletions
  1. 9 9
      src/hook/use-fly.ts
  2. 1 0
      src/sdk/sdk.ts
  3. 2 2
      src/views/positioning/components/sign.vue

+ 9 - 9
src/hook/use-fly.ts

@@ -135,15 +135,15 @@ export const flyPlayPath = (path: Path) => {
   return stopFly
 }
 
-// export const flyplayPosition = (macId: any) => {
-//   stopFly && stopFly()
-//   stopFly = () => {
-//     stopFly = null
-//     // pauseSceneGuide()
-//   }
-//   // playPosition()
-//   return stopFly
-// }
+export const flyPlayPosition = (position: any) => {
+  stopFly && stopFly()
+  stopFly = () => {
+    stopFly = null
+    sdk.setFollowDevice(null)
+  }
+  sdk.setFollowDevice(position.macId)
+  return stopFly
+}
 
 export const flyLatLng = (latlng: number[]) => {
   stopFly && stopFly();

+ 1 - 0
src/sdk/sdk.ts

@@ -224,6 +224,7 @@ export interface SDK {
   createAnimationGroup: () => AnimationGroup;
 
   generateAniPathData: () => any
+  setFollowDevice: (macId: any) => void
 }
 
 export type PathProps = {

+ 2 - 2
src/views/positioning/components/sign.vue

@@ -1,6 +1,6 @@
 <template>
     <ui-group-option v-if="position" class="sign-position" :class="{ search }">
-      <div class="info">
+      <div class="info" @click="flyPlayPosition(position)">
         <div class="position-cover">
           <img src="@/assets/equipment_e.svg" />
           <!-- <ui-icon
@@ -31,7 +31,7 @@
   import { playSceneGuide, isScenePlayIng, pauseSceneGuide } from "@/sdk";
   import useFocus from "bill/hook/useFocus";
   import { Message } from "bill/expose-common";
-  import { flyPlayGuide } from "@/hook/use-fly";
+  import { flyPlayGuide, flyPlayPosition } from "@/hook/use-fly";
   
   const props = withDefaults(
     defineProps<{ position: Position; edit?: boolean; search?: boolean }>(),