|
|
|
@ -25,6 +25,60 @@
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { SelectComponent, StatisticsComponent, VideoStreamComponent } from './index';
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
import { onMounted } from 'vue';
|
|
|
|
|
|
|
|
|
|
const getData = () => {
|
|
|
|
|
const data = {
|
|
|
|
|
rtmp_url: 'rtmp://box.wisestcity.com:1935/live/7',
|
|
|
|
|
push_url: 'rtmp://box.wisestcity.com:1935/live/yolov8x',
|
|
|
|
|
imgsz: 640,
|
|
|
|
|
frame_skip: 1,
|
|
|
|
|
model_name: 'yolov8x.pt',
|
|
|
|
|
taskname: '兰山区火情监测日常任务20250828',
|
|
|
|
|
taskid: 'bbfc3789-92e2-4658-98e5-d218e77a981c',
|
|
|
|
|
tag: [0, 1, 2, 3, 4, 5, 7],
|
|
|
|
|
};
|
|
|
|
|
const url = 'sltest/start_detection';
|
|
|
|
|
|
|
|
|
|
axios
|
|
|
|
|
.post(url, data, {
|
|
|
|
|
headers: { 'Content-Type': 'application/json' },
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
console.log('helloworld', res);
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log('err', err);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
const connectWebSocket = () => {
|
|
|
|
|
const socket = new WebSocket('ws://192.168.10.131:9025/socket.io');
|
|
|
|
|
|
|
|
|
|
// 同样可以使用 addEventListener 绑定事件
|
|
|
|
|
// 监听连接建立事件
|
|
|
|
|
socket.onopen = function () {
|
|
|
|
|
console.log('WebSocket连接已建立');
|
|
|
|
|
|
|
|
|
|
// 向服务器发送消息
|
|
|
|
|
socket.send('Hello Server!');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 监听接收到消息事件
|
|
|
|
|
socket.onmessage = function (event) {
|
|
|
|
|
const message = event.data;
|
|
|
|
|
console.log('接收到服务器消息:' + message);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 监听连接关闭事件
|
|
|
|
|
socket.onclose = function () {
|
|
|
|
|
console.log('WebSocket连接已关闭');
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
// getData();
|
|
|
|
|
connectWebSocket();
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.inspection-container {
|
|
|
|
|