From 433d25cc375f679ebace4ec832aa4ffb7e857b4b Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Sat, 19 Apr 2025 22:18:35 +0800
Subject: [PATCH] feat: 事件跳转后台
---
src/components/CurrentTaskDetails/ControlPanel/ControlPanel.vue | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/components/CurrentTaskDetails/ControlPanel/ControlPanel.vue b/src/components/CurrentTaskDetails/ControlPanel/ControlPanel.vue
index d3a3604..6873e0a 100644
--- a/src/components/CurrentTaskDetails/ControlPanel/ControlPanel.vue
+++ b/src/components/CurrentTaskDetails/ControlPanel/ControlPanel.vue
@@ -34,7 +34,7 @@
</div>
<div class="speed">
- <el-icon class="btnIcon" @click="speed = speed + 1">
+ <el-icon class="btnIcon" @click="speed = speed === 15 ? 15 : speed + 1">
<Plus />
</el-icon>
<div>
@@ -42,7 +42,7 @@
<br />
m/s
</div>
- <el-icon class="btnIcon" @click="speed = speed - 1">
+ <el-icon class="btnIcon" @click="speed = speed === 0 ? 0 : speed - 1">
<Minus />
</el-icon>
</div>
@@ -181,7 +181,7 @@
let timer = null
let totalSeconds = 0
-const workspace_id = computed(() => taskDetails?.value?.workspace_id)
+const workspace_id = inject('workspace_id')
const list1 = [
{ key: KeyCode.KEY_Q, text: 'Q', icon: RefreshLeft },
{ key: KeyCode.KEY_W, text: 'W', icon: ArrowUp },
@@ -324,9 +324,10 @@
function cancelControl() {
exitController({ client_id: client_id.value, dock_sn: dockSn.value })
.then(res => {
- flightController.value = false
deviceTopicInfo.value.subTopic = ''
deviceTopicInfo.value.pubTopic = ''
+ flightController.value = false
+ isAutoControl.value = true
ElMessage.success('退出飞行控制成功')
})
.catch(e => {})
@@ -365,6 +366,7 @@
await returnHome(dockSn?.value)
ElMessage.success('返航操作成功')
isBackDock.value = true
+ isAutoControl.value = true
}
// 取消返航
@@ -372,6 +374,7 @@
await returnHomeCancel({ dock_sn: dockSn?.value, client_id: client_id.value })
ElMessage.success('取消返航成功')
isBackDock.value = false
+ isAutoControl.value = false
}
// 创建mqtt连接
@@ -406,8 +409,7 @@
speed: speed.value,
}))
-watch(
- () => workspace_id.value,
+watch(workspace_id,
async () => {
if (workspace_id.value && mqttState === null && client_id.value === '') {
await createConnect()
@@ -465,7 +467,7 @@
right: 0;
width: 1400px;
height: 217px;
- background: linear-gradient(196deg, rgba(23, 23, 23, 0.11) 0%, rgba(6, 6, 6, 0.11) 100%);
+ background: rgba(31, 31, 31, 0.15);
backdrop-filter: blur(5px);
border-radius: 40px 0px 40px 40px;
display: flex;
@@ -519,10 +521,11 @@
box-shadow: 2px 4px 6px 0px rgba(0, 13, 26, 0.42);
border-radius: 8px 8px 8px 8px;
text-align: center;
- padding: 5px 0;
+ padding: 10px 0;
.btnIcon {
font-size: 20px;
+ cursor: pointer;
}
}
}
@@ -631,7 +634,7 @@
.divider {
position: absolute;
- transform: translateX(90px);
+ transform: translateX(95px);
width: 0;
height: 137px;
border: 1px solid rgba(255, 255, 255, 0.07);
--
Gitblit v1.9.3