飞行作业查询最新手飞任务taskid,巡检消息接口放在配置文件里
parent
1aae2f0a0e
commit
d0c534e12d
|
|
@ -9,6 +9,7 @@ enum Api {
|
||||||
CallAiModel = '/api/Manage/CallAiModel',
|
CallAiModel = '/api/Manage/CallAiModel',
|
||||||
EndHandFlyTask = '/api/Manage/EndHandFlyTask',
|
EndHandFlyTask = '/api/Manage/EndHandFlyTask',
|
||||||
GetLastHandFlyTask = '/api/Manage/GetLastHandFlyTask',
|
GetLastHandFlyTask = '/api/Manage/GetLastHandFlyTask',
|
||||||
|
EndAiInspection = '/api/Manage/EndAiInspection',
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getVerifyToken(token) {
|
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() {
|
export function getLastHandFlyTask() {
|
||||||
return defHttp.get({
|
return defHttp.get({
|
||||||
url: Api.GetLastHandFlyTask,
|
url: Api.GetLastHandFlyTask,
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ export function getAppEnvConfig() {
|
||||||
VITE_GLOB_APP_VERSIONS,
|
VITE_GLOB_APP_VERSIONS,
|
||||||
VITE_GLOB_FILE_PREVIEW,
|
VITE_GLOB_FILE_PREVIEW,
|
||||||
VITE_GLOB_APP_HEADER_TITLE,
|
VITE_GLOB_APP_HEADER_TITLE,
|
||||||
|
VITE_GLOB_PY_URL,
|
||||||
} = ENV;
|
} = ENV;
|
||||||
let { VITE_GLOB_API_URL } = ENV;
|
let { VITE_GLOB_API_URL } = ENV;
|
||||||
if (localStorage.getItem(API_ADDRESS)) {
|
if (localStorage.getItem(API_ADDRESS)) {
|
||||||
|
|
@ -63,6 +64,7 @@ export function getAppEnvConfig() {
|
||||||
VITE_GLOB_APP_VERSIONS,
|
VITE_GLOB_APP_VERSIONS,
|
||||||
VITE_GLOB_FILE_PREVIEW,
|
VITE_GLOB_FILE_PREVIEW,
|
||||||
VITE_GLOB_APP_HEADER_TITLE,
|
VITE_GLOB_APP_HEADER_TITLE,
|
||||||
|
VITE_GLOB_PY_URL,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,10 +73,13 @@
|
||||||
@changeCameraType="changeCameraType"
|
@changeCameraType="changeCameraType"
|
||||||
/>
|
/>
|
||||||
<div class="intelligent-patrol" v-if="taskId">
|
<div class="intelligent-patrol" v-if="taskId">
|
||||||
<div @click="patrolClick">
|
<div @click="stopPatrolClick" v-if="stopPatrolVisible">
|
||||||
<span> <RadarChartOutlined /> </span>
|
<span> <RadarChartOutlined /> </span>
|
||||||
<span v-if="stopPatrolVisible">停止巡检</span>
|
<span>停止巡检</span>
|
||||||
<span v-else>智能巡检</span>
|
</div>
|
||||||
|
<div @click="patrolClick" v-else>
|
||||||
|
<span> <RadarChartOutlined /> </span>
|
||||||
|
<span>智能巡检</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div @click="reportVisible = true">
|
<!-- <div @click="reportVisible = true">
|
||||||
<span> <AlertOutlined /></span>
|
<span> <AlertOutlined /></span>
|
||||||
|
|
@ -112,9 +115,11 @@
|
||||||
import { drcUpTopic, setTopic, eventsTopicSubscribe } from '@/utils/debugging/remote';
|
import { drcUpTopic, setTopic, eventsTopicSubscribe } from '@/utils/debugging/remote';
|
||||||
import { airPortStore } from '@/store/modules/airport';
|
import { airPortStore } from '@/store/modules/airport';
|
||||||
import { AlertOutlined, RadarChartOutlined } from '@ant-design/icons-vue';
|
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 io from 'socket.io-client';
|
||||||
|
import { getAppEnvConfig } from '@/utils/env';
|
||||||
|
|
||||||
|
const { VITE_GLOB_PY_URL } = getAppEnvConfig();
|
||||||
let socket;
|
let socket;
|
||||||
const zIndex = ref(0);
|
const zIndex = ref(0);
|
||||||
const airPortStoreVal = airPortStore();
|
const airPortStoreVal = airPortStore();
|
||||||
|
|
@ -146,25 +151,24 @@
|
||||||
const taskId = ref(airPortStoreVal.getTaskId);
|
const taskId = ref(airPortStoreVal.getTaskId);
|
||||||
|
|
||||||
const patrolClick = () => {
|
const patrolClick = () => {
|
||||||
console.log('patrolClick', airPortStoreVal.getTaskId);
|
zIndex.value++;
|
||||||
if (airPortStoreVal.getTaskId) {
|
patrolVisible.value = true;
|
||||||
endHandFlyTask({
|
|
||||||
taskid: airPortStoreVal.getTaskId,
|
|
||||||
}).then((res) => {
|
|
||||||
if (res) {
|
|
||||||
if (socket) {
|
|
||||||
socket.disconnect();
|
|
||||||
}
|
|
||||||
airPortStoreVal.setTaskId(null);
|
|
||||||
stopPatrolVisible.value = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
zIndex.value++;
|
|
||||||
patrolVisible.value = true;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
const stopPatrolVisible = ref(false);
|
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) {
|
if (airPortStoreVal.getTaskId) {
|
||||||
stopPatrolVisible.value = true;
|
stopPatrolVisible.value = true;
|
||||||
}
|
}
|
||||||
|
|
@ -175,12 +179,17 @@
|
||||||
patrolVisible.value = false;
|
patrolVisible.value = false;
|
||||||
};
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
socket = io('http://192.168.10.131:9025');
|
socket = io(VITE_GLOB_PY_URL);
|
||||||
// socket = io('http://123.132.248.154:9309');
|
|
||||||
destroyConnection();
|
destroyConnection();
|
||||||
createConnection(connectCallback);
|
createConnection(connectCallback);
|
||||||
getLastHandFlyTask().then((res) => {
|
getLastHandFlyTask().then((res) => {
|
||||||
if (res.Status == 1) {
|
if (res.Status == 1) {
|
||||||
|
// 手飞任务执行中,但未开启巡检
|
||||||
|
airPortStoreVal.setTaskId(res.Id);
|
||||||
|
taskId.value = res.Id;
|
||||||
|
stopPatrolVisible.value = false;
|
||||||
|
} else if (res.Status == 6) {
|
||||||
|
// 手飞任务执行中,且开启巡检
|
||||||
airPortStoreVal.setTaskId(res.Id);
|
airPortStoreVal.setTaskId(res.Id);
|
||||||
taskId.value = res.Id;
|
taskId.value = res.Id;
|
||||||
stopPatrolVisible.value = true;
|
stopPatrolVisible.value = true;
|
||||||
|
|
|
||||||
|
|
@ -190,9 +190,11 @@
|
||||||
import VueDragResize from 'vue-drag-resize/src';
|
import VueDragResize from 'vue-drag-resize/src';
|
||||||
import { airPortStore } from '@/store/modules/airport';
|
import { airPortStore } from '@/store/modules/airport';
|
||||||
import { EventBus } from '@/utils/eventBus';
|
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 io from 'socket.io-client';
|
||||||
|
import { getAppEnvConfig } from '@/utils/env';
|
||||||
|
|
||||||
|
const { VITE_GLOB_PY_URL } = getAppEnvConfig();
|
||||||
let socket;
|
let socket;
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
zIndex: Number,
|
zIndex: Number,
|
||||||
|
|
@ -349,12 +351,18 @@
|
||||||
if (airPortStoreVal.getTaskId) {
|
if (airPortStoreVal.getTaskId) {
|
||||||
endHandFlyTask({
|
endHandFlyTask({
|
||||||
taskid: airPortStoreVal.getTaskId,
|
taskid: airPortStoreVal.getTaskId,
|
||||||
|
}).then((res) => {
|
||||||
|
if (res) {
|
||||||
|
airPortStoreVal.setTaskId(null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
endAiInspection({
|
||||||
|
taskid: airPortStoreVal.getTaskId,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
if (socket) {
|
if (socket) {
|
||||||
socket.disconnect();
|
socket.disconnect();
|
||||||
}
|
}
|
||||||
airPortStoreVal.setTaskId(null);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -558,8 +566,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
socket = io('http://192.168.10.131:9025');
|
socket = io(VITE_GLOB_PY_URL);
|
||||||
// socket = io('http://123.132.248.154:9309');
|
|
||||||
// 添加键盘事件监听
|
// 添加键盘事件监听
|
||||||
document.addEventListener('keydown', handleKeyDown);
|
document.addEventListener('keydown', handleKeyDown);
|
||||||
document.addEventListener('keyup', handleKeyUp);
|
document.addEventListener('keyup', handleKeyUp);
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,9 @@
|
||||||
import io from 'socket.io-client';
|
import io from 'socket.io-client';
|
||||||
import { getClient, createConnection, clientSubscribe, destroyConnection } from '@/utils/mqtt';
|
import { getClient, createConnection, clientSubscribe, destroyConnection } from '@/utils/mqtt';
|
||||||
import { airPortStore } from '@/store/modules/airport';
|
import { airPortStore } from '@/store/modules/airport';
|
||||||
|
import { getAppEnvConfig } from '@/utils/env';
|
||||||
|
|
||||||
|
const { VITE_GLOB_PY_URL } = getAppEnvConfig();
|
||||||
let socket;
|
let socket;
|
||||||
|
|
||||||
const airPortStoreVal = airPortStore();
|
const airPortStoreVal = airPortStore();
|
||||||
|
|
@ -50,9 +52,7 @@
|
||||||
function connectWebSocket() {
|
function connectWebSocket() {
|
||||||
console.log('connectWebSocket');
|
console.log('connectWebSocket');
|
||||||
// 初始化Socket连接
|
// 初始化Socket连接
|
||||||
socket = io('http://192.168.10.131:9025');
|
socket = io(VITE_GLOB_PY_URL);
|
||||||
// socket = io('http://123.132.248.154:9309');
|
|
||||||
|
|
||||||
// 连接事件
|
// 连接事件
|
||||||
socket.on('connect', () => {
|
socket.on('connect', () => {
|
||||||
console.log('服务连接成功');
|
console.log('服务连接成功');
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@
|
||||||
// 原始流
|
// 原始流
|
||||||
let player;
|
let player;
|
||||||
const liveCode = live_info.url + '7.flv';
|
const liveCode = live_info.url + '7.flv';
|
||||||
|
// const liveCode = 'http://192.168.10.131:8082/flv/live/12.flv';
|
||||||
const playVideo = () => {
|
const playVideo = () => {
|
||||||
var originalElement = document.getElementById('player-container-original-live');
|
var originalElement = document.getElementById('player-container-original-live');
|
||||||
var player = flvjs.createPlayer({
|
var player = flvjs.createPlayer({
|
||||||
|
|
@ -58,6 +59,8 @@
|
||||||
// 检测后流
|
// 检测后流
|
||||||
let playerTesting;
|
let playerTesting;
|
||||||
const testingCode = live_info.url + '11.flv';
|
const testingCode = live_info.url + '11.flv';
|
||||||
|
// const testingCode = 'http://192.168.10.131:8082/flv/live/11.flv';
|
||||||
|
|
||||||
const testingPlayVideo = () => {
|
const testingPlayVideo = () => {
|
||||||
var testingElement = document.getElementById('player-container-testing-live');
|
var testingElement = document.getElementById('player-container-testing-live');
|
||||||
var playerTesting = flvjs.createPlayer({
|
var playerTesting = flvjs.createPlayer({
|
||||||
|
|
|
||||||
|
|
@ -40,13 +40,6 @@ export default defineApplicationConfig({
|
||||||
ws: true,
|
ws: true,
|
||||||
rewrite: (path) => path.replace(new RegExp(`^/upload`), ''),
|
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: {
|
warmup: {
|
||||||
clientFiles: ['./index.html', './src/{views,components}/*'],
|
clientFiles: ['./index.html', './src/{views,components}/*'],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue