|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="pano-layout" v-loading="loading" >
|
|
|
+ <div class="pano-layout" v-loading="loading" :element-loading-text="loadingStr">
|
|
|
<canvas ref="panoDomRef"></canvas>
|
|
|
<div class="btns">
|
|
|
<el-button
|
|
@@ -50,7 +50,8 @@
|
|
|
import SingleInput from "@/components/point-input.vue";
|
|
|
import { router, setDocTitle } from "@/router";
|
|
|
import { mergeFuns, round } from "@/util";
|
|
|
-import { computed, onMounted, onUnmounted, ref, watchEffect } from "vue";
|
|
|
+import { glMatrix } from "gl-matrix";
|
|
|
+import { computed, nextTick, onMounted, onUnmounted, ref, watchEffect } from "vue";
|
|
|
import { init } from "./env";
|
|
|
import {
|
|
|
updateScenePointName,
|
|
@@ -91,12 +92,12 @@ watchEffect(() => {
|
|
|
|
|
|
const panoUrls = computed(() => {
|
|
|
return (
|
|
|
- point.value &&
|
|
|
- getPointPano(point.value, point.value.cameraType === DeviceType.CLUNT)
|
|
|
+ point.value && getPointPano(point.value, point.value.cameraType === DeviceType.CLUNT)
|
|
|
);
|
|
|
});
|
|
|
const update = ref(false);
|
|
|
const loading = ref(false);
|
|
|
+const loadingStr = ref("");
|
|
|
|
|
|
const getGis = () => {
|
|
|
const pos = point.value!.pos as number[];
|
|
@@ -113,6 +114,7 @@ const copyGis = async () => {
|
|
|
|
|
|
const photo = async () => {
|
|
|
loading.value = true;
|
|
|
+ loadingStr.value = "原图提取中";
|
|
|
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
|
const ration = tempRadion.value;
|
|
|
console.log("ration", ration);
|
|
@@ -138,7 +140,7 @@ const setSize = (ration: number, w?: number, h?: number) => {
|
|
|
|
|
|
onMounted(() => {
|
|
|
if (!panoDomRef.value) throw "没有canvas DOM";
|
|
|
- pano = init(panoDomRef.value);
|
|
|
+ pano = init(panoDomRef.value, 0);
|
|
|
const resizeHandler = () => {
|
|
|
setSize(devicePixelRatio);
|
|
|
};
|
|
@@ -150,6 +152,9 @@ onMounted(() => {
|
|
|
if (panoUrls.value) {
|
|
|
loading.value = true;
|
|
|
pano.changeUrls(panoUrls.value).then(() => (loading.value = false));
|
|
|
+ pano.setYaw(
|
|
|
+ point.value.cameraType === DeviceType.CLUNT ? glMatrix.toRadian(180) : 0
|
|
|
+ );
|
|
|
}
|
|
|
}),
|
|
|
pano.destory,
|
|
@@ -161,10 +166,7 @@ onMounted(() => {
|
|
|
|
|
|
onUnmounted(() => mergeFuns(...destroyFns)());
|
|
|
watchEffect(() => {
|
|
|
- if (
|
|
|
- router.currentRoute.value.name.toString().includes("pano") &&
|
|
|
- point.value
|
|
|
- ) {
|
|
|
+ if (router.currentRoute.value.name.toString().includes("pano") && point.value) {
|
|
|
setDocTitle(point.value.index.toString() || relics.value.name);
|
|
|
}
|
|
|
});
|