|
@@ -1,10 +1,12 @@
|
|
<template>
|
|
<template>
|
|
|
|
+ <Rules v-if="showRules" @close="closeRules" />
|
|
|
|
+
|
|
<AppHeader v-show="!fscChecked" :project="project" @getUserId="getUserId" :show-adjust="showAdjust" @update="onPointsUpdate" />
|
|
<AppHeader v-show="!fscChecked" :project="project" @getUserId="getUserId" :show-adjust="showAdjust" @update="onPointsUpdate" />
|
|
<article>
|
|
<article>
|
|
<main>
|
|
<main>
|
|
<div class="split">
|
|
<div class="split">
|
|
<iframe ref="sourceFrame" v-if="sourceURL" :src="sourceURL" frameborder="0" @load="onLoadSource"></iframe>
|
|
<iframe ref="sourceFrame" v-if="sourceURL" :src="sourceURL" frameborder="0" @load="onLoadSource"></iframe>
|
|
- <div class="tools" v-if="source" v-show="showWidget && !showAdjust && !fscChecked && (dbsChecked || (!target && !bimChecked))">
|
|
|
|
|
|
+ <div class="tools" v-if="source && !showRules && !ruleChecked" v-show="showWidget && !showAdjust && !fscChecked && (dbsChecked || (!target && !bimChecked))">
|
|
<div class="item-date">
|
|
<div class="item-date">
|
|
<calendar
|
|
<calendar
|
|
name="source"
|
|
name="source"
|
|
@@ -69,20 +71,26 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="model" v-show="showWidget && !showAdjust">
|
|
|
|
- <div v-if="isLogin" class="file" :class="{ active: fileChecked, disable: fileDisable }" v-show="!fscChecked && !showBim && !dbsChecked && !bimChecked">
|
|
|
|
|
|
+ <div class="model" v-show="showWidget && !showAdjust && !showRules">
|
|
|
|
+ <div v-if="isLogin" class="file" :class="{ active: fileChecked, disable: fileDisable }" v-show="!fscChecked && !showBim && !dbsChecked && !bimChecked && !ruleChecked">
|
|
<div @click="onFileChecked">
|
|
<div @click="onFileChecked">
|
|
<i class="iconfont icon-note1"></i>
|
|
<i class="iconfont icon-note1"></i>
|
|
<span>{{ $t('home.tag') }}</span>
|
|
<span>{{ $t('home.tag') }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="bim" :class="{ active: bimChecked, disable: bimDisable }" v-show="!fscChecked && !showBim">
|
|
|
|
|
|
+ <div class="rule" :class="{ active: ruleChecked, disable: fileDisable }" v-show="!fscChecked && !showBim && !dbsChecked && !bimChecked">
|
|
|
|
+ <div @click="onRuleChecked">
|
|
|
|
+ <i class="iconfont icon-measurement"></i>
|
|
|
|
+ <span>{{ $t('common.measure') }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="bim" :class="{ active: bimChecked, disable: bimDisable }" v-show="!fscChecked && !showBim && !ruleChecked">
|
|
<div @click="onBimChecked">
|
|
<div @click="onBimChecked">
|
|
<i class="iconfont icon-BIM"></i>
|
|
<i class="iconfont icon-BIM"></i>
|
|
<span>BIM</span>
|
|
<span>BIM</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="dbs" :class="{ active: dbsChecked, disable: dbsDisable }" v-show="!fscChecked && !showBim">
|
|
|
|
|
|
+ <div class="dbs" :class="{ active: dbsChecked, disable: dbsDisable }" v-show="!fscChecked && !showBim && !ruleChecked">
|
|
<div @click="onDbsChecked">
|
|
<div @click="onDbsChecked">
|
|
<i class="iconfont icon-split_screen"></i>
|
|
<i class="iconfont icon-split_screen"></i>
|
|
<span>{{ $t('home.splitScreen') }}</span>
|
|
<span>{{ $t('home.splitScreen') }}</span>
|
|
@@ -112,22 +120,30 @@ import Files from '@/components/files'
|
|
import TagManager from '@/components/files/TagManager'
|
|
import TagManager from '@/components/files/TagManager'
|
|
import sync, { beforeChangeURL, loadSourceScene, loadTargetScene, setPanoWithBim, flyToP1P2 } from '@/utils/sync'
|
|
import sync, { beforeChangeURL, loadSourceScene, loadTargetScene, setPanoWithBim, flyToP1P2 } from '@/utils/sync'
|
|
import i18n from '@/i18n'
|
|
import i18n from '@/i18n'
|
|
|
|
+import Rules from './Rules'
|
|
const { t } = i18n.global
|
|
const { t } = i18n.global
|
|
const isDev = process.env.VUE_APP_TEST == 1
|
|
const isDev = process.env.VUE_APP_TEST == 1
|
|
-
|
|
|
|
|
|
+const rules = []
|
|
const tags = ref([])
|
|
const tags = ref([])
|
|
const notify = ref(null)
|
|
const notify = ref(null)
|
|
const isEdit = ref(false)
|
|
const isEdit = ref(false)
|
|
const isLogin = ref(false)
|
|
const isLogin = ref(false)
|
|
|
|
+const isFlying = ref(false)
|
|
provide('tags', tags)
|
|
provide('tags', tags)
|
|
provide('notify', notify)
|
|
provide('notify', notify)
|
|
provide('isEdit', isEdit)
|
|
provide('isEdit', isEdit)
|
|
provide('isLogin', isLogin)
|
|
provide('isLogin', isLogin)
|
|
|
|
+provide('isFlying', isFlying)
|
|
const userId = ref(localStorage.getItem('userId') || null)
|
|
const userId = ref(localStorage.getItem('userId') || null)
|
|
|
|
|
|
const getUserId = id => {
|
|
const getUserId = id => {
|
|
userId.value = id
|
|
userId.value = id
|
|
}
|
|
}
|
|
|
|
+const showRules = ref(false)
|
|
|
|
+const closeRules = () => {
|
|
|
|
+ showRules.value = false
|
|
|
|
+ window.kankan.TagManager.cancelMeasure()
|
|
|
|
+}
|
|
|
|
|
|
// 是否BIM模式
|
|
// 是否BIM模式
|
|
const showBim = ref(browser.urlHasValue('bim'))
|
|
const showBim = ref(browser.urlHasValue('bim'))
|
|
@@ -139,6 +155,7 @@ const bimChecked = ref()
|
|
const dbsChecked = ref(null)
|
|
const dbsChecked = ref(null)
|
|
const fscChecked = ref(null)
|
|
const fscChecked = ref(null)
|
|
const fileChecked = ref(false)
|
|
const fileChecked = ref(false)
|
|
|
|
+const ruleChecked = ref(false)
|
|
|
|
|
|
const datepickName = ref(null)
|
|
const datepickName = ref(null)
|
|
|
|
|
|
@@ -199,7 +216,8 @@ const sourceURL = computed(() => {
|
|
if (!source.value) {
|
|
if (!source.value) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ // console.log(1111)
|
|
|
|
+ getTagList(source.value.num)
|
|
if (source.value.type < 2) {
|
|
if (source.value.type < 2) {
|
|
// 看看、看见场景
|
|
// 看看、看见场景
|
|
return `smart-kankan.html?m=${source.value.num}${isDev ? '&dev' : ''}`
|
|
return `smart-kankan.html?m=${source.value.num}${isDev ? '&dev' : ''}`
|
|
@@ -212,8 +230,8 @@ const targetURL = computed(() => {
|
|
if (bimChecked.value) {
|
|
if (bimChecked.value) {
|
|
return `smart-bim.html?m=${project.value.bimData.bimOssFilePath}`
|
|
return `smart-bim.html?m=${project.value.bimData.bimOssFilePath}`
|
|
}
|
|
}
|
|
-
|
|
|
|
- if (source.value.type < 2) {
|
|
|
|
|
|
+ getTagList(target.value.num)
|
|
|
|
+ if (target.value.type < 2) {
|
|
// 看看、看见场景
|
|
// 看看、看见场景
|
|
return `smart-kankan.html?m=${target.value.num}${isDev ? '&dev' : ''}`
|
|
return `smart-kankan.html?m=${target.value.num}${isDev ? '&dev' : ''}`
|
|
} else {
|
|
} else {
|
|
@@ -294,8 +312,25 @@ const onLoadSource = () => {
|
|
if (source.value.type < 2) {
|
|
if (source.value.type < 2) {
|
|
window['kankan'] = sourceFrame.value.contentWindow.app
|
|
window['kankan'] = sourceFrame.value.contentWindow.app
|
|
window['kankan'].TagManager.load(tags.value)
|
|
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 {
|
|
} else {
|
|
window['laser'] = sourceFrame.value.contentWindow.loaded
|
|
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)
|
|
loadSourceScene(sourceFrame, source.value.type < 2 ? 'kankan' : 'laser', mode.value)
|
|
}
|
|
}
|
|
@@ -542,10 +577,44 @@ const onP2Click = type => {
|
|
|
|
|
|
flyToP1P2(points.value.p2)
|
|
flyToP1P2(points.value.p2)
|
|
}
|
|
}
|
|
-
|
|
|
|
-onMounted(() => {
|
|
|
|
- const num = browser.valueFromUrl('m') || ''
|
|
|
|
- const projectId = browser.valueFromUrl('projectId') || 1
|
|
|
|
|
|
+const onRuleChecked = () => {
|
|
|
|
+ if (ruleChecked.value) {
|
|
|
|
+ ruleChecked.value = false
|
|
|
|
+ rules.forEach(rule => {
|
|
|
|
+ rule.clear()
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (source.value.type < 2) {
|
|
|
|
+ showRules.value = true
|
|
|
|
+ window.kankan.TagManager.startMeasure()
|
|
|
|
+ } else {
|
|
|
|
+ sync.sourceInst.loaded.then(sdk => {
|
|
|
|
+ const rule = sdk.startMeasure()
|
|
|
|
+ rules.push(rule)
|
|
|
|
+ })
|
|
|
|
+ ruleChecked.value = true
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+const getTagList = num => {
|
|
|
|
+ http.post(`smart-site/marking/list`, {
|
|
|
|
+ projectId: projectId,
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 200,
|
|
|
|
+ num: num ? num : browser.getURLParam('m'),
|
|
|
|
+ }).then(response => {
|
|
|
|
+ if (response.data && response.data.list) {
|
|
|
|
+ tags.value = response.data.list.map(item => {
|
|
|
|
+ item.hotData.visible = false
|
|
|
|
+ item.hotData.id = item.markingId
|
|
|
|
+ item.hotData.createTime = item.createTime
|
|
|
|
+ item.hotData.lastCreateBy = item.lastCreateBy
|
|
|
|
+ return item.hotData
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+const getInfo = () => {
|
|
http.get(`smart-site/project/info?projectId=${projectId}&sceneOrder=asc`)
|
|
http.get(`smart-site/project/info?projectId=${projectId}&sceneOrder=asc`)
|
|
.then(response => {
|
|
.then(response => {
|
|
if (response.success) {
|
|
if (response.success) {
|
|
@@ -593,23 +662,13 @@ onMounted(() => {
|
|
.catch(() => {
|
|
.catch(() => {
|
|
showTips.value = t('code.failed')
|
|
showTips.value = t('code.failed')
|
|
})
|
|
})
|
|
- console.error(browser.getURLParam('m'))
|
|
|
|
- http.post(`smart-site/marking/list`, {
|
|
|
|
- projectId: projectId,
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 200,
|
|
|
|
- num: browser.getURLParam('m'),
|
|
|
|
- }).then(response => {
|
|
|
|
- if (response.data && response.data.list) {
|
|
|
|
- tags.value = response.data.list.map(item => {
|
|
|
|
- item.hotData.visible = false
|
|
|
|
- item.hotData.id = item.markingId
|
|
|
|
- item.hotData.createTime = item.createTime
|
|
|
|
- item.hotData.lastCreateBy = item.lastCreateBy
|
|
|
|
- return item.hotData
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+}
|
|
|
|
+const num = browser.valueFromUrl('m') || ''
|
|
|
|
+const projectId = browser.valueFromUrl('projectId') || 1
|
|
|
|
+
|
|
|
|
+onMounted(() => {
|
|
|
|
+ getInfo()
|
|
|
|
+ getTagList()
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|
|
|
|
|