rindy 2 سال پیش
والد
کامیت
011a998071
2فایلهای تغییر یافته به همراه8 افزوده شده و 7 حذف شده
  1. 2 2
      src/components/header/index.vue
  2. 6 5
      src/pages/Viewer.vue

+ 2 - 2
src/components/header/index.vue

@@ -77,12 +77,12 @@ const getCurPosInfo = () => {
 const onSetP1 = () => {
     points.value.p1 = getCurPosInfo()
     console.log(points.value.p1)
-    emits('update', 'p1')
+    emits('update', 'p1',points.value.p1)
 }
 const onSetP2 = () => {
     points.value.p2 = getCurPosInfo()
     console.log(points.value.p2)
-    emits('update', 'p2')
+    emits('update', 'p2',points.value.p2)
 }
 
 const getUserInfo = () => {

+ 6 - 5
src/pages/Viewer.vue

@@ -91,7 +91,7 @@ const mode = ref(0)
 const source = ref(null)
 const target = ref(null)
 const project = ref(null)
-const points = ref({ p1: false, p2: false })
+const points = ref({ p1: null, p2: null })
 
 const showTips = ref(null)
 
@@ -389,8 +389,8 @@ const onFscChecked = () => {
     }
 }
 
-const onPointsUpdate = type => {
-    points.value[type] = true
+const onPointsUpdate = (type,data) => {
+    points.value[type] = data
 }
 
 const onP1Click = (type) =>{
@@ -398,6 +398,7 @@ const onP1Click = (type) =>{
         showTips.value = '您还未选择关联位置'
         return
     }
+    console.log(points.value.p1)
     // todo 定位
     alert(type)
 }
@@ -421,8 +422,8 @@ onMounted(() => {
                     if (response.data.panos) {
                         try {
                             response.data.panos = JSON.parse(response.data.panos)
-                            points.value.p1 = true
-                            points.value.p2 = true
+                            points.value.p1 = response.data.panos.p1
+                            points.value.p2 = response.data.panos.p2
                             setPanoWithBim(response.data.panos)
                         
                         } catch (error) {