|
@@ -132,6 +132,8 @@ const isLogin = ref(false)
|
|
|
const isFlying = ref(false)
|
|
|
const editTagId = ref(null)
|
|
|
const isAuth = ref(false)
|
|
|
+const source = ref(null)
|
|
|
+
|
|
|
provide('tags', tags)
|
|
|
provide('notify', notify)
|
|
|
provide('isEdit', isEdit)
|
|
@@ -139,6 +141,7 @@ provide('editTagId', editTagId)
|
|
|
provide('isLogin', isLogin)
|
|
|
provide('isFlying', isFlying)
|
|
|
provide('isAuth', isAuth)
|
|
|
+provide('source', source)
|
|
|
const userId = ref(localStorage.getItem('userId') || null)
|
|
|
|
|
|
const getUserId = id => {
|
|
@@ -169,7 +172,6 @@ const targetFrame = ref(null)
|
|
|
|
|
|
const mode = ref(0)
|
|
|
|
|
|
-const source = ref(null)
|
|
|
const target = ref(null)
|
|
|
const project = ref(null)
|
|
|
const points = ref({ p1: null, p2: null })
|
|
@@ -314,7 +316,9 @@ const onLoadSource = () => {
|
|
|
// BIM单屏模式
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
if (source.value.type < 2) {
|
|
|
+ window['laser'] = null
|
|
|
window['kankan'] = sourceFrame.value.contentWindow.app
|
|
|
window['kankan'].TagManager.load(tags.value)
|
|
|
|
|
@@ -325,9 +329,18 @@ const onLoadSource = () => {
|
|
|
isFlying.value = false
|
|
|
})
|
|
|
} else {
|
|
|
+ window['kankan'] = null
|
|
|
window['laser'] = sourceFrame.value.contentWindow.loaded
|
|
|
window.laser.then(sdk => {
|
|
|
- console.error(window[0].viewer)
|
|
|
+ console.error('**************')
|
|
|
+ sdk.scene.on('posChange', cameraPos => {
|
|
|
+ tags.value.forEach(tag => {
|
|
|
+ const info2d = sdk.scene.getScreenByPoint(tag.position)
|
|
|
+ tag.x = info2d.pos.x
|
|
|
+ tag.y = info2d.pos.y
|
|
|
+ tag.visible = info2d.trueSide
|
|
|
+ })
|
|
|
+ })
|
|
|
|
|
|
window[0].viewer.images360.addEventListener('flyToPano', () => {
|
|
|
isFlying.value = true
|
|
@@ -585,10 +598,10 @@ const onP2Click = type => {
|
|
|
|
|
|
const onRuleHandler = sdk => {
|
|
|
let rule = sdk.startMeasure()
|
|
|
- rule.bus.on('end',()=>{
|
|
|
+ rule.bus.on('end', () => {
|
|
|
setTimeout(() => {
|
|
|
- onRuleHandler(sdk)
|
|
|
- }, 1);
|
|
|
+ onRuleHandler(sdk)
|
|
|
+ }, 1)
|
|
|
})
|
|
|
rules.push(rule)
|
|
|
}
|