智慧工地修改

This commit is contained in:
徐克 2022-08-02 16:29:00 +08:00
parent 49a3bd911c
commit d347e62b32
3 changed files with 72 additions and 49 deletions

View File

@ -34,17 +34,24 @@ router.beforeEach((to, from, next) => {
window.document.title = to.meta.title
next()
})
function receiveMessageFromIframePage (event) {
console.log(event.data,event)
console.log(event.data.params,'event.data.params')
console.log(event.data.url,'event.data.url')
function receiveMessageFromIframePage(event) {
console.log(event.data, event)
console.log(event.data.params, 'event.data.params')
console.log(event.data.url, 'event.data.url')
if (event.data.data.includes('办公用地')) {
var id = event.data.params
var url = event.data.url
// router.push({name: 'landChild',params:{id}})
router.push({name:'landChild',params: {id,url}})
router.push({ name: 'landChild', params: { id, url } })
} else if (event.data.data.includes('noparams')) {
router.push({name: 'landChild'})
router.push({ name: 'landChild' })
}
if (event.data.data.includes('建筑工地')) {
var params = event.data.data
var wisUrl = event.data.url
router.push({ name: 'wisdomChild', params: { params, wisUrl } })
} else if (event.data.data.includes('noparams')) {
router.push({ name: 'wisdomChild' })
}
}
window.addEventListener("message", receiveMessageFromIframePage, false);

View File

@ -1,27 +1,22 @@
<template>
<div id="index" ref="appRef">
<!-- <div
<!-- <div
class="bg"
:style="{
backgroundImage:
'url(' + require(`../assets/${backgroundPic.index}.png`) + ')',
}"
>-->
<div
class="bg"
>
<iframe src="/build/sgs.html" ref="iframe" frameborder="0" width="100%" height="100%" style="position: absolute"></iframe>
<div class="bg">
<iframe src="/build/sgs.html" ref="iframe" frameborder="0" width="100%" height="100%"
style="position: absolute"></iframe>
<!-- <div class="body-header"></div> -->
<!-- <div class="body-left"></div>-->
<!-- <div class="body-right"></div>-->
<!-- <div class="body-bottom"></div>-->
<!-- <div class="body-left"></div>-->
<!-- <div class="body-right"></div>-->
<!-- <div class="body-bottom"></div>-->
<dv-loading v-if="loading">Loading...</dv-loading>
<div v-else class="host-body">
<headerIndex
:cdata="{ title: '首页', margin: '40px auto' }"
:isShow="false"
style="position: relative"
/>
<headerIndex :cdata="{ title: '首页', margin: '40px auto' }" :isShow="false" style="position: relative" />
<div class="body-box">
<!-- 第三行数据 -->
@ -120,6 +115,10 @@
<div class="bottom-box">
<!-- <dv-border-box-13> </dv-border-box-13>
<dv-border-box-12> </dv-border-box-12> -->
<div class="baseBlock changeCar" @click='goPage(1)' v-show="isShow">
<img src="../assets/car/car.png" alt="">
<p>停车场1</p>
</div>
</div>
<div class="footer-nav">
<!-- <div class="carChange" v-show="carChangeShow">
@ -136,8 +135,7 @@
</div>
<!-- <div class="baseBlock carAdmin" @mouseover="mouseOver"
@mouseleave="mouseLeave"> -->
<div class="baseBlock carAdmin" @mouseover="mouseOver"
@mouseleave="mouseLeave">
<div class="baseBlock carAdmin" @mouseover="mouseOver" @mouseleave="mouseLeave">
<div class="carChange" v-show="carChangeShow">
<!-- <div class="carChange"> -->
<div class="carMange" @click="goPage(0)">
@ -155,7 +153,7 @@
<p>车辆管理</p>
</div>
<div class="baseBlock fire" @click="goPage(2)">
<!-- <div class="baseBlock fire">-->
<!-- <div class="baseBlock fire">-->
<p>消防安全</p>
</div>
<div class="baseBlock quanjing" @click="goPage(9)">

View File

@ -5,13 +5,15 @@
backgroundImage:
'url(' + require(`../../../assets/${backgroundPic.index}.png`) + ')',
}"> -->
<iframe src="/wisdom/wisdomMap.html" frameborder="0" width="100%" height="100%" style="position: absolute"></iframe>
<!-- <iframe src="/wisdom/wisdomMap.html" frameborder="0" width="100%" height="100%" style="position: absolute"></iframe> -->
<!-- <div class="body-left"></div>
<div class="body-right"></div>
<div class="body-bottom"></div> -->
<iframe :src="buildingUrl" id="ifr" frameborder="0" ref="iframe" width="100%" height="100%"
style="position: absolute"></iframe>
<dv-loading v-if="loading">Loading...</dv-loading>
<div v-else class="host-body" id="wis">
<headerIndex :cdata="{ title: '智慧工地', margin: '26px auto' }" style="position: relative"/>
<headerIndex :cdata="{ title: '智慧工地', margin: '26px auto' }" style="position: relative" />
<div class="main" style="margin-top:-100px">
<div class="left">
<BasicBox title="人员信息概览" :dataSource="false">
@ -146,6 +148,10 @@ export default {
data() {
return {
scenes: '',
gongdi:"GongDi",
buildingUrl: this.$route.params.wisUrl,
// buildingUrl: '/sgs/index.html',
backgroundPic: {
index: "wisdom/bg",
},
@ -195,8 +201,20 @@ export default {
BasicBox,
CustomDvScrollBoard, Chart1
},
created() {
},
mounted() {
let that = this;
this.cancelLoading();
window.OnSceneLoaded = function (scene) {
console.log("scene", scene);
that.scenes = scene
console.log("that.scenes", that.scenes)
window.GotoScene(that.gongdi)
// window.FloorBase('true')
}
},
beforeDestroy() {
clearInterval(this.timing);