Selaa lähdekoodia

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

xzw 2 vuotta sitten
vanhempi
commit
ce8dcbbf74
1 muutettua tiedostoa jossa 18 lisäystä ja 7 poistoa
  1. 18 7
      src/pages/SViewer.vue

+ 18 - 7
src/pages/SViewer.vue

@@ -1,6 +1,6 @@
 <template>
-    <main v-if="source">
-        <iframe ref="sourceFrame" :src="sourceURL" frameborder="0" @load="onLoadSource"></iframe>
+    <main>
+        <iframe ref="sourceFrame" v-if="sourceURL" :src="sourceURL" frameborder="0" @load="onLoadSource"></iframe>
         <div class="model" v-show="!showAdjust">
             <div class="bim" :class="{ active: bimChecked, disable: project && !project.bimData }">
                 <div @click="onBimChecked">
@@ -9,7 +9,7 @@
                 <span v-show="showBimTips">BIM</span>
             </div>
         </div>
-        <div class="tools" v-show="!bimChecked">
+        <div class="tools"  v-if="source" v-show="!bimChecked">
             <div class="item-date">
                 <Calendar :value="sourceDate" :highlighted="sourceDays" @selected="onSelected" @prev="onPrevDate" @next="onNextDate" />
             </div>
@@ -33,8 +33,10 @@ import sync, {laserChangeMode, loadSourceScene, loadTargetScene , setPanoWithBim
 // 点位信息
 let lastFakeApp = null
 let panoData
-const showBimTips = ref(false)
 
+// 是否BIM模式
+const showBim = ref(browser.urlHasValue('bim'))
+const showBimTips = ref(false)
 const showTips = ref(null)
 const bimChecked = ref(null)
 const sourceFrame = ref(null)
@@ -79,7 +81,11 @@ const sourceURL = computed(() => {
     }
     if(bimChecked.value){
         return `smart-bim.html?m=${project.value.bimData.bimOssFilePath}`
-    }else if(source.value.type < 2) {
+    }
+    if(!source.value){
+        return
+    }
+    if(source.value.type < 2) {
         return `smart-kankan.html?m=${source.value.num}`
     } else {
         return `smart-laser.html?m=${source.value.num}&dev`
@@ -99,8 +105,10 @@ const onLoadSource = () => {
             }
             
               
-        } 
-        lastFakeApp = sync.views.createFakeApp(sourceFrame.value.contentWindow);  
+        }
+        if(project.value.sceneList.length) {
+            lastFakeApp = sync.views.createFakeApp(sourceFrame.value.contentWindow);  
+        }
     } 
 
  
@@ -241,6 +249,9 @@ onMounted(() => {
         .then(response => {
             if (response.success) {
                 project.value = response.data
+                if (showBim.value) {
+                    onBimChecked()
+                }
                 if (project.value.sceneList.length) {
                     source.value = project.value.sceneList[0]
                 }