徐景良 5 days ago
commit 95b239bc70

@ -8,6 +8,8 @@ enum Api {
SaveHandFlyTask = '/api/Manage/SaveHandFlyTask',
CallAiModel = '/api/Manage/CallAiModel',
EndHandFlyTask = '/api/Manage/EndHandFlyTask',
GetLastHandFlyTask = '/api/Manage/GetLastHandFlyTask',
EndAiInspection = '/api/Manage/EndAiInspection',
}
export function getVerifyToken(token) {
@ -46,7 +48,20 @@ export function callAiModel(params) {
export function endHandFlyTask(params) {
return defHttp.post({
url: Api.EndHandFlyTask + '?taskid = ' + params.taskid,
url: Api.EndHandFlyTask + '?taskid=' + params.taskid,
params,
});
}
export function endAiInspection(params) {
return defHttp.post({
url: Api.EndAiInspection + '?taskid=' + params.taskid,
params,
});
}
export function getLastHandFlyTask() {
return defHttp.get({
url: Api.GetLastHandFlyTask,
});
}

@ -0,0 +1,17 @@
export default {
mounted(el, binding) {
const speed = binding.value || 0.3 // 默认滚动系数 0.3
const handler = (e) => {
e.preventDefault() // 阻止默认滚动
el.scrollTop += e.deltaY * speed
}
el.__slowScrollHandler__ = handler
el.addEventListener("wheel", handler, { passive: false })
},
unmounted(el) {
el.removeEventListener("wheel", el.__slowScrollHandler__)
delete el.__slowScrollHandler__
}
}

@ -36,11 +36,13 @@ import Antd from 'ant-design-vue';
import { signal } from './utils/signalR';
import VueDragResize from 'vue-drag-resize/src';
import slowScroll from './directives/slowScroll'
async function bootstrap() {
const app = createApp(App);
app.use(VueDragResize);
app.use(Antd);
app.directive('slow-scroll', slowScroll)
// Configure store
// 配置 store

@ -43,6 +43,7 @@ export function getAppEnvConfig() {
VITE_GLOB_APP_VERSIONS,
VITE_GLOB_FILE_PREVIEW,
VITE_GLOB_APP_HEADER_TITLE,
VITE_GLOB_PY_URL,
} = ENV;
let { VITE_GLOB_API_URL } = ENV;
if (localStorage.getItem(API_ADDRESS)) {
@ -63,6 +64,7 @@ export function getAppEnvConfig() {
VITE_GLOB_APP_VERSIONS,
VITE_GLOB_FILE_PREVIEW,
VITE_GLOB_APP_HEADER_TITLE,
VITE_GLOB_PY_URL,
};
}

@ -1,6 +1,12 @@
<template>
<div ref="scrollBox" class="show-image-div">
<a-image-preview-group>
<a-image-preview-group
:preview="{
visible: previewVisible,
current: currentIndex,
onVisibleChange: handleVisibleChange
}"
>
<a-image
v-for="(value, index) in props.showInfoData.aiAchievementDetailList"
:key="index"
@ -10,19 +16,22 @@
class="image-item"
:src="`${value.image}`"
:img-props="{ loading: 'lazy' }"
@click="openPreview(index)"
/>
</a-image-preview-group>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, onBeforeUnmount, defineProps } from "vue";
import { ref, onMounted, onBeforeUnmount, defineProps, defineExpose } from "vue";
import { getAppEnvConfig } from '@/utils/env';
const { VITE_GLOB_API_URL } = getAppEnvConfig();
const props = defineProps(['showInfoData'])
const scrollBox = ref<HTMLElement | null>(null);
const previewVisible = ref(false)
const currentIndex = ref(0)
onMounted(() => {
const el = scrollBox.value;
@ -42,6 +51,21 @@ onMounted(() => {
el.addEventListener("wheel", onWheel, { passive: false });
onBeforeUnmount(() => el.removeEventListener("wheel", onWheel));
});
//
const openPreview = (index) => {
console.log("点击了第", index, "张图片")
currentIndex.value = index
previewVisible.value = true
}
//
const handleVisibleChange = (val) => {
previewVisible.value = val
}
defineExpose({
openPreview
})
</script>
<style lang="scss" scoped>

@ -17,7 +17,7 @@
:showInfoData="showInfoData"
@closeDetailsInfo="closeDetailsInfo"
/>
<ShowImage v-if="detailsInfoShow" :showInfoData="showInfoData"/>
<ShowImage ref="showImageRef" v-if="detailsInfoShow" :showInfoData="showInfoData"/>
</div>
</template>
<script lang="ts" setup>
@ -33,6 +33,7 @@
const airLineForm = ref({});
const map = ref()
const graphicLayer = ref()
const showImageRef = ref()
watch(() => map.value, (val) => {
if (val) {
@ -45,25 +46,44 @@
}
const changeLeftMenuShow = (item) => {
graphicLayer.value?.clear()
GetAiAchievement({id:item.id}).then(res => {
showInfoData.value = res
const position:any = [res.lng, res.lat]
const pointGraphic = new mars3d.graphic.BillboardEntity({
position: position,
style: {
image: '/projecthome/project_location.png',
width: 53,
height: 97,
scale: 1,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
clampToGround: true,
}
})
map.value?.flyToPoint(position);
graphicLayer.value?.clear()
graphicLayer.value?.addGraphic(pointGraphic)
detailsInfoShow.value = true;
// 2.
res.aiAchievementDetailList.forEach((item, index) => {
const bottomPos = Cesium.Cartesian3.fromDegrees(item.lng, item.lat, 0)
const topPos = Cesium.Cartesian3.fromDegrees(item.lng, item.lat, 100)
const line = new mars3d.graphic.PolylineEntity({
positions: [bottomPos, topPos],
style: {
width: 2,
color: "#ffffff"
}
})
graphicLayer.value?.addGraphic(line)
const graphic = new mars3d.graphic.BillboardEntity({
position: topPos,
style: {
image: item.image, //
width: 80, //
height: 60, //
// scale: 0.1, //
clampToGround: false,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM
}
})
graphic.on(mars3d.EventType.click, function (event) {
console.log("点击了图片", item.image, item.id, index)
showImageRef.value.openPreview(index)
})
graphicLayer.value?.addGraphic(graphic)
})
})
}
//

@ -76,7 +76,7 @@
<div>颜色</div>
<div>置信度</div>
</div>
<div class="tag-list-content">
<div class="tag-list-content" v-slow-scroll="0.05">
<div class="list-item" v-for="item in tagsShowList">
<a-checkbox class="item-checkbox" :checked="tagsList.includes(item.id)" @click="changeChecked(item.id)"></a-checkbox>
<div style="width: 72px;margin-right: 60px;" class="item-span">{{item.pName}}</div>

@ -58,7 +58,7 @@
<div class="table-title-item">推荐置信度</div>
<div class="table-title-item" style="width: 55px;justify-content: center;">操作</div>
</div>
<div class="label-table-content">
<div class="label-table-content" v-slow-scroll="0.05">
<div class="table-row" v-for="(item,index) in modelLabels" :key="index">
<div class="table-item">
<a-input class="table-item-input" v-model:value="item.enumValue"/>

@ -73,10 +73,13 @@
@changeCameraType="changeCameraType"
/>
<div class="intelligent-patrol" v-if="taskId">
<div @click="patrolClick">
<div @click="stopPatrolClick" v-if="stopPatrolVisible">
<span> <RadarChartOutlined /> </span>
<span v-if="stopPatrolVisible"></span>
<span v-else></span>
<span>停止巡检</span>
</div>
<div @click="patrolClick" v-else>
<span> <RadarChartOutlined /> </span>
<span>智能巡检</span>
</div>
<!-- <div @click="reportVisible = true">
<span> <AlertOutlined /></span>
@ -112,9 +115,11 @@
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';
import { endAiInspection, getLastHandFlyTask } from '@/api/workmanagement/droneDock';
import io from 'socket.io-client';
import { getAppEnvConfig } from '@/utils/env';
const { VITE_GLOB_PY_URL } = getAppEnvConfig();
let socket;
const zIndex = ref(0);
const airPortStoreVal = airPortStore();
@ -146,26 +151,24 @@
const taskId = ref(airPortStoreVal.getTaskId);
const patrolClick = () => {
console.log('patrolClick', airPortStoreVal.getTaskId);
if (airPortStoreVal.getTaskId) {
endHandFlyTask({
taskid: airPortStoreVal.getTaskId,
}).then((res) => {
if (res) {
if (socket) {
socket.disconnect();
}
airPortStoreVal.setTaskId(null);
stopPatrolVisible.value = false;
}
});
} else {
zIndex.value++;
patrolVisible.value = true;
}
zIndex.value++;
patrolVisible.value = true;
};
const stopPatrolVisible = ref(false);
console.log('airPortStoreVal', airPortStoreVal.getTaskId);
const stopPatrolClick = () => {
endAiInspection({
taskid: airPortStoreVal.getTaskId,
}).then((res) => {
if (res) {
if (socket) {
socket.disconnect();
}
airPortStoreVal.setTaskId(null);
stopPatrolVisible.value = false;
}
});
};
if (airPortStoreVal.getTaskId) {
stopPatrolVisible.value = true;
}
@ -176,10 +179,22 @@
patrolVisible.value = false;
};
onMounted(() => {
socket = io('http://192.168.10.131:9025');
// socket = io('http://123.132.248.154:9309');
socket = io(VITE_GLOB_PY_URL);
destroyConnection();
createConnection(connectCallback);
getLastHandFlyTask().then((res) => {
if (res.Status == 1) {
//
airPortStoreVal.setTaskId(res.Id);
taskId.value = res.Id;
stopPatrolVisible.value = false;
} else if (res.Status == 6) {
//
airPortStoreVal.setTaskId(res.Id);
taskId.value = res.Id;
stopPatrolVisible.value = true;
}
});
setTimeout(() => {
//
getClient().on('message', (topic, message) => {

@ -190,9 +190,11 @@
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 { endHandFlyTask, endAiInspection } from '@/api/workmanagement/droneDock';
import io from 'socket.io-client';
import { getAppEnvConfig } from '@/utils/env';
const { VITE_GLOB_PY_URL } = getAppEnvConfig();
let socket;
const props = defineProps({
zIndex: Number,
@ -349,12 +351,18 @@
if (airPortStoreVal.getTaskId) {
endHandFlyTask({
taskid: airPortStoreVal.getTaskId,
}).then((res) => {
if (res) {
airPortStoreVal.setTaskId(null);
}
});
endAiInspection({
taskid: airPortStoreVal.getTaskId,
}).then((res) => {
if (res) {
if (socket) {
socket.disconnect();
}
airPortStoreVal.setTaskId(null);
}
});
}
@ -558,8 +566,7 @@
}
};
onMounted(() => {
socket = io('http://192.168.10.131:9025');
// socket = io('http://123.132.248.154:9309');
socket = io(VITE_GLOB_PY_URL);
//
document.addEventListener('keydown', handleKeyDown);
document.addEventListener('keyup', handleKeyUp);

@ -40,7 +40,9 @@
import io from 'socket.io-client';
import { getClient, createConnection, clientSubscribe, destroyConnection } from '@/utils/mqtt';
import { airPortStore } from '@/store/modules/airport';
import { getAppEnvConfig } from '@/utils/env';
const { VITE_GLOB_PY_URL } = getAppEnvConfig();
let socket;
const airPortStoreVal = airPortStore();
@ -50,9 +52,7 @@
function connectWebSocket() {
console.log('connectWebSocket');
// Socket
socket = io('http://192.168.10.131:9025');
// socket = io('http://123.132.248.154:9309');
socket = io(VITE_GLOB_PY_URL);
//
socket.on('connect', () => {
console.log('服务连接成功');

@ -44,6 +44,7 @@
//
let player;
const liveCode = live_info.url + '7.flv';
// const liveCode = 'http://192.168.10.131:8082/flv/live/12.flv';
const playVideo = () => {
var originalElement = document.getElementById('player-container-original-live');
var player = flvjs.createPlayer({
@ -57,7 +58,10 @@
//
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 testingCode = 'http://123.132.248.154:8800/flv/live/11.flv';
const testingPlayVideo = () => {
var testingElement = document.getElementById('player-container-testing-live');
var playerTesting = flvjs.createPlayer({

@ -248,6 +248,10 @@
label:"成功",
status:5,
color:'#08ed08'
},{
label:"执行中",
status:6,
color:'#08ed08'
}
])

@ -40,13 +40,6 @@ 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}/*'],

Loading…
Cancel
Save