取消鼠标悬浮消失

This commit is contained in:
fan 2022-07-22 18:04:12 +08:00
parent 2c6807debf
commit fdb071c9f6

View File

@ -23,9 +23,9 @@ export default {
topic: '/user/queue/training', topic: '/user/queue/training',
stomp: null, stomp: null,
currentMap: null, currentMap: null,
ierval: null, // ierval: null,
mouseNum: 1, mouseNum: 1,
mouseNumTime: 0, // mouseNumTime: 0,
mapBoxP: null, mapBoxP: null,
mode: '', mode: '',
groupModel: '' groupModel: ''
@ -78,7 +78,7 @@ export default {
this.mode = this.$route.params.mode || ''; this.mode = this.$route.params.mode || '';
this.currentMap = this.$refs.mapCommon; this.currentMap = this.$refs.mapCommon;
this.groupModel = this.$route.query.group; this.groupModel = this.$route.query.group;
this.checkMouseStatusTimer(); // // this.checkMouseStatusTimer(); //
this.$nextTick(() => { this.$nextTick(() => {
setTimeout(() => { setTimeout(() => {
this.$store.dispatch('config/resetCanvasOffset'); this.$store.dispatch('config/resetCanvasOffset');
@ -88,7 +88,7 @@ export default {
beforeDestroy() { beforeDestroy() {
this.clearSubscribe(); this.clearSubscribe();
this.clearSubscribeNew(); this.clearSubscribeNew();
this.clearAllTimer(); // this.clearAllTimer();
}, },
methods: { methods: {
async mapViewLoaded(loading) { async mapViewLoaded(loading) {
@ -161,33 +161,33 @@ export default {
this.mouseNum = 1; this.mouseNum = 1;
}, },
// 线 // 线
clearAllTimer() { // clearAllTimer() {
if (this.ierval) { // if (this.ierval) {
clearInterval(this.ierval); // clearInterval(this.ierval);
this.ierval = null; // this.ierval = null;
} // }
}, // },
// //
checkMouseStatusTimer() { checkMouseStatusTimer() {
if (this.ierval) { // if (this.ierval) {
clearInterval(this.ierval); // clearInterval(this.ierval);
} // }
this.ierval = setInterval(() => { // this.ierval = setInterval(() => {
if (this.mouseNum) { // if (this.mouseNum) {
this.mouseNum = 0; // this.mouseNum = 0;
this.mouseNumTime = 0; // this.mouseNumTime = 0;
if (this.mapBoxP) { // if (this.mapBoxP) {
this.mapBoxP.style.cursor = this.mapBoxP.style.cursor != 'none' ? this.mapBoxP.style.cursor : ''; // this.mapBoxP.style.cursor = this.mapBoxP.style.cursor != 'none' ? this.mapBoxP.style.cursor : '';
} // }
} else { // } else {
this.mouseNumTime += 1; // this.mouseNumTime += 1;
} // }
if (this.mapBoxP) { // if (this.mapBoxP) {
if (this.mouseNumTime >= 12) { // if (this.mouseNumTime >= 12) {
this.mapBoxP.style.cursor = 'none'; // this.mapBoxP.style.cursor = 'none';
} // }
} // }
}, 1000); // }, 1000);
}, },
initMemberUserInfo(isFirst = false) { initMemberUserInfo(isFirst = false) {
if (this.$route.query.newApi + '' === 'true') { if (this.$route.query.newApi + '' === 'true') {