src/views/WorkshopSignage.vue
@@ -145,8 +145,7 @@
            value: 22,
            color: '#FF0000'
          }
        ],// 设备状态指示灯列表,
        isFullscreen: false
        ]// 设备状态指示灯列表,
      }
    },
    watch: {
@@ -190,15 +189,7 @@
          this.$refs.deviceContainerRef.style.backgroundImage = `url(${this.getImgView(
            this.workshopDetails.backgroundImage
          )})`
          this.fullScreenPageHeight = `calc(100% - ${this.pageHeaderHeight}px)`
          this.normalPageHeight = `calc(100% - ${this.pageHeaderHeight}px - ${this.taskBarHeight}px - ${this.utilsBarHeight}px)`
          if (this.isFullscreen) {
            this.$refs.deviceContainerRef.style.height = this.fullScreenPageHeight
          } else {
            this.$refs.deviceContainerRef.style.height = this.normalPageHeight
          }
          this.$refs.deviceContainerRef.style.height = this.normalPageHeight
        })
      },
@@ -297,56 +288,15 @@
          //   setTimeout( this.$refs.equmentDetaiModel.initData(item.equipmentId),0)
          // },1000*10)
        }
      },
      onResize() {
        // 利用屏幕分辨率和window对象的内高度来判断兼容IE
        let winFlag = window.innerHeight === window.screen.height
        // 利用window全屏标识来判断 -- IE无效
        let isFull = window.fullScreen || document.webkitIsFullScreen
        if (isFull === undefined) {
          this.isFullscreen = winFlag
        } else {
          this.isFullscreen = winFlag || isFull
        }
        console.log(winFlag)  // true全屏   false不是全屏
        console.log('任务栏高度', this.taskBarHeight)
        console.log('工具栏高度', this.utilsBarHeight)
        //全屏则图纸盒子可视高度减去页头高度,正常窗口则减去页头、屏幕底部任务栏以及浏览器工具栏高度
        if (winFlag) {
          console.log('触发全屏')
          this.$refs.deviceContainerRef.style.height = this.fullScreenPageHeight
        } else {
          console.log('关闭全屏')
          // 如果刷新页面重新加载后默认处于全屏模式,则工具栏高度为负数,因此需要退出全屏模式时重置工具栏高度
          this.utilsBarHeight = window.outerHeight - window.innerHeight
          this.normalPageHeight = `calc(100% - ${this.pageHeaderHeight}px - ${this.taskBarHeight}px - ${this.utilsBarHeight}px)`
          this.$refs.deviceContainerRef.style.height = this.normalPageHeight
        }
      }
    },
    created() {
      if (this.utilsBarHeight > 0) this.normalPageHeight = `calc(100% - ${this.pageHeaderHeight}px - ${this.taskBarHeight}px - ${this.utilsBarHeight}px)`
      else this.normalPageHeight = `calc(100% - ${this.pageHeaderHeight}px - ${this.taskBarHeight}px - 87px)`
      if (this.$route.params.id) {
        this.getDeviceListByApi(this.$route.params.id)
        this.getWorkshopDetailsByApi(this.$route.params.id)
      }
      let winFlag = window.innerHeight === window.screen.height
      // 利用window全屏标识来判断 -- IE无效
      let isFull = window.fullScreen || document.webkitIsFullScreen
      if (isFull === undefined) {
        this.isFullscreen = winFlag
      } else {
        this.isFullscreen = winFlag || isFull
      }
      // window.addEventListener('resize', this.onResize)
    },
    mounted() {
      // 禁止用户选中内容
@@ -356,7 +306,6 @@
      // 确保销毁定时器、事件及回收资源
      clearInterval(this.timingAcquisition)
      this.timingAcquisition = null
      // window.removeEventListener('resize', this.onResize)
    }
  }
</script>