From 644a222430a53c54748ef8f341e00c3fef02308b Mon Sep 17 00:00:00 2001 From: fengsen <2548667232@qq.com> Date: Wed, 10 Sep 2025 10:03:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=BF=9E=E6=8E=A5ws?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +++- .../ProjectScreen/components/newmap.vue | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.env.development b/.env.development index 038e52d..8b07eb7 100644 --- a/.env.development +++ b/.env.development @@ -18,8 +18,10 @@ VITE_APP_BASE_API = 'http://192.168.110.180:8899' #曾涛 # VITE_APP_BASE_API = 'http://192.168.110.171:8899' -# 无人机接口地址 +# ws +VITE_APP_BASE_WS_API = 'ws://192.168.110.149:8899/resource/websocket' +# 无人机接口地址 VITE_APP_BASE_DRONE_API = 'http://58.17.134.85:9512' # 应用访问路径 例如使用前缀 /admin/ diff --git a/src/views/projectLarge/ProjectScreen/components/newmap.vue b/src/views/projectLarge/ProjectScreen/components/newmap.vue index f2b541d..60975ee 100644 --- a/src/views/projectLarge/ProjectScreen/components/newmap.vue +++ b/src/views/projectLarge/ProjectScreen/components/newmap.vue @@ -4,11 +4,24 @@ import CesiumImageLabelEntity from '../js/CesiumImageLabelEntity.js'; import CesiumFlyToRoamingController from '../js/CesiumFlyToRoamingController.js'; import { setSelect, getSelectList, getGps } from '@/api/projectScreen/index.ts' import videoDialog from "./video.vue" +import { getToken } from '@/utils/auth'; const defaultExpandedKeys = [1, 2, 3] //默认展开第一级节点 const defaultCheckedKeys = ref([]) //默认选中节点 const data = ref([]); const deviceId = ref(''); const videoDialogRef = ref(null); +let token = 'Bearer '+ getToken() +let ws = new ReconnectingWebSocket( import.meta.env.VITE_APP_BASE_WS_API + '?Authorization='+token+'&clientid='+import.meta.env.VITE_APP_CLIENT_ID); +// 连接ws +const connectWs = () => { + ws.onopen = (e) => { + console.log('this.gateWay', e); + // ws.send(JSON.stringify(message)); + ws.onmessage = (e) => { + console.log('ws', e); + }; + }; +} const props = defineProps({ isHide:{ type:Boolean, @@ -214,6 +227,8 @@ function stopRoaming() { } } onMounted(() => { + // 连接ws + connectWs(); // 获取选中节点 getCheckedNode(); // 获取GPS数据 From c6f38a95937a2a0332cdcb4a7415ec75ae979bc7 Mon Sep 17 00:00:00 2001 From: fengsen <2548667232@qq.com> Date: Wed, 10 Sep 2025 19:22:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=89=93=E5=8D=A1=E8=8C=83=E5=9B=B4?= =?UTF-8?q?=E3=80=81=E9=A1=B9=E7=9B=AE=E7=BA=A7=E9=A1=B5=E9=9D=A2=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/views/gis2D/index.vue | 11 +- src/views/gis2D/index2.vue | 628 ++++++++++++++++++ src/views/project/project/index.vue | 3 +- .../ProjectScreen/components/newmap.vue | 6 +- 5 files changed, 644 insertions(+), 6 deletions(-) create mode 100644 src/views/gis2D/index2.vue diff --git a/.env.development b/.env.development index 7b0adc1..8b07eb7 100644 --- a/.env.development +++ b/.env.development @@ -10,7 +10,7 @@ VITE_APP_ENV = 'development' # 李陈杰 209 # VITE_APP_BASE_API = 'http://192.168.110.209:8899' # 曾涛 -VITE_APP_BASE_API = 'http://192.168.110.209:8899' +VITE_APP_BASE_API = 'http://192.168.110.180:8899' # 罗成 # VITE_APP_BASE_API = 'http://192.168.110.188:8899' # 朱银 diff --git a/src/views/gis2D/index.vue b/src/views/gis2D/index.vue index e8b9f35..2b832f0 100644 --- a/src/views/gis2D/index.vue +++ b/src/views/gis2D/index.vue @@ -1,7 +1,7 @@