Commit 4f8d0409 authored by 张伯涛's avatar 张伯涛

时间轴 注释

parent 067509eb
...@@ -50,6 +50,7 @@ export default { ...@@ -50,6 +50,7 @@ export default {
}; };
}, },
mounted() { mounted() {
document.addEventListener('visibilitychange', this.handleVisibilityChange);
document.title = "AR车间"; document.title = "AR车间";
console.log("----state----", this.$store.state, document.title); console.log("----state----", this.$store.state, document.title);
this.ip = window.location.hostname; this.ip = window.location.hostname;
...@@ -61,6 +62,9 @@ export default { ...@@ -61,6 +62,9 @@ export default {
} }
this.getClientInfo(); this.getClientInfo();
}, },
unmounted() {
document.removeEventListener('visibilitychange', this.handleVisibilityChange);
},
beforeDestroy() { beforeDestroy() {
if (this.control) { if (this.control) {
this.control.setWindowStatus(0); this.control.setWindowStatus(0);
...@@ -74,6 +78,27 @@ export default { ...@@ -74,6 +78,27 @@ export default {
next(); next();
}, },
methods: { methods: {
handleVisibilityChange() {
if (document.hidden) {
console.log('隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏隐藏')
if (this.control) {
this.control.setWindowStatus(2);
this.control = null;
}
} else {
console.log('显示显示显示显示显示显示显示显示显示显示显示')
document.title = "AR车间";
console.log("----state----", this.$store.state, document.title);
this.ip = window.location.hostname;
this.protocolType = window.location.protocol.replace(':', '')
if (window.location.port) {
this.port = window.location.port;
} else {
this.port = this.protocolType === "https" ? "443" : "80";
}
this.getClientInfo();
}
},
init() { init() {
// 初始化 // 初始化
if (this.control) { if (this.control) {
...@@ -86,9 +111,9 @@ export default { ...@@ -86,9 +111,9 @@ export default {
const userName = this.raData.username; const userName = this.raData.username;
const loginKey = this.raData.tgc; const loginKey = this.raData.tgc;
const left = '10'; const left = '10';
const top = '100'; const top = '150';
const width = '1900'; const width = '1900';
const height = '953'; const height = '850';
// const protocolType = this.protocolType // const protocolType = this.protocolType
const protocolType = 'https' const protocolType = 'https'
const domainId = 103 const domainId = 103
......
...@@ -622,10 +622,10 @@ import store from "@/store/index.js"; ...@@ -622,10 +622,10 @@ import store from "@/store/index.js";
canRun = false canRun = false
setTimeout(function() { setTimeout(function() {
var _this$_getDomPosition2 = _this._getDomPosition(), var _this$_getDomPosition2 = _this._getDomPosition(),
left = '103', left = _this$_getDomPosition2.left,
top = '103', top = _this$_getDomPosition2.top,
width = '1919', width = _this$_getDomPosition2.width,
height = '937' height = _this$_getDomPosition2.height
_this.setPosition(left, top, width, height) _this.setPosition(left, top, width, height)
...@@ -738,10 +738,10 @@ import store from "@/store/index.js"; ...@@ -738,10 +738,10 @@ import store from "@/store/index.js";
this.timer = setInterval(function() { this.timer = setInterval(function() {
var _this$_getDomPosition3 = _this._getDomPosition(), var _this$_getDomPosition3 = _this._getDomPosition(),
left = '103', left = _this$_getDomPosition3.left,
top = '103', top = _this$_getDomPosition3.top,
width = '1919', width = _this$_getDomPosition3.width,
height = '937' height = _this$_getDomPosition3.height
if ( if (
_this.lastPosition.x != left || _this.lastPosition.x != left ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment