|
|
@ -3,15 +3,7 @@ |
|
|
|
<!-- <h1>全景图</h1> --> |
|
|
|
<div class="warehouse-left"> |
|
|
|
<div class="left-3d"> |
|
|
|
<iframe |
|
|
|
id="myIframe" |
|
|
|
ref="myIframe" |
|
|
|
name="iframeMap" |
|
|
|
class="iframe_box" |
|
|
|
src="/webC/index.html" |
|
|
|
frameborder="0" |
|
|
|
scrolling="no" |
|
|
|
/> |
|
|
|
<iframe id="myIframe" ref="myIframe" name="iframeMap" class="iframe_box" src="/webC/index.html" frameborder="0" scrolling="no" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<warehouse-warning :height="'calc(100vh - 235px)'" /> |
|
|
@ -20,32 +12,54 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import WarehouseWarning from '@/views/components/WarehouseWarning' |
|
|
|
import storeroomApi from '@/api/storeManage/deviceManage/storeroom' |
|
|
|
import displayConfigApi from '@/api/storeManage/displayConfig' |
|
|
|
export default { |
|
|
|
name: 'ReadRoom', |
|
|
|
components: { WarehouseWarning }, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
tableData: [] |
|
|
|
tableData: [], |
|
|
|
roomId: '', |
|
|
|
displayConfigData: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
async created() { |
|
|
|
window.getIframeLoading = this.getIframeLoading // 把vue实例中的方法引用给window对象 |
|
|
|
const roomsData = await storeroomApi.getRooms() |
|
|
|
this.roomId = roomsData[0].children.find((x) => { return x.name === '阅览室' }).id |
|
|
|
if (this.roomId) { |
|
|
|
this.displayConfigData = await displayConfigApi.list({ storeroomId: this.roomId }) |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
const _this = this |
|
|
|
// const _this = this |
|
|
|
this.iframeWin = this.$refs.myIframe.contentWindow |
|
|
|
// inframe 加载完成之后 |
|
|
|
document.getElementById('myIframe').onload = function() { |
|
|
|
_this.deviceState() |
|
|
|
} |
|
|
|
// document.getElementById('myIframe').onload = function() { |
|
|
|
// _this.deviceState() |
|
|
|
// } |
|
|
|
// window.addEventListener('message', this.handleMessageDevice) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 加载完成状态传值 |
|
|
|
getIframeLoading(value) { |
|
|
|
// console.log(`我是iframe传过来的参数:${value}`) |
|
|
|
// if (value === 'false') { |
|
|
|
// this.handleHide(element.divPosition) |
|
|
|
// } |
|
|
|
// this.deviceState() |
|
|
|
if (value === 'false') { |
|
|
|
this.handleHide('YLS_MO_OAO_001') |
|
|
|
console.log(this.displayConfigData) |
|
|
|
this.displayConfigData.forEach(element => { |
|
|
|
if (element.divPosition.includes('OAO')) { |
|
|
|
if (element.isDisplay) { |
|
|
|
console.log(element.divPosition) |
|
|
|
} else { |
|
|
|
this.handleHide(element.divPosition) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 传入设备状态data / 给iframe传初始值 |
|
|
@ -78,16 +92,16 @@ export default { |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
@import '~@/assets/styles/lend-manage.scss'; |
|
|
|
.warehouse-left{ |
|
|
|
position: relative; |
|
|
|
h2{ |
|
|
|
position: absolute; |
|
|
|
left: 50%; |
|
|
|
top: 0; |
|
|
|
transform: translateX(-50%); |
|
|
|
color: #fff; |
|
|
|
font-size: 16px; |
|
|
|
} |
|
|
|
@import "~@/assets/styles/lend-manage.scss"; |
|
|
|
.warehouse-left { |
|
|
|
position: relative; |
|
|
|
h2 { |
|
|
|
position: absolute; |
|
|
|
left: 50%; |
|
|
|
top: 0; |
|
|
|
transform: translateX(-50%); |
|
|
|
color: #fff; |
|
|
|
font-size: 16px; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |