|
|
@@ -43,13 +43,13 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="model" v-show="!showAdjust">
|
|
|
- <div class="bim" :class="{ active: bimChecked }" v-show="!fscChecked">
|
|
|
+ <div class="bim" :class="{ active: bimChecked, disable: project && !project.bimData }" v-show="!fscChecked">
|
|
|
<div @click="onBimChecked">
|
|
|
<i class="iconfont icon-BIM"></i>
|
|
|
<span>BIM</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="dbs" :class="{ active: dbsChecked }" @click="onDbsChecked" v-show="!fscChecked">
|
|
|
+ <div class="dbs" :class="{ active: dbsChecked, disable: scenes.length < 2 && !bimChecked }" @click="onDbsChecked" v-show="!fscChecked">
|
|
|
<i class="iconfont icon-split_screen"></i>
|
|
|
<span>分屏</span>
|
|
|
</div>
|
|
|
@@ -59,6 +59,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</main>
|
|
|
+ <Toast v-if="showBimTips" type="warn" content="未发现BIM文件" :close="() => (showBimTips = false)" />
|
|
|
+ <Toast v-if="showDbsTips" type="warn" content="未发现对比场景" :close="() => (showDbsTips = false)" />
|
|
|
</article>
|
|
|
</template>
|
|
|
|
|
|
@@ -66,15 +68,18 @@
|
|
|
import { ref, onMounted, computed, nextTick } from 'vue'
|
|
|
import { http } from '@/utils/request'
|
|
|
import browser from '@/utils/browser'
|
|
|
+import Toast from '@/components/dialog/Toast'
|
|
|
import AppHeader from '@/components/header'
|
|
|
import Calendar from '@/components/calendar'
|
|
|
import sync, { loadSourceScene, loadTargetScene } from '@/utils/sync'
|
|
|
|
|
|
+// 是否BIM模式
|
|
|
+const showBim = ref(browser.urlHasValue('bim'))
|
|
|
// 是否校准模式
|
|
|
const showSplit = ref(browser.urlHasValue('split'))
|
|
|
const showAdjust = ref(browser.urlHasValue('adjust'))
|
|
|
|
|
|
-const bimChecked = ref(null)
|
|
|
+const bimChecked = ref()
|
|
|
const dbsChecked = ref(null)
|
|
|
const fscChecked = ref(null)
|
|
|
|
|
|
@@ -89,6 +94,9 @@ const target = ref(null)
|
|
|
const project = ref(null)
|
|
|
const points = ref({ p1: false, p2: false })
|
|
|
|
|
|
+const showBimTips = ref(false)
|
|
|
+const showDbsTips = ref(false)
|
|
|
+
|
|
|
const scenes = computed(() => {
|
|
|
if (!project.value) {
|
|
|
return []
|
|
|
@@ -189,7 +197,7 @@ const onLoadTarget = () => {
|
|
|
}
|
|
|
|
|
|
const onModeChange = targetMode => {
|
|
|
- window.Log('changeMode:'+targetMode, '#3cffff')
|
|
|
+ window.Log('changeMode:' + targetMode, '#3cffff')
|
|
|
if (sync.sourceInst) {
|
|
|
sync.sourceInst.loaded.then(sdk => sdk.scene.changeMode(targetMode))
|
|
|
mode.value = targetMode
|
|
|
@@ -296,9 +304,19 @@ const onNextDate = name => {
|
|
|
|
|
|
// bim点击
|
|
|
const onBimChecked = () => {
|
|
|
+ if (!project.value || !project.value.bimData) {
|
|
|
+ showBimTips.value = true
|
|
|
+ return
|
|
|
+ }
|
|
|
if (bimChecked.value) {
|
|
|
bimChecked.value = false
|
|
|
if (dbsChecked.value) {
|
|
|
+ // 如果没有多场景数据,取消分屏
|
|
|
+ if (scenes.value.length < 2) {
|
|
|
+ onDbsChecked()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
// 判断是否分屏状态
|
|
|
let index = scenes.value.findIndex(item => item.num == source.value.num)
|
|
|
if (index == -1) {
|
|
|
@@ -316,6 +334,10 @@ const onBimChecked = () => {
|
|
|
|
|
|
// 分屏点击
|
|
|
const onDbsChecked = () => {
|
|
|
+ if (!dbsChecked.value && scenes.value.length < 2 && !bimChecked.value) {
|
|
|
+ showDbsTips.value = true
|
|
|
+ return
|
|
|
+ }
|
|
|
dbsChecked.value = !dbsChecked.value
|
|
|
if (dbsChecked.value) {
|
|
|
if (bimChecked.value) {
|
|
|
@@ -385,7 +407,9 @@ onMounted(() => {
|
|
|
response.data.panos = JSON.parse(response.data.panos)
|
|
|
points.value.p1 = true
|
|
|
points.value.p2 = true
|
|
|
- } catch (error) {}
|
|
|
+ } catch (error) {
|
|
|
+ console.error(error)
|
|
|
+ }
|
|
|
}
|
|
|
project.value = response.data
|
|
|
if (project.value.sceneList.length) {
|
|
|
@@ -398,6 +422,8 @@ onMounted(() => {
|
|
|
if (showAdjust.value || showSplit.value) {
|
|
|
onBimChecked()
|
|
|
nextTick(() => onDbsChecked())
|
|
|
+ } else if (showBim.value) {
|
|
|
+ onBimChecked()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -539,7 +565,6 @@ main {
|
|
|
}
|
|
|
&.disable {
|
|
|
opacity: 0.5;
|
|
|
- cursor: default;
|
|
|
}
|
|
|
span {
|
|
|
font-size: 12px;
|