智能巡检

main
刘妍 1 week ago
parent 04abe9f77b
commit 09771f9ae3

@ -5,6 +5,8 @@ enum Api {
GetDroneDockflightInfos = '/api/DroneDock/GetDroneDockflightInfos',
GetTaskPicList = '/api/Manage/GetTaskPicList',
GetTaskVideoList = '/api/Manage/GetTaskVideoList',
SaveHandFlyTask = '/api/Manage/SaveHandFlyTask',
CallAiModel = '/api/Manage/CallAiModel',
}
export function getVerifyToken(token) {
@ -26,3 +28,17 @@ export function getTaskVideoList(params) {
url: Api.GetTaskVideoList + '?flightId=' + params.flightId + '&timestamp=' + params.timestamp,
});
}
export function saveHandFlyTask(params) {
return defHttp.post({
url: Api.SaveHandFlyTask,
params,
});
}
export function callAiModel(params) {
return defHttp.post({
url: Api.CallAiModel,
params,
});
}

@ -22,6 +22,7 @@ export const airPortStore = defineStore({
url: 'http://box.wisestcity.com:8081/live/',
},
gateway: null,
project: null,
}),
getters: {
getAirport(state) {
@ -36,6 +37,9 @@ export const airPortStore = defineStore({
getGateway(state) {
return state.gateway;
},
getProject(state) {
return state.project;
},
},
actions: {
setAirPort(item: any, value: any) {
@ -47,5 +51,8 @@ export const airPortStore = defineStore({
setGateway(value: any) {
this.gateway = value;
},
setProject(value: any) {
this.project = value;
},
},
});

@ -82,7 +82,7 @@
<span>上报事件</span>
</div>
</div>
<Patrol v-if="patrolVisible" @changePatrol="patrolVisible = false" />
<Patrol :taskId="taskId" v-if="patrolVisible" @changePatrol="patrolVisible = false" />
<Report @changeReport="reportVisible = false" v-if="reportVisible" />
</div>
</template>
@ -225,8 +225,12 @@
flyToFormVisible.value = true;
zIndex.value++;
};
const taskId = ref('');
const changeTakeOffForm = (val) => {
takeOffFormVisible.value = false;
if (val) {
taskId.value = val;
}
// if (!val) {
// setTimeout(() => {
// uavLive.value = true;

@ -59,10 +59,7 @@
<a-button type="primary" style="background: #3a57e8" @click="emits('changePatrol')"
>取消</a-button
>
<a-button
type="primary"
style="background: #0a99eb; margin-left: 20px"
@click="emits('changeLoadControl')"
<a-button type="primary" style="background: #0a99eb; margin-left: 20px" @click="submit"
>确定</a-button
>
</div>
@ -100,10 +97,16 @@
} from '@ant-design/icons-vue';
import { Map } from '../index';
import { GetAlgoInstanceList } from '@/api/demo/aiinstance';
import { airPortStore } from '@/store/modules/airport';
import { callAiModel } from '@/api/workmanagement/droneDock';
import { EventBus } from '@/utils/eventBus';
const { createMessage } = useMessage();
const emits = defineEmits(['changePatrol']);
const props = defineProps({});
const props = defineProps({
taskId: String,
type: String,
});
const data = reactive({
instantiate: null,
code: '',
@ -160,6 +163,33 @@
instantiateOptions.value = res.items;
});
};
const liveCode = ref('7');
const airPortStoreVal = airPortStore();
const live_info = airPortStoreVal.getLiveInfo;
const submit = () => {
if (props.type == 'plan') {
const querys = {
algoInstanceId: instantiateItem.value.id,
warningTitle: data.code,
warningContent: data.desc,
};
EventBus.emit('palnPatrol', querys);
}
const querys = {
taskId: props.taskId,
algoInstanceId: instantiateItem.value.id,
rtmpUrl: live_info.rtmp + liveCode.value,
warningTitle: data.code,
warningContent: data.desc,
};
callAiModel(querys).then((res) => {
console.log(res);
createMessage.success('操作成功');
emits('changePatrol');
});
};
onMounted(() => {
getList();
});

@ -57,6 +57,7 @@
airPortStoreVal.setAirPort('sn', selectVal.airport);
airPortStoreVal.setUAV('sn', selectVal.equipment);
airPortStoreVal.setGateway(selectVal.gateway);
airPortStoreVal.setProject(selectVal.project);
emits('selectChange', selectVal);
};
//

@ -118,6 +118,7 @@
import { airPortStore } from '@/store/modules/airport';
import VueDragResize from 'vue-drag-resize/src';
import { useMessage } from '@/hooks/web/useMessage';
import { saveHandFlyTask } from '@/api/workmanagement/droneDock';
const emits = defineEmits(['changeTakeOffForm']);
const props = defineProps({
@ -237,9 +238,16 @@
//
servicesTopic(querys);
services_replyTopic();
setTimeout(() => {
emits('changeTakeOffForm');
}, 1000);
saveHandFlyTask({
flightId: data.flight_id,
workspaceId: airPortStoreVal.getProject,
}).then((res) => {
if (res) {
setTimeout(() => {
emits('changeTakeOffForm', res.taskId);
}, 1000);
}
});
};
onMounted(() => {
//

@ -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 {

@ -30,7 +30,7 @@
</div>
<!-- 智能巡检 -->
<div v-if="patrolShow" class="patrol-box">
<Patrol @changePatrol="patrolShow = false"/>
<Patrol type="plan" @changePatrol="patrolShow = false"/>
</div>
<!-- 航线库 -->

@ -1,5 +1,5 @@
import { defineApplicationConfig } from '@vben/vite-config';
import { mars3dPlugin } from "vite-plugin-mars3d"
import { mars3dPlugin } from 'vite-plugin-mars3d';
export default defineApplicationConfig({
overrides: {
@ -21,10 +21,7 @@ export default defineApplicationConfig({
//...
target: 'esnext',
commonjsOptions: {
include: [
/node_modules|lib/,
/node_modules|packages/
] //这里记得把lib目录加进来否则生产打包会报错
include: [/node_modules|lib/, /node_modules|packages/], //这里记得把lib目录加进来否则生产打包会报错
},
},
server: {
@ -43,6 +40,13 @@ 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}/*'],
@ -60,10 +64,6 @@ export default defineApplicationConfig({
},
},
},
plugins: [
mars3dPlugin()
],
plugins: [mars3dPlugin()],
},
});

Loading…
Cancel
Save