| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138 |
- <template>
- <Rules v-if="showRules" @close="closeRules" />
- <AppHeader v-show="!fscChecked" :project="project" @getUserId="getUserId" :show-adjust="showAdjust" @update="onPointsUpdate" />
- <article>
- <main>
- <div class="split">
- <iframe ref="sourceFrame" v-if="sourceURL" :src="sourceURL" frameborder="0" @load="onLoadSource"></iframe>
- <div class="tools" v-if="source && !showRules && !ruleChecked" v-show="showWidget && !showAdjust && !fscChecked && (dbsChecked || (!target && !bimChecked))">
- <div class="item-date">
- <calendar
- name="source"
- :count="scenes.length"
- :controls="controls"
- :value="sourceDate"
- :highlighted="sourceDays"
- @selected="onSelected"
- @pick="onPickDate"
- @prev="onPrevDate"
- @next="onNextDate"
- ></calendar>
- </div>
- <div class="item-mode" v-if="source.type == 2 || source.type == 3">
- <div class="iconfont icon-show_roaming" :class="{ active: mode == 0 }" @click="onModeChange(0)"></div>
- <div class="iconfont icon-show_plane" :class="{ active: mode == 1 }" @click="onModeChange(1)"></div>
- </div>
- <div class="item-density" v-if="(source.type == 2 && mode == 1) || (source.type == 3 && mode == 1)" :class="{ active: showDensity }" @click="showDensity = !showDensity">
- <span>{{ densityType.text }}</span>
- <i class="iconfont icon-arrows_down"></i>
- <ul>
- <li v-for="density in densityTypes" @click="onDensityChange(density)">{{ density.text }}</li>
- </ul>
- </div>
- </div>
- <div class="points" v-if="showAdjust">
- <div :class="{ active: points.p1 }" @click="onP1Click('left')">
- <i class="iconfont" :class="[points.p1 ? 'icon-positioning01' : 'icon-positioning02']"></i>
- <span>P1</span>
- </div>
- <div :class="{ active: points.p2 }" @click="onP2Click('left')">
- <i class="iconfont" :class="[points.p2 ? 'icon-positioning01' : 'icon-positioning02']"></i>
- <span>P2</span>
- </div>
- </div>
- </div>
- <div class="split" v-if="target">
- <iframe ref="targetFrame" :src="targetURL" frameborder="0" @load="onLoadTarget"></iframe>
- <div class="tools" v-show="!fscChecked && !bimChecked">
- <div class="item-date target">
- <calendar
- name="target"
- :count="scenes.length"
- :controls="controls"
- :value="targetDate"
- :highlighted="targetDays"
- @selected="onSelected"
- @pick="onPickDate"
- @prev="onPrevDate"
- @next="onNextDate"
- ></calendar>
- </div>
- </div>
- <div class="points" v-if="showAdjust">
- <div :class="{ active: points.p1 }" @click="onP1Click('right')">
- <i class="iconfont" :class="[points.p1 ? 'icon-positioning01' : 'icon-positioning02']"></i>
- <span>P1</span>
- </div>
- <div :class="{ active: points.p2 }" @click="onP2Click('right')">
- <i class="iconfont" :class="[points.p2 ? 'icon-positioning01' : 'icon-positioning02']"></i>
- <span>P2</span>
- </div>
- </div>
- </div>
- <div class="model" v-show="showWidget && !showAdjust && !showRules">
- <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 v-if="isLogin && isAuth" class="file" :class="{ active: fileChecked, disable: fileDisable }" v-show="!fscChecked && !showBim && !dbsChecked && !bimChecked && !ruleChecked">
- <div @click="onFileChecked">
- <i class="iconfont icon-note1"></i>
- <span>{{ $t('home.tag') }}</span>
- </div>
- </div>
- <div class="bim" :class="{ active: bimChecked, disable: bimDisable }" v-show="!fscChecked && !showBim && !ruleChecked">
- <div @click="onBimChecked">
- <i class="iconfont icon-BIM"></i>
- <span>BIM</span>
- </div>
- </div>
- <div class="dbs" :class="{ active: dbsChecked, disable: dbsDisable }" v-show="!fscChecked && !showBim && !ruleChecked">
- <div @click="onDbsChecked">
- <i class="iconfont icon-split_screen"></i>
- <span>{{ $t('home.splitScreen') }}</span>
- </div>
- </div>
- <div class="fsc" :class="{ active: fscChecked }" @click="onFscChecked">
- <i class="iconfont" :class="[fscChecked ? 'icon-full_screen_selected' : 'icon-full_screen_normal']"></i>
- <span>{{ $t('home.fullScreen') }}</span>
- </div>
- </div>
- <TagManager ref="tagManager" />
- </main>
- </article>
- <Toast v-if="showTips" type="warn" :content="showTips" :close="() => (showTips = null)" />
- <Files :show="fileChecked" @exit="() => (fileChecked = false)" />
- </template>
- <script setup>
- import { ref, onMounted, computed, nextTick, provide, watch } from 'vue'
- import { http } from '@/utils/request'
- import axios from 'axios'
- import browser from '@/utils/browser'
- import Toast from '@/components/dialog/Toast'
- import AppHeader from '@/components/header'
- import Calendar from '@/components/calendar'
- import Files from '@/components/files'
- import TagManager from '@/components/files/TagManager'
- import sync, { beforeChangeURL, loadSourceScene, loadTargetScene, setPanoWithBim, flyToP1P2 } from '@/utils/sync'
- import i18n, { getLocale, useI18n, useScope, setI18nLanguage, loadLocaleMessages } from '@/i18n'
- import Rules from './Rules'
- let tagsNum = null
- const { t } = useI18n({ useScope: 'global' })
- const isDev = process.env.VUE_APP_TEST == 1
- const rules = []
- const tags = ref([])
- const notify = ref(null)
- const isEdit = ref(false)
- const isLogin = ref(false)
- const isFlying = ref(false)
- const editTagId = ref(null)
- const isAuth = ref(false)
- const source = ref(null)
- const tagManager = ref(null)
- provide('tags', tags)
- provide('notify', notify)
- provide('isEdit', isEdit)
- 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 => {
- userId.value = id
- }
- const showRules = ref(false)
- const closeRules = () => {
- showRules.value = false
- window.kankan.TagManager.cancelMeasure()
- }
- // 是否BIM模式
- const showBim = ref(browser.urlHasValue('bim'))
- // 是否校准模式
- const showSplit = ref(browser.urlHasValue('split'))
- const showAdjust = ref(browser.urlHasValue('adjust'))
- const bimChecked = ref()
- const dbsChecked = ref(null)
- const fscChecked = ref(null)
- const fileChecked = ref(false)
- const ruleChecked = ref(false)
- const datepickName = ref(null)
- const sourceFrame = ref(null)
- const targetFrame = ref(null)
- const mode = ref(0)
- const target = ref(null)
- const project = ref(null)
- const points = ref({ p1: null, p2: null })
- watch(
- () => dbsChecked.value,
- (val, old) => {
- let tagsVieww = document.querySelector(`div[xui_tags_view]`)
- if (val) {
- // tagsVieww.style.visibility = 'hidden'
- // tagsVieww.style.width = '50%'
- // tagsVieww.style.overflow = 'hidden'
- } else {
- // tagsVieww.style.visibility = 'visible'
- // tagsVieww.style.width = '100%'
- // tagsVieww.style.overflow = 'visible'
- if (bimChecked.value) {
- tagsVieww.style.visibility = 'hidden'
- }
- }
- }
- )
- watch(
- () => bimChecked.value,
- (val, old) => {
- let tagsVieww = document.querySelector(`div[xui_tags_view]`)
- if (val) {
- if (!dbsChecked.value) {
- tagsVieww.style.visibility = 'hidden'
- }
- } else {
- if (!dbsChecked.value) {
- tagsVieww.style.visibility = 'visible'
- }
- }
- }
- )
- const densityTypes = ref([
- { type: 'high', text: t('common.high') },
- { type: 'middle', text: t('common.middle') },
- { type: 'low', text: t('common.low') },
- ])
- const densityType = ref(densityTypes.value[0])
- const showTips = ref(null)
- const showDensity = ref(false)
- const showWidget = computed(() => {
- if (fileChecked.value) {
- return false
- }
- return true
- })
- const scenes = computed(() => {
- if (!project.value) {
- return []
- }
- return project.value.sceneList.map(item => {
- return {
- num: item.num,
- type: item.type,
- createTime: item.createTime,
- }
- })
- })
- const controls = computed(() => {
- if (bimChecked.value) {
- return scenes.value.length > 1
- }
- return dbsChecked.value ? scenes.value.length > 2 : scenes.value.length > 1
- })
- const sourceURL = computed(() => {
- beforeChangeURL('source')
- if (bimChecked.value && !dbsChecked.value) {
- return `smart-bim.html?m=${project.value.bimData.bimOssFilePath}&lang=${getLocale()}`
- }
- if (!source.value) {
- return
- }
- getTagList(source.value.num)
- if (source.value.type < 2) {
- // 看看、看见场景
- return `smart-kankan.html?m=${source.value.num}${isDev ? '&dev' : ''}&lang=${getLocale()}`
- } else {
- getLaserInfo(source.value.num)
- // 深时场景
- let url = ''
- if (process.env.VUE_APP_ENV == 'aws') {
- url = `smart-laser.html?m=${source.value.num}${isDev ? '&dev' : ''}&lang=${getLocale()}&serve_link=${process.env.VUE_APP_LASER_URL}&panoResourceBasePath=${
- process.env.VUE_APP_RESOURCE_URL
- }&resourceBasePath=${process.env.VUE_APP_LASER_RESOURCE_URL}®ion=${process.env.VUE_APP_ENV}`
- } else {
- url = `smart-laser.html?m=${source.value.num}${isDev ? '&dev' : ''}&lang=${getLocale()}&serve_link=${process.env.VUE_APP_LASER_URL}&panoResourceBasePath=${
- process.env.VUE_APP_RESOURCE_URL
- }&resourceBasePath=${process.env.VUE_APP_LASER_RESOURCE_URL}`
- }
- return url
- }
- })
- const noPanorama = ref(true)
- const getLaserInfo = num => {
- axios
- .get(process.env.VUE_APP_LASER_URL + `laser/dataset/${num}/getDataSet`)
- .then(res => {
- if (res.data.code == 200) {
- let list = res.data.data
- list.forEach(item => {
- if (item.pointCount) {
- noPanorama.value = false
- }
- })
- if (noPanorama.value) {
- // onModeChange(1)
- mode.value = 1
- }
- } else {
- }
- })
- .catch(() => {
- // showTips.value = t('code.failed')
- })
- }
- const targetURL = computed(() => {
- if (bimChecked.value) {
- return `smart-bim.html?m=${project.value.bimData.bimOssFilePath}&lang=${getLocale()}&serve_link=${process.env.VUE_APP_LASER_URL}`
- }
- // getTagList(target.value.num)
- if (target.value.type < 2) {
- // 看看、看见场景
- return `smart-kankan.html?m=${target.value.num}${isDev ? '&dev' : ''}&lang=${getLocale()}&serve_link=${process.env.VUE_APP_LASER_URL}`
- } else {
- // 深时场景
- let url = ''
- if (process.env.VUE_APP_ENV == 'aws') {
- url = `smart-laser.html?m=${target.value.num}${isDev ? '&dev' : ''}&lang=${getLocale()}&serve_link=${process.env.VUE_APP_LASER_URL}&panoResourceBasePath=${
- process.env.VUE_APP_RESOURCE_URL
- }&resourceBasePath=${process.env.VUE_APP_LASER_RESOURCE_URL}®ion=${process.env.VUE_APP_ENV}`
- } else {
- url = `smart-laser.html?m=${target.value.num}${isDev ? '&dev' : ''}&lang=${getLocale()}&serve_link=${process.env.VUE_APP_LASER_URL}&panoResourceBasePath=${
- process.env.VUE_APP_RESOURCE_URL
- }&resourceBasePath=${process.env.VUE_APP_LASER_RESOURCE_URL}`
- }
- return url
- }
- })
- const sourceDate = computed(() => {
- if (source.value) {
- return source.value.createTime.toDate()
- }
- })
- const targetDate = computed(() => {
- if (target.value) {
- return target.value.createTime.toDate()
- }
- })
- const sourceDays = computed(() => {
- let dates = []
- if (datepickName.value == 'source') {
- if (dbsChecked.value) {
- // 分屏模式
- if (bimChecked.value) {
- // BIM模式
- dates = scenes.value.map(item => item.createTime.toDate())
- } else {
- // 非BIM模式
- dates = scenes.value.filter(item => item.createTime != target.value.createTime).map(item => item.createTime.toDate())
- }
- } else {
- // 非分屏模式
- dates = scenes.value.map(item => item.createTime.toDate())
- }
- }
- return {
- dates: dates,
- }
- })
- const targetDays = computed(() => {
- let dates = []
- if (datepickName.value == 'target') {
- dates = scenes.value.filter(item => item.createTime != source.value.createTime).map(item => item.createTime.toDate())
- }
- return {
- dates: dates,
- }
- })
- const fileDisable = computed(() => {
- return false
- })
- const bimDisable = computed(() => {
- if (!project.value || !project.value.bimData) {
- return true
- }
- })
- const dbsDisable = computed(() => {
- if (scenes.value.length == 0) {
- // 没有场景的情况
- return 1
- }
- if (!bimChecked.value && scenes.value.length == 1) {
- // 只有1个场景的情况
- return 2
- }
- })
- const onLoadSource = () => {
- if (bimChecked.value && !dbsChecked.value) {
- // BIM单屏模式
- return
- }
- if (source.value.type < 2) {
- window['laser'] = null
- window['kankan'] = sourceFrame.value.contentWindow.app
- 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 {
- window['kankan'] = null
- window['laser'] = sourceFrame.value.contentWindow.loaded
- window.laser.then(sdk => {
- sdk.scene.on('posChange', cameraPos => {
- tags.value.forEach(tag => {
- const info2d = sdk.scene.getScreenByPoint(tag.position, true)
- // tag.x = info2d.pos.x
- // tag.y = info2d.pos.y
- // tag.visible = info2d.trueSide && info2d.inSight
- tag.visible = info2d.trueSide && info2d.inSight
- if (tag.visible) {
- tag.x = info2d.pos.x
- tag.y = info2d.pos.y
- }
- })
- })
- 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)
- }
- const onLoadTarget = () => {
- if (bimChecked.value) {
- loadTargetScene(targetFrame, 'bim')
- } else {
- loadTargetScene(targetFrame, target.value.type < 2 ? 'kankan' : 'laser', mode.value)
- }
- }
- const onModeChange = targetMode => {
- if (targetMode == 0 && noPanorama.value) {
- showTips.value = t('home.noPanorama')
- return
- }
- window.Log('changeMode:' + targetMode, '#3cffff')
- if (sync.sourceInst) {
- sync.sourceInst.loaded.then(sdk => sdk.scene.changeMode(targetMode))
- mode.value = targetMode
- sync.views.laserChangeMode(mode.value)
- }
- }
- const onDensityChange = density => {
- if (sync.sourceInst) {
- sync.sourceInst.loaded.then(sdk => {
- //console.log('onDensityChange',sync.sourceInst.sceneName, density.type)
- let data = sdk.scene.changePointDensity(density.type)
- sdk.scene.changeDensityPercent(data.percent)
- sync.sourceInst.viewer.dispatchEvent('densityChange')
- })
- densityType.value = density
- }
- }
- const onPickDate = name => {
- datepickName.value = name
- tagManager.value.onClose()
- }
- const onSelected = data => {
- if (!data.payload) {
- return
- }
- let { name, payload } = data
- let date = payload.format('YYYY-mm-dd')
- let dates = (name == 'source' ? sourceDays : targetDays).value.dates.map(item => item.format('YYYY-mm-dd'))
- if (dates.indexOf(date) != -1) {
- let time = payload.format('YYYY-mm-dd HH:MM')
- let find = scenes.value.find(c => c.createTime.indexOf(time) != -1)
- if (find) {
- if (name == 'source') {
- if (find.num != source.value.num) {
- source.value = find
- }
- } else {
- if (find.num != target.value.num) {
- target.value = find
- }
- }
- }
- } else {
- showTips.value = t('home.dateScene')
- }
- datepickName.value = null
- }
- const onPrevDate = name => {
- tagManager.value.onClose()
- let scene = null
- if (name == 'source') {
- scene = source
- } else {
- scene = target
- }
- let index = scenes.value.findIndex(item => item.num == scene.value.num)
- if (index == -1) {
- return
- }
- if (--index == -1) {
- index = scenes.value.length - 1
- }
- if (target.value && !bimChecked.value) {
- // 分屏模式判断
- if (name == 'source') {
- if (scenes.value[index].createTime == target.value.createTime) {
- index--
- }
- } else {
- if (scenes.value[index].createTime == source.value.createTime) {
- index--
- }
- }
- if (index == -1) {
- index = scenes.value.length - 1
- }
- }
- scene.value = scenes.value[index]
- }
- const onNextDate = name => {
- tagManager.value.onClose()
- let scene = null
- if (name == 'source') {
- scene = source
- } else {
- scene = target
- }
- let index = scenes.value.findIndex(item => item.num == scene.value.num)
- if (index == -1) {
- return
- }
- if (++index > scenes.value.length - 1) {
- index = 0
- }
- if (target.value && !bimChecked.value) {
- // 分屏模式判断
- if (name == 'source') {
- if (scenes.value[index].createTime == target.value.createTime) {
- index++
- }
- } else {
- if (scenes.value[index].createTime == source.value.createTime) {
- index++
- }
- }
- if (index > scenes.value.length - 1) {
- index = 0
- }
- }
- scene.value = scenes.value[index]
- }
- const onFileChecked = () => {
- fileChecked.value = !fileChecked.value
- }
- // bim点击
- const onBimChecked = () => {
- if (bimDisable.value) {
- return (showTips.value = t('home.notFindFile'))
- }
- 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) {
- return
- }
- if (++index > scenes.value.length - 1) {
- index = 0
- }
- target.value = scenes.value[index]
- }
- } else {
- bimChecked.value = true
- }
- }
- // 分屏点击
- const onDbsChecked = () => {
- if (dbsDisable.value && !dbsChecked.value) {
- return (showTips.value = t('home.notFindScene'))
- }
- dbsChecked.value = !dbsChecked.value
- if (dbsChecked.value) {
- if (bimChecked.value) {
- // BIM分屏
- source.value = scenes.value[scenes.value.length - 1]
- target.value = project.value.bimData
- } else {
- // 四维看看、激光场景分屏
- let index = scenes.value.findIndex(item => item.num == source.value.num)
- if (index == -1) {
- return
- }
- if (++index > scenes.value.length - 1) {
- index = 0
- }
- target.value = scenes.value[index]
- }
- } else {
- target.value = null
- }
- }
- // 全屏点击
- const onFscChecked = () => {
- let element = document.documentElement
- fscChecked.value = !fscChecked.value
- if (fscChecked.value) {
- if (element.requestFullscreen) {
- element.requestFullscreen()
- } else if (element.webkitRequestFullScreen) {
- element.webkitRequestFullScreen()
- } else if (element.mozRequestFullScreen) {
- element.mozRequestFullScreen()
- } else if (element.msRequestFullscreen) {
- element.msRequestFullscreen()
- }
- } else {
- if (document.exitFullscreen) {
- document.exitFullscreen()
- } else if (document.webkitCancelFullScreen) {
- document.webkitCancelFullScreen()
- } else if (document.mozCancelFullScreen) {
- document.mozCancelFullScreen()
- } else if (document.msExitFullscreen) {
- document.msExitFullscreen()
- }
- }
- }
- const onPointsUpdate = (type, data) => {
- points.value[type] = data
- }
- const onP1Click = type => {
- if (!points.value.p1) {
- showTips.value = t('home.notChoosePoint')
- return
- }
- console.log(points.value.p1)
- // todo 定位
- flyToP1P2(points.value.p1)
- }
- const onP2Click = type => {
- if (!points.value.p2) {
- showTips.value = t('home.notChoosePoint')
- return
- }
- // todo 定位
- flyToP1P2(points.value.p2)
- }
- const onRuleHandler = sdk => {
- let rule = sdk.startMeasure()
- rule.bus.on('end', () => {
- setTimeout(() => {
- onRuleHandler(sdk)
- }, 1)
- })
- rules.push(rule)
- }
- 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 => {
- onRuleHandler(sdk)
- })
- ruleChecked.value = true
- }
- }
- const getTagList = num => {
- const pnum = num ? num : browser.getURLParam('m')
- http.post(`smart-site/marking/list`, {
- projectId: projectId,
- pageNum: 1,
- pageSize: 200,
- num: pnum,
- }).then(response => {
- if (response.data && response.data.list) {
- tags.value.length = 0
- response.data.list
- .map(item => {
- item.hotData.visible = false
- item.hotData.id = item.markingId
- item.hotData.createTime = item.createTime
- item.hotData.createBy = item.createBy
- return item.hotData
- })
- .forEach(item => {
- tags.value.push(item)
- })
- if (window['kankan']) {
- window['kankan'].TagManager.load(tags.value)
- }
- }
- })
- }
- const getInfo = () => {
- http.get(`smart-site/project/info?projectId=${projectId}&sceneOrder=asc`)
- .then(response => {
- if (response.success) {
- if (response.data) {
- document.title = response.data.projectName
- if (response.data.panos) {
- try {
- response.data.panos = JSON.parse(response.data.panos)
- points.value.p1 = response.data.panos.p1
- points.value.p2 = response.data.panos.p2
- setPanoWithBim(response.data.panos)
- } catch (error) {
- console.error(error)
- }
- }
- project.value = response.data
- if (showBim.value) {
- onBimChecked()
- } else if (project.value.sceneList.length) {
- if (num) {
- source.value = project.value.sceneList.find(c => c.num == num)
- } else {
- source.value = project.value.sceneList[project.value.sceneList.length - 1]
- }
- if (!source.value) {
- return (showTips.value = t('home.sceneDelete'))
- }
- // mode.value = source.value?.location == 6 ? 1 : 0
- if (showAdjust.value || showSplit.value) {
- onBimChecked()
- nextTick(() => onDbsChecked())
- }
- } else {
- return (showTips.value = t('home.sceneDelete'))
- }
- }
- } else {
- if (response.code == 4008) {
- // 未登录
- localStorage.removeItem('token')
- } else {
- showTips.value = t(`code.${response.code}`)
- }
- }
- })
- .catch(() => {
- showTips.value = t('code.failed')
- })
- }
- const num = browser.valueFromUrl('m') || ''
- const projectId = browser.valueFromUrl('projectId') || 1
- onMounted(() => {
- getInfo()
- // getTagList()
- document.addEventListener('fullscreenchange', () => {
- if (document.fullscreenElement) {
- if (!fscChecked.value) {
- fscChecked.value = true
- }
- } else {
- if (fscChecked.value) {
- fscChecked.value = false
- }
- }
- })
- })
- </script>
- <style lang="scss" scoped>
- article {
- display: flex;
- width: 100%;
- height: 100%;
- overflow: hidden;
- }
- aside {
- width: 160px;
- height: 100%;
- background-color: rgba(0, 0, 0, 0.8);
- h4 {
- font-size: 16px;
- text-align: center;
- }
- ul {
- margin-top: 20px;
- }
- li {
- margin: 0;
- padding: 0;
- font-size: 16px;
- margin-left: 20px;
- cursor: pointer;
- &:hover,
- &.active {
- color: #00c8af;
- }
- }
- }
- main {
- flex: 1;
- width: 100%;
- height: 100%;
- position: relative;
- display: flex;
- &.full {
- .split {
- width: 50%;
- }
- }
- iframe {
- position: absolute;
- left: 0;
- top: 0;
- z-index: 1000;
- width: 100%;
- height: 100%;
- border: none;
- outline: none;
- }
- .split {
- margin-left: 2px;
- width: 100%;
- height: 100%;
- overflow: hidden;
- position: relative;
- &:first-child,
- &:last-child {
- margin-left: 0;
- }
- .points {
- position: absolute;
- left: 50%;
- top: 64px;
- z-index: 9999;
- display: flex;
- transform: translateX(-50%);
- div {
- cursor: pointer;
- margin-left: 20px;
- width: 70px;
- height: 88px;
- background: rgba(27, 27, 28, 0.8);
- box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25), inset 0px 0px 0px 2px rgba(255, 255, 255, 0.1);
- border-radius: 8px 8px 8px 8px;
- opacity: 1;
- border: 1px solid #000000;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- &.active {
- color: #0076f6;
- }
- i {
- font-size: 24px;
- }
- span {
- font-size: 16px;
- margin-top: 10px;
- }
- }
- }
- }
- .model {
- position: absolute;
- left: 50px;
- bottom: 40px;
- z-index: 1000;
- display: flex;
- flex-direction: column;
- > div {
- cursor: pointer;
- width: 50px;
- height: 50px;
- margin-top: 16px;
- background: rgba(27, 27, 28, 0.8);
- box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
- border-radius: 47px 47px 47px 47px;
- border: 1px solid #000000;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- > div {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- }
- &.active {
- color: #0076f6;
- }
- &.disable {
- opacity: 0.5;
- }
- span {
- font-size: 12px;
- padding-top: 1px;
- transform: scale(0.8);
- text-align: center;
- }
- }
- }
- .tools {
- position: absolute;
- width: 100%;
- bottom: 40px;
- z-index: 2000;
- display: flex;
- justify-content: center;
- align-items: center;
- color: #fff;
- pointer-events: none;
- > div {
- pointer-events: all;
- }
- .item-mode {
- height: 50px;
- background: rgba(27, 27, 28, 0.8);
- box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
- border-radius: 47px 47px 47px 47px;
- border: 1px solid #000000;
- display: flex;
- justify-content: center;
- align-items: center;
- margin-left: 10px;
- margin-right: 10px;
- font-size: 16px;
- padding: 0 16px;
- div {
- cursor: pointer;
- font-size: 18px;
- }
- div:last-child {
- margin-left: 20px;
- }
- div.active {
- color: #0076f6;
- }
- }
- .item-density {
- position: relative;
- cursor: pointer;
- height: 50px;
- width: 68px;
- background: rgba(27, 27, 28, 0.8);
- box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
- border-radius: 47px 47px 47px 47px;
- border: 1px solid #000000;
- display: flex;
- justify-content: center;
- align-items: center;
- margin-left: 10px;
- margin-right: 10px;
- font-size: 16px;
- padding: 0 16px;
- &.active {
- ul {
- display: block;
- }
- i {
- transform: scale(0.8) rotate(180deg);
- }
- }
- span {
- margin-right: 4px;
- }
- i {
- transform: scale(0.8);
- font-size: 14px;
- }
- ul {
- display: none;
- position: absolute;
- left: 0;
- bottom: calc(100% + 10px);
- width: 68px;
- padding: 10px 0;
- border-radius: 12px;
- text-align: center;
- background: rgba(27, 27, 28, 0.8);
- box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
- border: 1px solid #000000;
- list-style: none;
- li {
- padding: 5px 0;
- &:hover {
- color: #0076f6;
- }
- }
- }
- }
- }
- }
- </style>
- <style lang="scss">
- #app {
- background-color: rgba(0, 0, 0, 0.8);
- display: flex;
- flex-direction: column;
- }
- .vuejs3-datepicker__calendar {
- background: rgba(27, 27, 28, 0.8);
- box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
- border-radius: 4px 4px 4px 4px;
- opacity: 1;
- border: 1px solid #000000;
- filter: blur(undefinedpx);
- color: #fff;
- }
- .vuejs3-datepicker__calendar-topbar {
- display: none !important;
- }
- .vuejs3-datepicker__calendar header .up:not(.disabled):hover {
- background: rgba(0, 0, 0, 0.3);
- color: #fff;
- }
- .vuejs3-datepicker__calendar header .prev:after {
- border-left: 1px solid #fff;
- border-bottom: 1px solid #fff;
- }
- .vuejs3-datepicker__calendar header .prev:not(.disabled):hover {
- background: rgba(0, 0, 0, 0.3);
- }
- .vuejs3-datepicker__calendar header .next:after {
- border-top: 1px solid #fff;
- border-right: 1px solid #fff;
- }
- .vuejs3-datepicker__calendar header .next:not(.disabled):hover {
- background: rgba(0, 0, 0, 0.3);
- }
- .vuejs3-datepicker__calendar .cell {
- font-size: 16px !important;
- border-radius: 4px;
- }
- .highlighted {
- color: #076ede !important;
- background: transparent !important;
- }
- .selected {
- color: #fff !important;
- background: #0076f6 !important;
- }
- </style>
|