Compare commits

..

No commits in common. '00640deb196104e028ec2d0b3034e01c4ce3af57' and 'abe37088e0e3a1b77e8ef3b6e24fd864d29fd8a9' have entirely different histories.

@ -137,7 +137,6 @@
"resize-observer-polyfill": "^1.5.1",
"showdown": "^2.1.0",
"shpjs": "^6.1.0",
"socket.io-client": "^4.8.1",
"sortablejs": "^1.15.1",
"tcplayer.js": "^5.3.4",
"terraformer-wkt-parser": "^1.2.1",

@ -7,7 +7,6 @@ enum Api {
GetTaskVideoList = '/api/Manage/GetTaskVideoList',
SaveHandFlyTask = '/api/Manage/SaveHandFlyTask',
CallAiModel = '/api/Manage/CallAiModel',
EndHandFlyTask = '/api/Manage/EndHandFlyTask',
}
export function getVerifyToken(token) {
@ -43,10 +42,3 @@ export function callAiModel(params) {
params,
});
}
export function endHandFlyTask(params) {
return defHttp.post({
url: Api.EndHandFlyTask + '?taskid = ' + params.taskid,
params,
});
}

@ -23,7 +23,6 @@ export const airPortStore = defineStore({
},
gateway: null,
project: null,
taskId: null,
}),
getters: {
getAirport(state) {
@ -41,9 +40,6 @@ export const airPortStore = defineStore({
getProject(state) {
return state.project;
},
getTaskId(state) {
return state.taskId;
},
},
actions: {
setAirPort(item: any, value: any) {
@ -58,8 +54,5 @@ export const airPortStore = defineStore({
setProject(value: any) {
this.project = value;
},
setTaskId(value: any) {
this.taskId = value;
},
},
});

@ -72,7 +72,7 @@
@loadLiveStreaming="livePreviewVisible = false"
@changeCameraType="changeCameraType"
/>
<div class="intelligent-patrol" v-if="taskId">
<div class="intelligent-patrol">
<div @click="patrolVisible = true">
<span> <RadarChartOutlined /> </span>
<span>智能巡检</span>

@ -190,10 +190,7 @@
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 io from 'socket.io-client';
let socket;
const props = defineProps({
zIndex: Number,
});
@ -346,18 +343,6 @@
timestamp: new Date().getTime(),
data: {},
});
if (airPortStoreVal.getTaskId) {
endHandFlyTask({
taskid: airPortStoreVal.getTaskId,
}).then((res) => {
if (res) {
if (socket) {
socket.disconnect();
}
airPortStoreVal.setTaskId(null);
}
});
}
};
const seq = ref(1);
const longPressTimer = ref();
@ -558,7 +543,6 @@
}
};
onMounted(() => {
socket = io('http://192.168.10.131:9025');
//
document.addEventListener('keydown', handleKeyDown);
document.addEventListener('keyup', handleKeyUp);

@ -47,14 +47,11 @@
</a-radio-group>
</div>
<div class="content-title">
<span>警告提示标题</span>
<span>警告提示</span>
</div>
<div class="content-edit">
<a-input v-model:value="data.code" placeholder="异常提示" />
</div>
<div class="content-title">
<span>警告提示内容</span>
</div>
<div class="content-edit">
<a-textarea v-model:value="data.desc" placeholder="识别到异常目标" />
</div>
@ -104,8 +101,6 @@
import { callAiModel } from '@/api/workmanagement/droneDock';
import { EventBus } from '@/utils/eventBus';
const airPortStoreVal = airPortStore();
const { createMessage } = useMessage();
const emits = defineEmits(['changePatrol']);
const props = defineProps({
@ -169,22 +164,11 @@
});
};
const liveCode = ref('7');
const airPortStoreVal = airPortStore();
const live_info = airPortStoreVal.getLiveInfo;
const submit = () => {
console.log(props.type);
if (!instantiateItem.value) {
createMessage.warning('请选择AI算法实例');
return;
}
if (!data.code) {
createMessage.warning('警告提示标题不能为空');
return;
}
if (!data.desc) {
createMessage.warning('警告提示内容不能为空');
return;
}
if (props.type == 'plan') {
const querys = {
algoInstanceId: instantiateItem.value.id,
@ -192,7 +176,6 @@
warningContent: data.desc,
};
EventBus.emit('palnPatrol', querys);
emits('changePatrol');
return;
}
const querys = {
@ -205,7 +188,6 @@
callAiModel(querys).then((res) => {
console.log(res);
createMessage.success('操作成功');
airPortStoreVal.setTaskId(props.taskId);
emits('changePatrol');
});
};

@ -8,31 +8,17 @@
<a-badge status="error" />
状态<span>未连接</span>
</div>
<div class="inspection-header-desc-item">
FPS:<span>{{ socketData && socketData.fps ? socketData.fps : 0 }}</span>
</div>
<div class="inspection-header-desc-item">
总帧数:<span>{{
socketData && socketData.frame_count ? socketData.frame_count : 0
}}</span>
</div>
<div class="inspection-header-desc-item">
监测目标数:<span>{{
socketData && socketData.detections.length ? socketData.detections.length : 0
}}</span>
</div>
<div class="inspection-header-desc-item"> FPS:<span>123</span> </div>
<div class="inspection-header-desc-item"> 总帧数:<span>123</span> </div>
<div class="inspection-header-desc-item"> 监测目标数:<span>123</span> </div>
</div>
</div>
<div class="inspection-content">
<div class="inspection-content-left">
<StatisticsComponent
:statisData="socketData && socketData.detections ? socketData.detections : []"
/>
<StatisticsComponent />
</div>
<div class="inspection-content-right">
<VideoStreamComponent
:statisData="socketData && socketData.detections ? socketData.detections : []"
/>
<VideoStreamComponent />
</div>
</div>
</div>
@ -40,8 +26,7 @@
<script lang="ts" setup>
import { SelectComponent, StatisticsComponent, VideoStreamComponent } from './index';
import axios from 'axios';
import { onMounted, ref } from 'vue';
import io from 'socket.io-client';
import { onMounted } from 'vue';
const getData = () => {
const data = {
@ -67,64 +52,29 @@
console.log('err', err);
});
};
let socket;
// const connectWebSocket = () => {
// const socket = new WebSocket('ws://192.168.10.131:9025/socket.io');
// // 使 addEventListener
// //
// socket.onopen = function () {
// console.log('WebSocket');
const connectWebSocket = () => {
const socket = new WebSocket('ws://192.168.10.131:9025/socket.io');
// //
// socket.send('Hello Server!');
// };
// 使 addEventListener
//
socket.onopen = function () {
console.log('WebSocket连接已建立');
// //
// socket.onmessage = function (event) {
// const message = event.data;
// console.log('' + message);
// };
// //
// socket.onclose = function () {
// console.log('WebSocket');
// };
// };
const socketData = ref();
function connectWebSocket() {
console.log('connectWebSocket');
// Socket
socket = io('http://192.168.10.131:9025');
//
socket.on('connect', () => {
console.log('服务连接成功');
});
socket.on('disconnect', () => {
console.log('服务器断开');
});
//
socket.send('Hello Server!');
};
//
socket.on('detection_results', (data) => {
// console.log('', data);
socketData.value = data;
// {
// "detections": [],
// "timestamp": 1756371710725,
// "fps": 18.2,
// "frame_count": 3269,
// "taskid": "03721e94-08da-42fc-aa0e-261ac0b4f2d9"
// }
});
//
socket.onmessage = function (event) {
const message = event.data;
console.log('接收到服务器消息:' + message);
};
//
socket.on('error', (error) => {
console.log('WebSocket连接错误:', error);
});
}
//
socket.onclose = function () {
console.log('WebSocket连接已关闭');
};
};
onMounted(() => {
// getData();
connectWebSocket();

@ -11,37 +11,20 @@
</div>
</template>
<script lang="ts" setup>
import { onMounted, watch, ref } from 'vue';
import { onMounted } from 'vue';
import * as echarts from 'echarts';
import { Map } from '../index';
const chartData = ref([]);
const props = defineProps({
statisData: {
type: Array,
default: () => [],
},
});
watch(
() => props.statisData,
(val) => {
if (val.length > 0) {
if (chartData.value.length >= 20) {
chartData.value.shift();
}
chartData.value.push(val[0].confidence);
updateChart();
}
},
);
let myChart;
const initChart = () => {
var chartDom = document.getElementById('main');
myChart = echarts.init(chartDom);
var myChart = echarts.init(chartDom);
var option;
let date = [];
for (let i = 1; i < 20; i++) {
let data = [Math.random() * 300];
for (let i = 1; i < 40; i++) {
date.push(i);
data.push(Math.round((Math.random() - 0.5) * 20 + data[i - 1]));
}
option = {
tooltip: {
@ -96,24 +79,13 @@
},
]),
},
data: [],
data: data,
},
],
};
option && myChart.setOption(option);
};
//
function updateChart() {
console.log(chartData.value);
myChart.setOption({
series: [
{
data: chartData.value,
},
],
});
}
onMounted(() => {
initChart();
});

