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 @@