【前端】智能库房综合管理系统前端项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
1.8 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div class="app-container warehouse">
  3. <!-- <h1>全景图</h1> -->
  4. <div class="warehouse-left">
  5. <div class="left-3d">
  6. <iframe
  7. id="myIframe"
  8. ref="myIframe"
  9. name="iframeMap"
  10. class="iframe_box"
  11. src="/webC/index.html"
  12. frameborder="0"
  13. scrolling="no"
  14. />
  15. </div>
  16. </div>
  17. <warehouse-warning :height="'calc(100vh - 235px)'" />
  18. </div>
  19. </template>
  20. <script>
  21. import WarehouseWarning from '@/views/components/WarehouseWarning'
  22. export default {
  23. name: 'ReadRoom',
  24. components: { WarehouseWarning },
  25. data() {
  26. return {
  27. tableData: []
  28. }
  29. },
  30. mounted() {
  31. const _this = this
  32. this.iframeWin = this.$refs.myIframe.contentWindow
  33. // inframe 加载完成之后
  34. document.getElementById('myIframe').onload = function() {
  35. _this.deviceState()
  36. }
  37. // window.addEventListener('message', this.handleMessageDevice)
  38. },
  39. methods: {
  40. // 传入设备状态data / 给iframe传初始值
  41. deviceState(e) {
  42. this.iframeWin.postMessage({
  43. data: [
  44. {
  45. id: 'YLS_MO_OAO_001',
  46. wendu: 3,
  47. sidu: 6,
  48. alarmState: false
  49. }
  50. ]
  51. }, '*')
  52. }
  53. // 点击查看设备状况
  54. // handleMessageDevice(event) {
  55. // const _this = this
  56. // if (event.data && event.data.data) {
  57. // const data = event.data.data
  58. // _this.deviceId = data
  59. // }
  60. // },
  61. }
  62. }
  63. </script>
  64. <style lang="scss" scoped>
  65. @import '~@/assets/styles/lend-manage.scss';
  66. .warehouse-left{
  67. position: relative;
  68. h2{
  69. position: absolute;
  70. left: 50%;
  71. top: 0;
  72. transform: translateX(-50%);
  73. color: #fff;
  74. font-size: 16px;
  75. }
  76. }
  77. </style>