@ -4,7 +4,6 @@
<div class="title">
<VideoCameraOutlined />
原始视频流
<RedoOutlined title="刷新" @click="reloadLive" />
</div>
<div class="player">
<video
@ -22,7 +21,6 @@
<div class="title">
<VideoCameraOutlined />
检测后视频流
<RedoOutlined title="刷新" @click="reloadTestingLive" />
</div>
<div class="player">
<video
@ -42,86 +40,24 @@
import TCPlayer from 'tcplayer.js';
import 'tcplayer.js/dist/tcplayer.min.css'; //
import { airPortStore } from '@/store/modules/airport';
import { onMounted, watch, onBeforeUnmount } from 'vue';
import { VideoCameraOutlined, RedoOutlined } from '@ant-design/icons-vue';
const props = defineProps({
statisData: {
type: Array,
default: () => [],
},
});
import { ref } from 'vue';
import { VideoCameraOutlined } from '@ant-design/icons-vue';
const airPortStoreVal = airPortStore();
const live_info = airPortStoreVal.getLiveInfo;
//
let player;
const liveCode = live_info.url + '7.flv';
const liveCode = ref('7');
const playVideo = () => {
player = TCPlayer('player-container-original-live', {
sources: [
{
src: liveCode, //
},
],
licenseUrl: liveCode, // license license licenseUrl
});
};
//
let playerTesting;
const testingCode = live_info.url + '11.flv';
const testingPlayVideo = () => {
player = TCPlayer('player-container-testing-live', {
sources: [
{
src: testingCode, //
src: live_info.url + liveCode.value + '.flv', //
},
],
licenseUrl: testingCode, // license license licenseUrl
licenseUrl: live_info.url + liveCode.value + '.flv', // license license licenseUrl
});
};
const reloadLive = () => {
player.src(liveCode);
player.play();
};
const reloadTestingLive = () => {
if (playerTesting) {
playerTesting.src(testingCode);
playerTesting.play();
}
};
onMounted(() => {
playVideo();
testingPlayVideo();
setTimeout(() => {
if (player) {
player.play();
}
if (playerTesting) {
playerTesting.play();
}
}, 1000);
});
watch(
() => props.statisData,
(val) => {
reloadLive();
reloadTestingLive();
},
);
//
onBeforeUnmount(() => {
if (player) {
player.dispose();
player = null;
}
if (playerTesting) {
playerTesting.dispose();
playerTesting = null;
}
});
</script>
<style lang="scss" scoped>
.video-stream-container {
@ -149,7 +85,6 @@
border-bottom: 1px solid #4e5778;
}
.player {
height: 80%;
video {
margin-left: 10px;
}

Loading…
Cancel
Save