实时巡检修改

main
刘妍 6 days ago
parent 05540599b5
commit 8465d69ec6

@ -109,7 +109,7 @@
import { buildGUID } from '@/utils/uuid';
import { vDrag } from '@/utils/drag';
import { EventBus } from '@/utils/eventBus';
import { drcUpTopic, setTopic } from '@/utils/debugging/remote';
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';
@ -156,6 +156,7 @@
socket.disconnect();
}
airPortStoreVal.setTaskId(null);
stopPatrolVisible.value = false;
}
});
} else {
@ -175,8 +176,8 @@
patrolVisible.value = false;
};
onMounted(() => {
// socket = io('http://192.168.10.131:9025');
socket = io('http://123.132.248.154:9309');
socket = io('http://192.168.10.131:9025');
// socket = io('http://123.132.248.154:9309');
destroyConnection();
createConnection(connectCallback);
setTimeout(() => {
@ -314,6 +315,7 @@
const topicUAVUrl = 'thing/product/' + UAVinfo.sn + '/osd';
//
clientSubscribe(topicUAVUrl, { qos: 1 });
eventsTopicSubscribe();
};
</script>
<style lang="less" scoped>

@ -558,8 +558,8 @@
}
};
onMounted(() => {
// socket = io('http://192.168.10.131:9025');
socket = io('http://123.132.248.154:9309');
socket = io('http://192.168.10.131:9025');
// socket = io('http://123.132.248.154:9309');
//
document.addEventListener('keydown', handleKeyDown);
document.addEventListener('keyup', handleKeyUp);

@ -25,14 +25,10 @@
</div>
<div class="inspection-content">
<div class="inspection-content-left">
<StatisticsComponent
:statisData="socketData && socketData.detections ? socketData.detections : []"
/>
<StatisticsComponent :statisData="socketData" />
</div>
<div class="inspection-content-right">
<VideoStreamComponent
:statisData="socketData && socketData.detections ? socketData.detections : []"
/>
<VideoStreamComponent :statisData="socketData" />
</div>
</div>
</div>
@ -54,8 +50,8 @@
function connectWebSocket() {
console.log('connectWebSocket');
// Socket
// socket = io('http://192.168.10.131:9025');
socket = io('http://123.132.248.154:9309');
socket = io('http://192.168.10.131:9025');
// socket = io('http://123.132.248.154:9309');
//
socket.on('connect', () => {

@ -20,20 +20,24 @@
const airPortStoreVal = airPortStore();
const UAVinfo = airPortStoreVal.getUAV;
const chartData = ref([]);
const dateData = ref([]);
const props = defineProps({
statisData: {
type: Array,
default: () => [],
type: Object,
default: () => {},
},
});
watch(
() => props.statisData,
(val) => {
if (val.length > 0) {
console.log('props.statisData', val);
if (val.detections) {
if (chartData.value.length >= 20) {
chartData.value.shift();
dateData.value.shift();
}
chartData.value.push(val.length);
chartData.value.push(val.detections.length);
dateData.value.push(val.time_str);
updateChart();
}
},
@ -43,10 +47,6 @@
var chartDom = document.getElementById('main');
myChart = echarts.init(chartDom);
var option;
let date = [];
for (let i = 1; i < 20; i++) {
date.push(i);
}
option = {
tooltip: {
trigger: 'axis',
@ -73,7 +73,7 @@
xAxis: {
type: 'category',
boundaryGap: false,
data: date,
data: [],
},
yAxis: {
type: 'value',
@ -109,8 +109,10 @@
};
//
function updateChart() {
console.log(chartData.value);
myChart.setOption({
xAxis: {
data: dateData.value,
},
series: [
{
data: chartData.value,

Loading…
Cancel
Save