From 516b1c21641fd625ce1faeca33925199c6ed810f Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Tue, 17 Dec 2024 16:32:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E4=BA=8B=E4=BB=B6=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/Home/components/HomeFilter/index.vue | 12 ++++++++---- ruoyi-ui/src/views/websocket.vue | 6 ++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFilter/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFilter/index.vue index 7c716191..cbd88445 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFilter/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/HomeFilter/index.vue @@ -133,12 +133,12 @@ export default { }, async handleResetForm() { if(this.isButtonClick){return} - + this.isButtonClick = true; setTimeout(() => { this.isButtonClick = false; }, 500); - + this.$refs.FormConfigRef?.reset(); this.activeIcon = "filter"; this.filterEnd(initSearch); @@ -152,14 +152,14 @@ export default { data.startStakeMark[0] = data.startStakeMark[0].padStart(3,'0') data.startStakeMark[1] = data.startStakeMark[1].padStart(3,'0') } - + if (!data.endStakeMark[0] || !data.endStakeMark[1]){ delete data.endStakeMark; } else { data.endStakeMark[0] = data.endStakeMark[0].padStart(3,'0') data.endStakeMark[1] = data.endStakeMark[1].padStart(3,'0') } - + this.activeIcon = null; this.filterEnd(data); }, @@ -178,6 +178,10 @@ export default { async created() { // await this.getDeviceTypeOptions(); }, + mounted() { + //添加全局事件监听 + this.$root.$on('refreshMap', this.handleSearch); + }, }; diff --git a/ruoyi-ui/src/views/websocket.vue b/ruoyi-ui/src/views/websocket.vue index 067265e5..c442f3a9 100644 --- a/ruoyi-ui/src/views/websocket.vue +++ b/ruoyi-ui/src/views/websocket.vue @@ -32,6 +32,7 @@ export default { this.socket.initialize({ // url: 'ws://' + location.hostname + ':' + port + path, url: 'wss://' + location.hostname + ':' + window.location.port + '/ws' || 80 + '/ws', + // url: 'wss://10.0.111.11:90/ws', // url: "ws://10.168.66.196:7789" + path, // url: 'ws://10.168.77.128:7789/ws', // url: "ws://10.7.179.15" + ":" + port + path, @@ -105,6 +106,9 @@ export default { }); break; case "0": + this.$emit("newEvent", params); + this.$root.$emit('refreshMap'); + break; case "3": case "externalPlatformOffline": case "trafficFlowDataEarlyWarning": @@ -112,6 +116,7 @@ export default { break; case "2": this.triggerAlert() + this.$root.$emit('refreshMap'); setTimeout(() => { this.$emit("newEvent", params); }, 1000); // 1000 毫秒 = 1 秒 @@ -125,6 +130,7 @@ export default { }else{ this.$emit("newEvent", params); } + this.$root.$emit('refreshMap'); break; case "deviceState": this.EventBus.$emit("deviceState", contentList);