飞行作业查询最新手飞任务taskid,巡检消息接口放在配置文件里
parent
1aae2f0a0e
commit
d0c534e12d
|
|
@ -9,6 +9,7 @@ enum Api {
|
|||
CallAiModel = '/api/Manage/CallAiModel',
|
||||
EndHandFlyTask = '/api/Manage/EndHandFlyTask',
|
||||
GetLastHandFlyTask = '/api/Manage/GetLastHandFlyTask',
|
||||
EndAiInspection = '/api/Manage/EndAiInspection',
|
||||
}
|
||||
|
||||
export function getVerifyToken(token) {
|
||||
|
|
@ -52,6 +53,13 @@ export function endHandFlyTask(params) {
|
|||
});
|
||||
}
|
||||
|
||||
export function endAiInspection(params) {
|
||||
return defHttp.post({
|
||||
url: Api.EndAiInspection + '?taskid=' + params.taskid,
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export function getLastHandFlyTask() {
|
||||
return defHttp.get({
|
||||
url: Api.GetLastHandFlyTask,
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ export function getAppEnvConfig() {
|
|||
VITE_GLOB_APP_VERSIONS,
|
||||
VITE_GLOB_FILE_PREVIEW,
|
||||
VITE_GLOB_APP_HEADER_TITLE,
|
||||
VITE_GLOB_PY_URL,
|
||||
} = ENV;
|
||||
let { VITE_GLOB_API_URL } = ENV;
|
||||
if (localStorage.getItem(API_ADDRESS)) {
|
||||
|
|
@ -63,6 +64,7 @@ export function getAppEnvConfig() {
|
|||
VITE_GLOB_APP_VERSIONS,
|
||||
VITE_GLOB_FILE_PREVIEW,
|
||||
VITE_GLOB_APP_HEADER_TITLE,
|
||||
VITE_GLOB_PY_URL,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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, getLastHandFlyTask } 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,25 +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);
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
@ -175,12 +179,17 @@
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -190,9 +190,11 @@
|
|||
import VueDragResize from 'vue-drag-resize/src';
|
||||
import { airPortStore } from '@/store/modules/airport';
|
||||
import { EventBus } from '@/utils/eventBus';
|
||||
import { endHandFlyTask } from '@/api/workmanagement/droneDock';
|
||||
import { endHandFlyTask, endAiInspection } from '@/api/workmanagement/droneDock';
|
||||
import io from 'socket.io-client';
|
||||
import { getAppEnvConfig } from '@/utils/env';
|
||||
|
||||
const { VITE_GLOB_PY_URL } = getAppEnvConfig();
|
||||
let socket;
|
||||
const props = defineProps({
|
||||
zIndex: Number,
|
||||
|
|
@ -349,12 +351,18 @@
|
|||
if (airPortStoreVal.getTaskId) {
|
||||
endHandFlyTask({
|
||||
taskid: airPortStoreVal.getTaskId,
|
||||
}).then((res) => {
|
||||
if (res) {
|
||||
airPortStoreVal.setTaskId(null);
|
||||
}
|
||||
});
|
||||
endAiInspection({
|
||||
taskid: airPortStoreVal.getTaskId,
|
||||
}).then((res) => {
|
||||
if (res) {
|
||||
if (socket) {
|
||||
socket.disconnect();
|
||||
}
|
||||
airPortStoreVal.setTaskId(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -558,8 +566,7 @@
|
|||
}
|
||||
};
|
||||
onMounted(() => {
|
||||
socket = io('http://192.168.10.131:9025');
|
||||
// socket = io('http://123.132.248.154:9309');
|
||||
socket = io(VITE_GLOB_PY_URL);
|
||||
// 添加键盘事件监听
|
||||
document.addEventListener('keydown', handleKeyDown);
|
||||
document.addEventListener('keyup', handleKeyUp);
|
||||
|
|
|
|||
|
|
@ -40,7 +40,9 @@
|
|||
import io from 'socket.io-client';
|
||||
import { getClient, createConnection, clientSubscribe, destroyConnection } from '@/utils/mqtt';
|
||||
import { airPortStore } from '@/store/modules/airport';
|
||||
import { getAppEnvConfig } from '@/utils/env';
|
||||
|
||||
const { VITE_GLOB_PY_URL } = getAppEnvConfig();
|
||||
let socket;
|
||||
|
||||
const airPortStoreVal = airPortStore();
|
||||
|
|
@ -50,9 +52,7 @@
|
|||
function connectWebSocket() {
|
||||
console.log('connectWebSocket');
|
||||
// 初始化Socket连接
|
||||
socket = io('http://192.168.10.131:9025');
|
||||
// socket = io('http://123.132.248.154:9309');
|
||||
|
||||
socket = io(VITE_GLOB_PY_URL);
|
||||
// 连接事件
|
||||
socket.on('connect', () => {
|
||||
console.log('服务连接成功');
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
// 原始流
|
||||
let player;
|
||||
const liveCode = live_info.url + '7.flv';
|
||||
// const liveCode = 'http://192.168.10.131:8082/flv/live/12.flv';
|
||||
const playVideo = () => {
|
||||
var originalElement = document.getElementById('player-container-original-live');
|
||||
var player = flvjs.createPlayer({
|
||||
|
|
@ -58,6 +59,8 @@
|
|||
// 检测后流
|
||||
let playerTesting;
|
||||
const testingCode = live_info.url + '11.flv';
|
||||
// const testingCode = 'http://192.168.10.131:8082/flv/live/11.flv';
|
||||
|
||||
const testingPlayVideo = () => {
|
||||
var testingElement = document.getElementById('player-container-testing-live');
|
||||
var playerTesting = flvjs.createPlayer({
|
||||
|
|
|
|||
|
|
@ -40,13 +40,6 @@ export default defineApplicationConfig({
|
|||
ws: true,
|
||||
rewrite: (path) => path.replace(new RegExp(`^/upload`), ''),
|
||||
},
|
||||
'/sltest': {
|
||||
target: 'http://192.168.10.131:9025/',
|
||||
changeOrigin: true, //是否跨域
|
||||
rewrite: (path) => path.replace(/^\/sltest/, ''), //如果后端接口有sltest前缀就不需要替换
|
||||
// ws: true, //是否代理 websockets
|
||||
// secure: true, //是否https接口
|
||||
},
|
||||
},
|
||||
warmup: {
|
||||
clientFiles: ['./index.html', './src/{views,components}/*'],
|
||||
|
|
|
|||
Loading…
Reference in New Issue