bill пре 1 година
родитељ
комит
e7d46c6ebb
3 измењених фајлова са 5 додато и 6 уклоњено
  1. 2 3
      src/sdk/association/guide.ts
  2. 2 2
      src/sdk/association/index.ts
  3. 1 1
      src/views/guide/edit-paths.vue

+ 2 - 3
src/sdk/association/guide.ts

@@ -17,7 +17,7 @@ import {
   getGuidePaths
 } from '@/store'
 
-import type { FuseModel, FuseModels, Guide } from '@/store'
+import type { FuseModel, FuseModels, Guide, GuidePath } from '@/store'
 import { analysisPoseInfo } from '.'
 
 // -----------------导览关联--------------------
@@ -122,8 +122,7 @@ export enum ScenePlayIngEnum {
 }
 export const isScenePlayIng = ref<ScenePlayIngEnum>(ScenePlayIngEnum.stop)
 let pauseRecovery: () => void
-export const playSceneGuide = async (guide: Guide, changeIndexCallback?: (index: number) => void, forceFull = false) => {
-  const paths = getGuidePaths(guide)
+export const playSceneGuide = async (paths: GuidePath[], changeIndexCallback?: (index: number) => void, forceFull = false) => {
   if (isScenePlayIng.value) {
     throw new Error('导览正在播放')
   }

+ 2 - 2
src/sdk/association/index.ts

@@ -27,7 +27,7 @@ export const getSupperPanoModel = () => {
 };
 
 export const analysisPose = (pose: Pose) => {
-  if ('model' in pose) {
+  if ('model' in pose && pose.model) {
     let info: GuidePath['panoInfo'] | undefined = undefined
     let fuseMode: FuseModel
     for (const [k, v] of Array.from(sceneModelMap.entries())) {
@@ -54,7 +54,7 @@ export const analysisPose = (pose: Pose) => {
 
 export const analysisPoseInfo = (info: ReturnType<typeof analysisPose>) => {
   let pose: Pose = { target: info.target, position: info.position }
-  if ('panoInfo' in info) {
+  if ('panoInfo' in info && info.panoInfo) {
     let sceneModel: SceneModel
     for (const [k, v] of Array.from(sceneModelMap.entries())) {
       if (k.id === info.panoInfo.modelId) {

+ 1 - 1
src/views/guide/edit-paths.vue

@@ -208,7 +208,7 @@ const play = async () => {
   } else {
     changeCurrent(paths.value[0]);
     await asyncTimeout(400);
-    playSceneGuide(toRaw(paths.value) as any, (index) => {
+    playSceneGuide(paths.value, (index) => {
       current.value = paths.value[index - 1];
     });
   }