Преглед на файлове

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

xzw преди 2 години
родител
ревизия
70498d29e4
променени са 3 файла, в които са добавени 66 реда и са изтрити 17 реда
  1. 25 14
      src/components/header/index.vue
  2. 39 3
      src/pages/SViewer.vue
  3. 2 0
      src/pages/Viewer.vue

+ 25 - 14
src/components/header/index.vue

@@ -11,7 +11,9 @@
         <div class="user">
             <ul>
                 <li>
-                    <i @click="showLink=true;showCopyDone=false" class="iconfont icon-share"></i>
+                    <i
+                        @click="showLink = true;showCopyDone = false" class="iconfont icon-share"
+                    ></i>
                 </li>
                 <li><em></em></li>
                 <li v-if="user" class="uinfo" @click="showDrop = true">
@@ -32,13 +34,14 @@
         <h4>为场景设置关联位置</h4>
         <div>请选择位置,确认左右视图中的场景在同一位置后,单击右侧按钮将其设为关联位置。</div>
         <div class="points">
-            <button @click="onSetP1" :class="{ active: points.p1 }">设为P1</button>
-            <button @click="onSetP2" :class="{ active: points.p2 }">设为P2</button>
+            <button @click="onSetP1" :class="{ active: points.p1 }">{{ points.p1 ? '重设P1' : '设为P1' }}</button>
+            <button @click="onSetP2" :class="{ active: points.p2 }">{{ points.p2 ? '重设P2' : '设为P2' }}</button>
         </div>
     </footer>
-    <Toast v-if="showCopyDone"  content="复制成功" />
+    <Toast v-if="showCopyDone" content="复制成功" />
+    <Toast v-if="showTips" :content="showTips" :close="() => (showTips = null)" />
     <Login v-if="showLogin" @close="showLogin = false" @user="info => (user = info)" />
-    <CopyLink v-if="showLink" @close="showLink=false" @done="showCopyDone=true;showLink=false" />
+    <CopyLink v-if="showLink" @close="showLink = false" @done="showCopyDone = true;showLink = false" />
 </template>
 <script setup>
 import { ref, defineProps, onMounted, watchEffect } from 'vue'
@@ -60,6 +63,7 @@ const points = ref({ p1: null, p2: null })
 const showLink = ref(false)
 const showLogin = ref(false)
 const showCopyDone = ref(false)
+const showTips = ref(null)
 
 const getCurPosInfo = () => {
     let app = sync.sourceInst
@@ -75,14 +79,18 @@ const getCurPosInfo = () => {
 }
 
 const onSetP1 = () => {
+    if (points.value.p1) {
+        showTips.value = '关联位置已更新'
+    }
     points.value.p1 = getCurPosInfo()
-    console.log(points.value.p1)
-    emits('update', 'p1',points.value.p1)
+    emits('update', 'p1', points.value.p1)
 }
 const onSetP2 = () => {
+    if (points.value.p2) {
+        showTips.value = '关联位置已更新'
+    }
     points.value.p2 = getCurPosInfo()
-    console.log(points.value.p2)
-    emits('update', 'p2',points.value.p2)
+    emits('update', 'p2', points.value.p2)
 }
 
 const getUserInfo = () => {
@@ -125,15 +133,18 @@ const onSubmit = () => {
     })
         .then(response => {
             if (response.success) {
-                window.location.href = window.location.href.replace('&adjust', '&split')
-            } else if(response.code == 4008) {
+                showTips.value = 'BIM同步成功'
+                setTimeout(() => {
+                    window.location.href = window.location.href.replace('&adjust', '&split')
+                }, 4000)
+            } else if (response.code == 4008) {
                 showLogin.value = true
             } else {
-                alert(response.message)
+                showTips.value = response.message
             }
         })
         .catch(() => {
-            alert('链接服务器失败')
+            showTips.value = '连接服务器失败'
         })
 }
 
@@ -226,7 +237,7 @@ footer {
     }
     i {
         font-size: 18px;
-        cursor:pointer;
+        cursor: pointer;
     }
     em {
         margin: 0 20px;

+ 39 - 3
src/pages/SViewer.vue

@@ -6,6 +6,7 @@
                 <div @click="onBimChecked">
                     <i class="iconfont icon-BIM"></i>
                 </div>
+                <span v-show="showBimTips">BIM</span>
             </div>
         </div>
         <div class="tools" v-show="!bimChecked">
@@ -29,6 +30,8 @@ import browser from '@/utils/browser'
 import Calendar from '@/components/calendar/mobile.vue'
 import sync, { loadSourceScene, loadTargetScene } from '@/utils/sync'
 
+const showBimTips = ref(false)
+
 const showTips = ref(null)
 const bimChecked = ref(null)
 const sourceFrame = ref(null)
@@ -57,7 +60,7 @@ const sourceURL = computed(() => {
         let pose = ''
         if (sourceFrame.value && sourceFrame.value.contentWindow.app && sourceFrame.value.contentWindow.app.Camera) {
             let sdk = sourceFrame.value.contentWindow.app
-            pose = '&'+sdk.Camera.getPoseUrlParams()
+            pose = '&' + sdk.Camera.getPoseUrlParams()
         }
         // 看看、看见场景
         return `smart-kankan.html?m=${source.value.num}${pose}`
@@ -141,8 +144,20 @@ const onNextDate = name => {
 
 // bim点击
 const onBimChecked = () => {
+
+    showBimTips.value = true;
+
+    setTimeout(() => {
+        showBimTips.value = false
+    }, 2000);
+
+    if (!project.value || !project.value.bimData) {
+        showTips.value = '未发现BIM文件'
+        return
+    }
     if (bimChecked.value) {
         bimChecked.value = false
+        showBimTips.value = false
     } else {
         bimChecked.value = true
     }
@@ -222,6 +237,27 @@ main {
         z-index: 1000;
         display: flex;
         flex-direction: column;
+        span {
+            position: absolute;
+            left: 130%;
+            top: 48%;
+            background: rgba(27, 27, 28, 0.8);
+            padding: 4px;
+            border-radius: 4px;
+            color:#fff;
+            &::before {
+                content: '';
+                position: absolute;
+                right: 100%;
+                top: 50%;
+                margin-top:-7px;
+                width: 0;
+                height: 0;
+                border-top: 7px solid transparent;
+                border-right: 14px solid rgba(27, 27, 28, 0.8);
+                border-bottom: 7px solid transparent;
+            }
+        }
         > div {
             cursor: pointer;
             width: 50px;
@@ -250,8 +286,8 @@ main {
             &.disable {
                 opacity: 0.5;
             }
-            i{
-                font-size:20px
+            i {
+                font-size: 20px;
             }
         }
     }

+ 2 - 0
src/pages/Viewer.vue

@@ -227,6 +227,8 @@ const onSelected = data => {
                 }
             }
         }
+    } else{
+        showTips.value = '选择日期未上传场景'
     }
 
     datepickName.value = null