Quellcode durchsuchen

Merge branch 'dev' of http://192.168.0.115:3000/4dkankan/4dkankan_bim into dev

rindy vor 2 Jahren
Ursprung
Commit
a147209929
3 geänderte Dateien mit 54 neuen und 10 gelöschten Zeilen
  1. 2 1
      src/components/files/content/Comment.vue
  2. 31 7
      src/components/files/index.vue
  3. 21 2
      src/pages/Viewer.vue

+ 2 - 1
src/components/files/content/Comment.vue

@@ -275,7 +275,8 @@ onBeforeUnmount(() => {})
                 border: 1px solid rgba(255, 255, 255, 0.2);
                 position: relative;
                 input {
-                    width: 75%;
+                    // width: 75%;
+                    width: 73%;
                     line-height: 34px;
                     padding: 0 5px;
                     color: #fff;

+ 31 - 7
src/components/files/index.vue

@@ -1,6 +1,6 @@
 <template>
     <transition name="slide-right" mode="in-out">
-        <div class="files" v-if="showFiles && !isEdit">
+        <div class="files" v-if="showFiles && !isEdit" >
             <div class="info" ref="add$">
                 <button @click="onAdd">{{ $t('tag.addTag') }}</button>
                 <div>
@@ -8,7 +8,7 @@
                     >)
                 </div>
             </div>
-            <div class="list" :style="`height:${listStyle};`">
+            <div class="list" :style="`height:${listStyle};`" :class="{ disabled: isFlying }">
                 <ul>
                     <li v-for="tag in tags" @click="onClick(tag)" :class="{ active: notify?.sid == tag.sid }">
                         <div class="title"><i></i>{{ tag.title }}</div>
@@ -83,8 +83,12 @@ const tags = inject('tags')
 
 const notify = inject('notify')
 const isEdit = inject('isEdit')
+const isFlying = inject('isFlying')
 const onClick = tag => {
-    notify.value = tag //{ event: 'focus', sid: props.tag.sid, tag: props.tag }
+    notify.value = null
+    nextTick(() => {
+        notify.value = tag //{ event: 'focus', sid: props.tag.sid, tag: props.tag }
+    })
 }
 let isAdd = false
 const onAdd = () => {
@@ -261,7 +265,27 @@ watchEffect(() => {
     }
 })
 
-onMounted(() => {})
+onMounted(() => {
+    // app.Camera.on('flying.started', pano => {
+    //     store.commit('setFlying', true)
+    // })
+    // app.Camera.on('flying.ended', ({ targetPano }) => {
+    //     store.commit('setFlying', false)
+    // })
+    // if (window.kankan) {
+    //     console.error(window.kankan)
+    // } else if (window.laser) {
+    //     window.laser.then(res => {
+    //         console.error(res)
+    //     })
+    // }
+    // window[0].Scene.on('loaded', sdk => {
+    //     console.error(e)
+    // })
+    // window[0].loaded.then(sdk => {
+    //     console.error(sdk)
+    // })
+})
 </script>
 <style lang="scss" scoped>
 button {
@@ -377,7 +401,7 @@ li {
     justify-content: space-between;
     font-size: 14px;
     &.active {
-        background-color: rgba(0, 118, 246, 0.1);
+        background-color: rgba(0, 118, 246, 0.3);
     }
     .title {
     }
@@ -412,13 +436,13 @@ li {
                 height: 32px;
                 line-height: 32px;
                 &:hover {
-                    background-color: rgb(0, 118, 246, 0.1);
+                    background-color: rgb(0, 118, 246, 0.3);
                 }
             }
         }
     }
     &:hover {
-        background-color: rgb(0, 118, 246, 0.1);
+        background-color: rgb(0, 118, 246, 0.3);
     }
 }
 

+ 21 - 2
src/pages/Viewer.vue

@@ -128,10 +128,12 @@ const tags = ref([])
 const notify = ref(null)
 const isEdit = ref(false)
 const isLogin = ref(false)
+const isFlying = ref(false)
 provide('tags', tags)
 provide('notify', notify)
 provide('isEdit', isEdit)
 provide('isLogin', isLogin)
+provide('isFlying', isFlying)
 const userId = ref(localStorage.getItem('userId') || null)
 
 const getUserId = id => {
@@ -308,8 +310,25 @@ const onLoadSource = () => {
     if (source.value.type < 2) {
         window['kankan'] = sourceFrame.value.contentWindow.app
         window['kankan'].TagManager.load(tags.value)
+
+        window['kankan'].Camera.on('flying.started', pano => {
+            isFlying.value = true
+        })
+        window['kankan'].Camera.on('flying.ended', pano => {
+            isFlying.value = false
+        })
     } else {
         window['laser'] = sourceFrame.value.contentWindow.loaded
+        window.laser.then(sdk => {
+            console.error(window[0].viewer)
+
+            window[0].viewer.images360.addEventListener('flyToPano',()=>{
+              isFlying.value = true
+            })
+            window[0].viewer.images360.addEventListener('flyToPanoDone',()=>{
+              isFlying.value = false
+            })
+        })
     }
     loadSourceScene(sourceFrame, source.value.type < 2 ? 'kankan' : 'laser', mode.value)
 }
@@ -557,12 +576,12 @@ const onP2Click = type => {
 const onRuleChecked = () => {
     if (ruleChecked.value) {
         ruleChecked.value = false
-        rules.forEach(rule=>{
+        rules.forEach(rule => {
             rule.clear()
         })
         return
     }
-    if (source.value.type<2) {
+    if (source.value.type < 2) {
         showRules.value = true
         window.kankan.TagManager.startMeasure()
     } else {