|
@@ -16,6 +16,16 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
|
+import { debounce } from "lodash";
|
|
|
|
+
|
|
|
|
+const _ = window.ResizeObserver;
|
|
|
|
+window.ResizeObserver = class ResizeObserver extends _ {
|
|
|
|
+ constructor(callback) {
|
|
|
|
+ callback = debounce(callback, 100);
|
|
|
|
+ super(callback);
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
import Pano from "@/components/Pano";
|
|
import Pano from "@/components/Pano";
|
|
import Tags from "@/components/assembly/Tags";
|
|
import Tags from "@/components/assembly/Tags";
|
|
import Password from "@/components/assembly/Password";
|
|
import Password from "@/components/assembly/Password";
|
|
@@ -136,7 +146,7 @@ onMounted(async () => {
|
|
|
|
|
|
store.dispatch("audio/initNormalBGM", data.workBackgroundMusic ? data.workBackgroundMusic.ossPath : "");
|
|
store.dispatch("audio/initNormalBGM", data.workBackgroundMusic ? data.workBackgroundMusic.ossPath : "");
|
|
store.commit("scene/setCurrentScene", currentSceneData);
|
|
store.commit("scene/setCurrentScene", currentSceneData);
|
|
- console.error(currentSceneData)
|
|
|
|
|
|
+ console.error(currentSceneData);
|
|
let activeScene = null;
|
|
let activeScene = null;
|
|
navigationTrees.forEach((item, index) => {
|
|
navigationTrees.forEach((item, index) => {
|
|
activeScene = item.children.find((pano) => pano.id == currentSceneData.id);
|
|
activeScene = item.children.find((pano) => pano.id == currentSceneData.id);
|
|
@@ -204,7 +214,7 @@ onMounted(async () => {
|
|
|
|
|
|
let isHavePano = scenes.some((item) => item.type == "pano");
|
|
let isHavePano = scenes.some((item) => item.type == "pano");
|
|
|
|
|
|
- let currnetVisual = workVisualAngleList.forEach((item) => item.navigationId == currentScene.value.id);
|
|
|
|
|
|
+ let currnetVisual = workVisualAngleList.find((item) => item.navigationId == currentScene.value.id);
|
|
// if (!currnetVisual) {
|
|
// if (!currnetVisual) {
|
|
// currnetVisual = {
|
|
// currnetVisual = {
|
|
// hlookat: 0,
|
|
// hlookat: 0,
|
|
@@ -289,7 +299,7 @@ onMounted(async () => {
|
|
app.Tags.initHotspot(currentHotspots, false);
|
|
app.Tags.initHotspot(currentHotspots, false);
|
|
}
|
|
}
|
|
// app.Tags.initHotspot(hotspots, false);
|
|
// app.Tags.initHotspot(hotspots, false);
|
|
- handleVisualLimit(app, currentScene.value);
|
|
|
|
|
|
+ handleVisualLimit(app, currentScene.value, workVisualAngleList);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
@@ -301,10 +311,12 @@ onMounted(async () => {
|
|
const handlePass = () => {
|
|
const handlePass = () => {
|
|
hasPasswordLock.value = false;
|
|
hasPasswordLock.value = false;
|
|
};
|
|
};
|
|
-const handleVisualLimit = (app, currentScene) => {
|
|
|
|
- let currnetVisual = workVisualAngleList.forEach((item) => item.navigationId == currentScene.value.id);
|
|
|
|
|
|
+const handleVisualLimit = (app, currentScene, workVisualAngleList) => {
|
|
|
|
+ let currnetVisual = workVisualAngleList.find((item) => item.navigationId == currentScene.id);
|
|
// const { vlookatmax, vlookatmin } = currentScene.initVisual;
|
|
// const { vlookatmax, vlookatmin } = currentScene.initVisual;
|
|
// console.log('initVisual',currentScene.initVisual)
|
|
// console.log('initVisual',currentScene.initVisual)
|
|
|
|
+ console.error("视角", currnetVisual.vlookatmin, currnetVisual.vlookatmax);
|
|
|
|
+
|
|
app.krpanoDom.set(`view.limitview`, "lookat");
|
|
app.krpanoDom.set(`view.limitview`, "lookat");
|
|
app.krpanoDom.set(`view.vlookatmin`, currnetVisual.vlookatmin || -90);
|
|
app.krpanoDom.set(`view.vlookatmin`, currnetVisual.vlookatmin || -90);
|
|
app.krpanoDom.set(`view.vlookatmax`, currnetVisual.vlookatmax || 90);
|
|
app.krpanoDom.set(`view.vlookatmax`, currnetVisual.vlookatmax || 90);
|