From f260ee9c8d023c28f6915eb62c4d74d7f05e7d9d Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Fri, 11 Apr 2025 16:18:34 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/assets/images/signMachineNest/machineRight/return-fly.png | 0
/dev/null | 0
src/store/modules/home.js | 3 -
src/views/SignMachineNest/MachineRight/InspectionRaskList.vue | 52 ++++++++++++++++++++++++--
src/assets/images/aiNowFly/close.png | 0
src/views/Home/useMapAggregation/useMapAggregation.js | 2
src/views/SignMachineNest/MachineRight/MachineStatus/MachineStatus.vue | 17 +++++---
src/api/home/index.js | 15 +++++++
src/views/Home/AINowFly.vue | 19 +++++++++
9 files changed, 93 insertions(+), 15 deletions(-)
diff --git a/src/api/home/index.js b/src/api/home/index.js
index da21b03..7712d6e 100644
--- a/src/api/home/index.js
+++ b/src/api/home/index.js
@@ -107,3 +107,18 @@
params: { code },
})
}
+// 立即返航
+export const flyByJobId = jobId => {
+ return request({
+ url: '/drone-device-core/wayline/api/v1/workspaces/flyByJobId?jobId=' + jobId,
+ method: 'get',
+ })
+}
+// 再次执行
+export const returnHome = sn => {
+ return request({
+ url: `/drone-device-core/dp/home/${sn}/drc/returnHome`,
+ method: 'post',
+ })
+}
+
diff --git a/src/assets/images/aiNowFly/close.png b/src/assets/images/aiNowFly/close.png
new file mode 100644
index 0000000..2aae470
--- /dev/null
+++ b/src/assets/images/aiNowFly/close.png
Binary files differ
diff --git a/src/assets/images/signMachineNest/machineRight/return-fly.png b/src/assets/images/signMachineNest/machineRight/return-fly.png
new file mode 100644
index 0000000..df1d3d7
--- /dev/null
+++ b/src/assets/images/signMachineNest/machineRight/return-fly.png
Binary files differ
diff --git a/src/assets/images/signMachineNest/machineRight/return.png b/src/assets/images/signMachineNest/machineRight/return.png
deleted file mode 100644
index 26c15fd..0000000
--- a/src/assets/images/signMachineNest/machineRight/return.png
+++ /dev/null
Binary files differ
diff --git a/src/store/modules/home.js b/src/store/modules/home.js
index d68f039..9deb11b 100644
--- a/src/store/modules/home.js
+++ b/src/store/modules/home.js
@@ -74,8 +74,7 @@
window.localStorage.setItem('bs_osd', JSON.stringify(info))
},
setWsMessage: (state, data) => {
- console.log(data, '看看值')
- state.wsMessage = data.host;
+ state.wsMessage = data.data.host;
},
setDeviceInfo: (state, data) => {
const info = data.data
diff --git a/src/views/Home/AINowFly.vue b/src/views/Home/AINowFly.vue
index 80ab045..835b46f 100644
--- a/src/views/Home/AINowFly.vue
+++ b/src/views/Home/AINowFly.vue
@@ -1,6 +1,6 @@
<template>
<div class="AINowFly">
- <div class="title">指点飞行</div>
+ <div class="title">指点飞行<img @click="closeClick" src="@/assets/images/aiNowFly/close.png"/></div>
<el-form ref="ruleFormRef" :model="params" :rules="rules" label-width="auto" size="small" status-icon>
<el-form-item label="任务名称" prop="name">
<el-input v-model="params.name" />
@@ -233,6 +233,15 @@
handler = null
}
+// 关闭
+const closeClick = () => {
+ removeAll()
+ params.value = _.cloneDeep(paramsInit)
+ list.value = []
+ eventPoint = {}
+ store.commit('setFootActiveIndex', 0)
+}
+
onBeforeUnmount(() => {
removeAll()
})
@@ -265,6 +274,14 @@
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
+ img {
+ position: absolute;
+ cursor: pointer;
+ width: 16px;
+ height: 16px;
+ right: 15px;
+ top: 15px;
+ }
}
.el-form {
padding: 20px 16px 13px 11px;
diff --git a/src/views/Home/useMapAggregation/useMapAggregation.js b/src/views/Home/useMapAggregation/useMapAggregation.js
index 5c01a11..5a5f90c 100644
--- a/src/views/Home/useMapAggregation/useMapAggregation.js
+++ b/src/views/Home/useMapAggregation/useMapAggregation.js
@@ -359,7 +359,7 @@
alphaPower: 1.3
})
- const randomInt = Math.floor(Math.random() * 5) + 1
+ const randomInt = Math.floor(Math.random() * 8) + 1
entity.polygon.extrudedHeight = (entity.properties.childrenNum._value || randomInt) * 500
diff --git a/src/views/SignMachineNest/MachineRight/InspectionRaskList.vue b/src/views/SignMachineNest/MachineRight/InspectionRaskList.vue
index def807b..2c44b48 100644
--- a/src/views/SignMachineNest/MachineRight/InspectionRaskList.vue
+++ b/src/views/SignMachineNest/MachineRight/InspectionRaskList.vue
@@ -34,8 +34,13 @@
<img src="../../../assets/images/signMachineNest/machineRight/name.png" alt="" />{{ item.creator_name || '' }}
</div>
</div>
- <div class="right">
- <img src="../../../assets/images/signMachineNest/machineRight/return.png" alt="">
+ <div class="right" v-if="tabIndex===1" @click="returnImmediately(item.id)">
+ <span>立即返航</span>
+ <img src="../../../assets/images/signMachineNest/machineRight/return-fly.png" alt="">
+ </div>
+ <div class="right" v-else @click="reExecute(item.dock_sn)">
+ <span>再次执行</span>
+ <img src="../../../assets/images/signMachineNest/machineRight/return-fly.png" alt="">
</div>
</div>
</div>
@@ -51,7 +56,12 @@
<script setup>
import { Search } from '@element-plus/icons-vue';
import CommonTitle from '@/components/CommonTitle.vue';
-import { getBeforeJob, getTodayJob } from '@/api/home'
+import { getBeforeJob, getTodayJob, flyByJobId, returnHome } from '@/api/home';
+import { useStore } from 'vuex';
+
+const store = useStore();
+// 单个机巢信息
+const singleUavHome = computed(() => store.state.home.singleUavHome);
const isMore = ref(true);
// 控制加载状态
@@ -96,7 +106,7 @@
const getJobList = async () => {
const params = {
area_code: '',
- device_sn: '',
+ device_sn: singleUavHome.value.device_sn,
job_name: searchText.value,
current: pageParams.value.current,
size: pageParams.value.size,
@@ -132,6 +142,27 @@
// 搜索数据
const searchNickName = () => {
clearData();
+};
+
+// 立即返航
+const returnImmediately = (id) => {
+ flyByJobId(id).then(result => {
+ if (result.data.code === 0) {
+ ElMessage.success('返航成功');
+ } else {
+ ElMessage.error(result.data.message);
+ }
+ });
+};
+// 重新执行
+const reExecute = (dock_sn) => {
+ returnHome(dock_sn).then(result => {
+ if (result.data.code === 0) {
+ ElMessage.success('执行成功');
+ } else {
+ ElMessage.error(result.data.message);
+ }
+ });
};
onMounted(() => {
@@ -256,6 +287,19 @@
}
}
.right {
+ cursor: pointer;
+ position: relative;
+ span {
+ position: absolute;
+ display: inline-block;
+ top: 12px;
+ left: 12px;
+ width: 26px;
+ line-height: 12px;
+ font-size: 12px;
+ font-family: YouSheBiaoTiHei, YouSheBiaoTiHei, serif;
+ color: rgb(4,18,44)
+ }
img {
width: 46px;
height: 46px
diff --git a/src/views/SignMachineNest/MachineRight/MachineStatus/MachineStatus.vue b/src/views/SignMachineNest/MachineRight/MachineStatus/MachineStatus.vue
index 00dd6b4..499504b 100644
--- a/src/views/SignMachineNest/MachineRight/MachineStatus/MachineStatus.vue
+++ b/src/views/SignMachineNest/MachineRight/MachineStatus/MachineStatus.vue
@@ -13,7 +13,7 @@
</div>
<div class="close-wb">
<div class="close">{{ AircraftStatus ? AircraftStatus : '舱内关机' }}</div>
- <div class="wb">需要维保</div>
+ <!-- <div class="wb">需要维保</div> -->
</div>
</div>
</div>
@@ -136,13 +136,16 @@
let mode_code = ref('已断开连接');
// 监听实时信息
-watch(store.state.home.wsMessage, (newValue) => {
- // if (newValue || newValue.mode_code === 14) return
- // if (Object.keys(newValue).length === 0) return
- console.log(newValue,'咋没数据呀');
- detailInfo.value.longitudee = newValue?.longitude.toFixed(6) || '--';
+watch(
+ () => store.state.home.wsMessage,
+ (newValue) => {
+ if (newValue.mode_code === 14) return
+ if (Object.keys(newValue).length === 0) return
+ // console.log(newValue, '顶顶顶111')
+ detailInfo.value.longitude = newValue?.longitude.toFixed(6) || '--';
detailInfo.value.latitude = newValue?.latitude.toFixed(6) || '--';
- getLnglatAltitude(newValue?.longitude,newValue?.latitude).then((res) => {
+ getLnglatAltitude(Number(detailInfo.value.longitude), Number(detailInfo.value.latitude)).then((res) => {
+ console.log(res, '顶顶顶')
const height = newValue?.height - res?.height;
//针对西安实时高度进行降低
const wId = localStorage.getItem('bs_workspace_id');
--
Gitblit v1.9.3