From e7506728afcab35eded8f4e536f5f66889785226 Mon Sep 17 00:00:00 2001 From: szdot Date: Sun, 22 Jun 2025 20:39:40 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afeat=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=E5=AE=8C=E6=88=90=E9=9B=86=E7=BE=A4=E9=A3=9E=E6=9C=BA?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E4=B8=BB=E9=A1=B5=E9=9D=A2=20=20=E5=92=8C=20?= =?UTF-8?q?=20=E6=8E=A7=E5=88=B6=E7=BB=84=E4=BB=B6=20=E3=80=90=E8=BF=87=20?= =?UTF-8?q?=20=E7=A8=8B=E3=80=91=EF=BC=9A=20=E3=80=90=E5=BD=B1=20=20?= =?UTF-8?q?=E5=93=8D=E3=80=91=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动 --- src/components/ControllerTabs.vue | 4 +- src/components/SwarmControllerTabs.vue | 1087 ++--------------- src/router/index.js | 10 + src/store/modules/app.js | 8 +- src/styles/myIcon.scss | 2 +- .../layout/components/main/home/index.vue | 2 +- .../layout/components/main/planes/index.vue | 33 +- .../layout/components/main/planes/swarm.vue | 278 +++-- .../layout/components/main/register/index.vue | 35 +- src/views/layout/components/menubar.vue | 43 +- 10 files changed, 331 insertions(+), 1171 deletions(-) diff --git a/src/components/ControllerTabs.vue b/src/components/ControllerTabs.vue index 7850db7..f96308e 100644 --- a/src/components/ControllerTabs.vue +++ b/src/components/ControllerTabs.vue @@ -207,12 +207,12 @@
+ @click="confirmation('确认对飞机解锁?请确保飞行环境安全。', '解锁操作', '{unlock:1}'); speakText('解锁飞机')">
解锁
+ @click="confirmation('飞机加锁,螺旋桨将停转,请谨慎操作!', '加锁操作', '{lock:1}'); speakText('加锁飞机,请注意安全')">
加锁
diff --git a/src/components/SwarmControllerTabs.vue b/src/components/SwarmControllerTabs.vue index 7850db7..332a798 100644 --- a/src/components/SwarmControllerTabs.vue +++ b/src/components/SwarmControllerTabs.vue @@ -4,220 +4,43 @@ - @@ -1123,10 +217,10 @@ export default { z-index: 90; position: relative; width: 100%; - border-radius: 10px; max-width: 470px; + border-radius: 10px; background-color: rgba(255, 255, 255, 0.8); - box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2); + box-shadow: 0 0 4px rgba(0, 0, 0, 0.2); top: -50px; opacity: 0; transition: top 0.5s ease, opacity 1s ease; @@ -1147,18 +241,15 @@ export default { .butIconBox { flex-wrap: wrap; - /* 允许换行 */ justify-content: flex-start; - /* 主轴对齐方式 */ align-content: space-around; - /* 多行在侧轴上的对齐方式 */ } .butIcon { border-radius: 10px; text-align: center; border: none; - margin-left: 0px !important; + margin-left: 0 !important; } .taButGroup { @@ -1172,7 +263,7 @@ export default { @media (max-width: 480px) { .taButGroup { - height: calc((100vw - 50px)/4); + height: calc((100vw - 50px) / 4); } .tabContainer { @@ -1186,7 +277,7 @@ export default { border-radius: 10px; padding: 5px; text-align: center; - box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2); + box-shadow: 0 0 4px rgba(0, 0, 0, 0.2); } .taButBG { diff --git a/src/router/index.js b/src/router/index.js index bc1fa7e..5b4c703 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -300,6 +300,16 @@ const routes = [ tapName: 'plane' }, children: [ + { + path: '/planes/swarm', + component: () => import('@/views/layout/components/main/planes/swarm'), + meta: { + title: '集群控制', + icon: 'iconfont icon-a-jiqunkongzhianniu_huaban1', + roles: ['admin', 'editor'], + tapName: 'plane' + } + }, { path: '/planes/index/:id/:name', // 动态加载路由时加ID参数 component: () => import('@/views/layout/components/main/planes/index'), diff --git a/src/store/modules/app.js b/src/store/modules/app.js index 64cbde2..e37aedd 100644 --- a/src/store/modules/app.js +++ b/src/store/modules/app.js @@ -9,7 +9,8 @@ const state = { /* 页面参数 */ orderSerch: null, // 订单列表页搜索条件 toMessageIdArr: [], // 用户管理 发布公告页面 id临时传参 - toFlyDataIdArr: [] // 飞机飞行数据 临时传参 + toFlyDataIdArr: [], // 飞机飞行数据 临时传参 + swarmIdArr: []// 选中的 集群控制飞机ID组 } const mutations = { @@ -64,7 +65,12 @@ const mutations = { // 飞机飞行数据 传递id数组 setToFlyDataIdArr (state, idArr) { state.toFlyDataIdArr = idArr + }, + // 设置 '选取的集群飞机'id组 + setSwarmIdArr (state, idArr) { + state.swarmIdArr = idArr } + } const actions = { diff --git a/src/styles/myIcon.scss b/src/styles/myIcon.scss index 6534b34..6e0cd14 100644 --- a/src/styles/myIcon.scss +++ b/src/styles/myIcon.scss @@ -1 +1 @@ -@import 'https://at.alicdn.com/t/c/font_3703467_793cqnnxv0f.css'; //iconfont阿里巴巴 \ No newline at end of file +@import 'https://at.alicdn.com/t/c/font_3703467_cqwk36imkj.css'; //iconfont阿里巴巴 \ No newline at end of file diff --git a/src/views/layout/components/main/home/index.vue b/src/views/layout/components/main/home/index.vue index 2e0bbce..05d43b8 100644 --- a/src/views/layout/components/main/home/index.vue +++ b/src/views/layout/components/main/home/index.vue @@ -73,7 +73,7 @@ export default { async handler () { try { // 等待地图画布准备好 - await waitForMapCanvasReady(this.map) + await waitForMapCanvasReady(this.$refs.mapbox.map) // 画布准备好后执行你自己的逻辑 this.onMapReady() } catch (err) { diff --git a/src/views/layout/components/main/planes/index.vue b/src/views/layout/components/main/planes/index.vue index fd074ef..c9922ee 100644 --- a/src/views/layout/components/main/planes/index.vue +++ b/src/views/layout/components/main/planes/index.vue @@ -23,15 +23,21 @@ - + 关闭 - 飞至 + + 飞至 + @@ -128,6 +134,25 @@ export default { } this.guidedAlt = height }, + // 单架飞机点飞指令,参数:lon, lat, alt + flyToSinglePlane (lon, lat, alt) { + const lonNum = Number(lon) + const latNum = Number(lat) + const altNum = Number(alt) + + if ( + isNaN(lonNum) || isNaN(latNum) || isNaN(altNum) || + lonNum < -180 || lonNum > 180 || + latNum < -90 || latNum > 90 + ) { + this.$message.warning('请输入有效的经纬度(经度-180~180,纬度-90~90)和高度') + return false + } + + const cmd = `{guidedMode:{lon:${lonNum.toFixed(7)},lat:${latNum.toFixed(7)},alt:${altNum.toFixed(1)}}}` + this.publishFun(cmd) + return true + }, // 地图组件回调地图加载完成后 执行 onMapReady () { this.mapReady = true// 标记地图加载完成 @@ -190,7 +215,7 @@ export default { async handler () { try { // 等待地图画布准备好 - await waitForMapCanvasReady(this.map) + await waitForMapCanvasReady(this.$refs.mapbox.map) // 画布准备好后执行你自己的逻辑 this.onMapReady() } catch (err) { diff --git a/src/views/layout/components/main/planes/swarm.vue b/src/views/layout/components/main/planes/swarm.vue index fd074ef..6873783 100644 --- a/src/views/layout/components/main/planes/swarm.vue +++ b/src/views/layout/components/main/planes/swarm.vue @@ -1,13 +1,12 @@