| | |
| | | <template> |
| | | <div> |
| | | <div class="kb_dashboard"> |
| | | <div |
| | | class="kb_dashboard" |
| | | :style="{transform:'scale('+zoomX+','+zoomY+')',top:topDistance+'px',left:leftDistance+'px'}" |
| | | > |
| | | |
| | | <div class="kb_backgroundCustom" /> |
| | | <div class="kb_header"> |
| | |
| | | |
| | | data() { |
| | | return { |
| | | zoomX: 1, |
| | | zoomY: 1, |
| | | topDistance: 0, |
| | | leftDistance: 0, |
| | | onLine: navigator.onLine, // 监听网络是否在线 |
| | | |
| | | headTime: '', |
| | |
| | | }, 20 * 1000) |
| | | |
| | | this.getEcharts() |
| | | |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('online', this.updateOnlineStatus) |
| | | window.removeEventListener('offline', this.updateOnlineStatus) |
| | | }, |
| | | methods: { |
| | | // 获取页面高度 |
| | | getHeight() { |
| | | this.zoomX = window.innerWidth / 1920 |
| | | this.zoomY = window.innerHeight / 1080 |
| | | this.topDistance = (window.innerHeight - 1080) / 2 |
| | | this.leftDistance = (window.innerWidth - 1920) / 2 |
| | | }, |
| | | // 更新网络状态 |
| | | updateOnlineStatus(e) { |
| | | if (e.isFirst) { |