From 5d413dba8c6a4187fcaaae79948acd7612aa0b07 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Thu, 23 Jul 2020 19:25:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AE=A2=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/mapsystemNew/index.vue | 60 ++++++++++++------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/src/views/newMap/mapsystemNew/index.vue b/src/views/newMap/mapsystemNew/index.vue index b82e1ed58..223f228dd 100644 --- a/src/views/newMap/mapsystemNew/index.vue +++ b/src/views/newMap/mapsystemNew/index.vue @@ -20,36 +20,34 @@ export default { return { topic: '/user/queue/training', stomp: null, - currentMap: null, - ierval: null, - checkLine: null, - mouseNum: 1, - mouseNumTime: 0, - mapBoxP: null, + currentMap: null, + ierval: null, + checkLine: null, + mouseNum: 1, + mouseNumTime: 0, + mapBoxP: null, mode: '', group: '' }; - }, - computed: { - ...mapGetters('config', [ + }, + computed: { + ...mapGetters('config', [ 'canvasId' - ]), - }, + ]) + }, watch: { - '$store.state.map.mapViewLoadedCount': function (val) { - this.subscribe(); - }, '$store.state.socket.equipmentStatus': function (val) { if (val.length) { this.statusMessage(val); } - }, - '$store.state.map.mousemove': function (val) { + }, + '$store.state.map.mousemove': function (val) { this.mousemove(); - }, - '$store.state.map.mapViewLoadedCount': function (val) { // 地图视图加载完成标识 开始加载默认状态 - this.mapBoxP = document.getElementById(this.canvasId).children[0]; + }, + '$store.state.map.mapViewLoadedCount': function (val) { // 地图视图加载完成标识 开始加载默认状态 + this.mapBoxP = document.getElementById(this.canvasId).children[0]; this.mapBoxP.style.cursor = ''; + this.subscribe(); }, '$store.state.socket.trainStationList': function (val) { if (val.length) { @@ -66,9 +64,9 @@ export default { window.onbeforeunload = this.clearSubscribe; this.mode = this.$route.params.mode || ''; this.group = this.$route.query.group || ''; - this.currentMap = this.$refs.mapCommon; - this.checkLoginLineTimer(); // 心跳发送 - this.checkMouseStatusTimer(); // 鼠标样式变化检测 + this.currentMap = this.$refs.mapCommon; + this.checkLoginLineTimer(); // 心跳发送 + this.checkMouseStatusTimer(); // 鼠标样式变化检测 this.$nextTick(() => { setTimeout(() => { this.$store.dispatch('config/resetCanvasOffset'); @@ -76,8 +74,8 @@ export default { }); }, beforeDestroy() { - this.clearSubscribe(); - this.clearAllTimer(); + this.clearSubscribe(); + this.clearAllTimer(); }, methods: { async mapViewLoaded(loading) { @@ -117,11 +115,11 @@ export default { }, setCenter(code) { this.$refs.mapCommon && this.$refs.mapCommon.setCenter(code); - }, - mousemove() { + }, + mousemove() { this.mouseNum = 1; }, - // 清除检查在线定时器 + // 清除检查在线定时器 clearAllTimer() { if (this.ierval) { clearTimeout(this.ierval); @@ -131,7 +129,7 @@ export default { clearTimeout(this.checkLine); this.checkLine = null; } - }, + }, // 设置检查在线定时器 checkLoginLineTimer() { if (this.checkLine) { @@ -141,7 +139,7 @@ export default { checkLoginLine(); }, 5000 * 60); }, - // 设置手标显示状态 + // 设置手标显示状态 checkMouseStatusTimer() { if (this.ierval) { clearInterval(this.ierval); @@ -158,11 +156,11 @@ export default { } if (this.mapBoxP) { if (this.mouseNumTime >= 12) { - this.mapBoxP.style.cursor = 'none'; + this.mapBoxP.style.cursor = 'none'; } } }, 1000); - }, + } } };