|
|
|
@ -73,10 +73,13 @@
|
|
|
|
|
@changeCameraType="changeCameraType"
|
|
|
|
|
/>
|
|
|
|
|
<div class="intelligent-patrol" v-if="taskId">
|
|
|
|
|
<div @click="patrolClick">
|
|
|
|
|
<div @click="stopPatrolClick" v-if="stopPatrolVisible">
|
|
|
|
|
<span> <RadarChartOutlined /> </span>
|
|
|
|
|
<span v-if="stopPatrolVisible">停止巡检</span>
|
|
|
|
|
<span v-else>智能巡检</span>
|
|
|
|
|
<span>停止巡检</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div @click="patrolClick" v-else>
|
|
|
|
|
<span> <RadarChartOutlined /> </span>
|
|
|
|
|
<span>智能巡检</span>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div @click="reportVisible = true">
|
|
|
|
|
<span> <AlertOutlined /></span>
|
|
|
|
@ -112,9 +115,11 @@
|
|
|
|
|
import { drcUpTopic, setTopic, eventsTopicSubscribe } from '@/utils/debugging/remote';
|
|
|
|
|
import { airPortStore } from '@/store/modules/airport';
|
|
|
|
|
import { AlertOutlined, RadarChartOutlined } from '@ant-design/icons-vue';
|
|
|
|
|
import { endHandFlyTask } from '@/api/workmanagement/droneDock';
|
|
|
|
|
import { endAiInspection, getLastHandFlyTask } from '@/api/workmanagement/droneDock';
|
|
|
|
|
import io from 'socket.io-client';
|
|
|
|
|
import { getAppEnvConfig } from '@/utils/env';
|
|
|
|
|
|
|
|
|
|
const { VITE_GLOB_PY_URL } = getAppEnvConfig();
|
|
|
|
|
let socket;
|
|
|
|
|
const zIndex = ref(0);
|
|
|
|
|
const airPortStoreVal = airPortStore();
|
|
|
|
@ -146,26 +151,24 @@
|
|
|
|
|
const taskId = ref(airPortStoreVal.getTaskId);
|
|
|
|
|
|
|
|
|
|
const patrolClick = () => {
|
|
|
|
|
console.log('patrolClick', airPortStoreVal.getTaskId);
|
|
|
|
|
if (airPortStoreVal.getTaskId) {
|
|
|
|
|
endHandFlyTask({
|
|
|
|
|
taskid: airPortStoreVal.getTaskId,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
if (res) {
|
|
|
|
|
if (socket) {
|
|
|
|
|
socket.disconnect();
|
|
|
|
|
}
|
|
|
|
|
airPortStoreVal.setTaskId(null);
|
|
|
|
|
stopPatrolVisible.value = false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
zIndex.value++;
|
|
|
|
|
patrolVisible.value = true;
|
|
|
|
|
}
|
|
|
|
|
zIndex.value++;
|
|
|
|
|
patrolVisible.value = true;
|
|
|
|
|
};
|
|
|
|
|
const stopPatrolVisible = ref(false);
|
|
|
|
|
console.log('airPortStoreVal', airPortStoreVal.getTaskId);
|
|
|
|
|
|
|
|
|
|
const stopPatrolClick = () => {
|
|
|
|
|
endAiInspection({
|
|
|
|
|
taskid: airPortStoreVal.getTaskId,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
if (res) {
|
|
|
|
|
if (socket) {
|
|
|
|
|
socket.disconnect();
|
|
|
|
|
}
|
|
|
|
|
airPortStoreVal.setTaskId(null);
|
|
|
|
|
stopPatrolVisible.value = false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
if (airPortStoreVal.getTaskId) {
|
|
|
|
|
stopPatrolVisible.value = true;
|
|
|
|
|
}
|
|
|
|
@ -176,10 +179,22 @@
|
|
|
|
|
patrolVisible.value = false;
|
|
|
|
|
};
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
socket = io('http://192.168.10.131:9025');
|
|
|
|
|
// socket = io('http://123.132.248.154:9309');
|
|
|
|
|
socket = io(VITE_GLOB_PY_URL);
|
|
|
|
|
destroyConnection();
|
|
|
|
|
createConnection(connectCallback);
|
|
|
|
|
getLastHandFlyTask().then((res) => {
|
|
|
|
|
if (res.Status == 1) {
|
|
|
|
|
// 手飞任务执行中,但未开启巡检
|
|
|
|
|
airPortStoreVal.setTaskId(res.Id);
|
|
|
|
|
taskId.value = res.Id;
|
|
|
|
|
stopPatrolVisible.value = false;
|
|
|
|
|
} else if (res.Status == 6) {
|
|
|
|
|
// 手飞任务执行中,且开启巡检
|
|
|
|
|
airPortStoreVal.setTaskId(res.Id);
|
|
|
|
|
taskId.value = res.Id;
|
|
|
|
|
stopPatrolVisible.value = true;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
// 接收消息
|
|
|
|
|
getClient().on('message', (topic, message) => {
|
|
|
|
|