无人机、监控列表

This commit is contained in:
2025-12-25 21:30:27 +08:00
parent 6a6ddba71a
commit e76b5075b2
6 changed files with 197 additions and 249 deletions

View File

@@ -24,6 +24,7 @@ import { ElMessage } from 'element-plus'
import { monitors, uavs, stations, environmentals, fences, detailFences } from './js/mock.js'
import InfoWindowComponent from '@/components/Map/window/index.vue'
import TrawlerInfoWindowComponent from '@/components/Map/window/trawler.vue'
import { videoCameraFindPage, findUavPage, findEnvPage, dsVideoList } from '@/api/device.js'
const mapStore = useMapStore()
const UAV = computed(() => mapStore.legend.UAV)
@@ -313,12 +314,30 @@ const addEnvironmentalToMap = () => {
}
const initUAV = () => {
geography.UAV = uavs
addUAVToMap()
const params = {
pageNo: 1,
pageSize: 9999
}
findUavPage(params).then(res => {
if (res.success) {
geography.UAV = res.result.records
addUAVToMap()
}
})
}
const initMonitor = () => {
geography.monitor = monitors
const params = {
pageNo: 1,
pageSize: 9999
}
videoCameraFindPage(params).then(res => {
if (res.success) {
geography.monitor = res.result.records
addMonitorToMap()
}
})
}
const initAisStation = () => {
geography.ais_station = stations

View File

@@ -1,219 +1,27 @@
<template>
<div class="content-wrapper">
<div class="left-wrapper">
<div class="uav-button" @click="handleAlgorithm">{{algorithmStatus ? '关闭' : '开启'}}算法</div>
<div class="Form">
<el-checkbox-group v-model="algorithmValue">
<el-checkbox
v-for="item in algorithms"
:key="item.value"
:label="item.label"
:value="item.value" />
</el-checkbox-group>
</div>
<div class="flv-container"><FlvPlayerComponent v-if="uavDialog.url" id="uav" :url="uavDialog.url"/></div>
</div>
<div class="resize-handle" @mousedown="startResize"></div>
<div class="right-wrapper">
<CockpitCom v-if="uavDialog.visible"/>
</div>
<iframe :src="url" frameborder="no" style="width: 100%; height: 100%" scrolling="auto" />
</div>
</template>
<script setup>
import { computed, reactive, ref } from 'vue'
import { computed } from 'vue'
import useMapStore from '@/store/modules/map'
import FlvPlayerComponent from '@/components/FlvPlayer/index.vue'
import CockpitCom from '@/views/business/drone/cockpit.vue'
const mapStore = useMapStore()
const data = computed(() => mapStore.windowInfo.data)
// 算法开启关闭状态
const algorithmStatus = ref(false)
const algorithms = [
{ value: 120000, label: 'AIS挂牌/船牌识别' },
{ value: 140000, label: '船型识别' },
{ value: 139000, label: '未穿救生衣' },
{ value: 140009, label: '未悬挂国旗' },
{ value: 140008, label: '未封舱' }
]
const algorithmValue = ref([])
const uavDialog = reactive({
visible: false,
url: ''
})
// 添加分割线相关的响应式数据
const isResizing = ref(false)
const leftWidth = ref('462px')
const rightWidth = ref('1391px')
const containerWidth = ref(0)
let containerBoundsLeft = 0 // 容器左边界
// 开启/关闭算法
const handleAlgorithm = () => {
if(algorithmStatus.value) {
closeAlgorithm()
} else {
let enable_orc = false
const valueArray = [ ...algorithmValue.value ]
const index = valueArray.indexOf(120000)
if (index > -1) {
valueArray.splice(index, 1)
enable_orc = true
}
const params = {
class_codes: valueArray.join(','),
enable_orc,
status: 'start',
sn: data.value.droneSn
}
// doStartOrStopUavAlgorithm(params).then(res => {
// if(res.success) {
// algorithmStatus.value = true
// ElMessage.success('算法已开启')
// }else {
// ElMessage.error(res.result)
// }
// })
}
}
// 添加分割线控制相关方法
const startResize = (e) => {
isResizing.value = true
const containerRect = e.target.parentElement.getBoundingClientRect()
containerWidth.value = containerRect.width
// 保存容器的左边界位置
containerBoundsLeft = containerRect.left
document.addEventListener('mousemove', resize)
document.addEventListener('mouseup', stopResize)
}
const resize = (e) => {
if (isResizing.value) {
// 使用预先保存的容器左边界
const offsetX = e.clientX - containerBoundsLeft
// 计算左侧宽度百分比
let leftPercent = offsetX / containerWidth.value * 100
// 限制左右两侧的最小宽度
const minRightWidth = 1391
const minLeftWidth = 200
// 计算右侧最小百分比
const minRightPercent = minRightWidth / containerWidth.value * 100
const minLeftPercent = minLeftWidth / containerWidth.value * 100
// 限制拖动范围
if (leftPercent < minLeftPercent) {
leftPercent = minLeftPercent
} else if (leftPercent > 100 - minRightPercent) {
leftPercent = 100 - minRightPercent
}
leftWidth.value = `${leftPercent}%`
rightWidth.value = `${100 - leftPercent}%`
}
}
const stopResize = () => {
isResizing.value = false
document.removeEventListener('mousemove', resize)
document.removeEventListener('mouseup', stopResize)
}
const url = computed(() => 'https://lbs.baidu.com/maptool/getpoint')
console.log(data.value.droneSn, 'data.value.droneSn')
</script>
<style lang="scss" scoped>
// 无人机弹窗
.content-wrapper{
display: flex;
position: relative;
height: 100%;
video{
height: 850px;
iframe{
width: 100%;
height: 830px;
object-fit: fill;
}
// //播放按钮
video::-webkit-media-controls-play-button{display: none;}
//进度条
video::-webkit-media-controls-timeline{display: none;}
//观看的当前时间
video::-webkit-media-controls-current-time-display{display: none;}
//剩余时间
video::-webkit-media-controls-time-remaining-display{display: none;}
//音量按钮
video::-webkit-media-controls-mute-button{display: none;}
video::-webkit-media-controls-toggle-closed-captions-buttonf{display: none;}
//1音量的控制条
video::-webkit-media-controls-volume-slider{display: none;}
video::-webkit-media-controls-enclosuret{display: none;}
.uav-button{
width: fit-content;
cursor: pointer;
color: #00c0ff;
padding: 6px 10px;
background: rgba(22, 119, 255, 0.21);
border-radius: 2px 2px 2px 2px;
border: 1px solid #236ACE;
color: rgba(255, 255, 255, 0.9);
}
.left-wrapper{
// width: 60%;
width: v-bind(leftWidth);
height: 830px;
display: flex;
flex-direction: column;
gap: 10px;
.el-checkbox-group{
gap: 4px !important;
.el-checkbox{
width: 150px !important;
padding-left: 5px !important;
}
}
.flv-container{
flex: 1; // 占据剩余空间
overflow: hidden; // 隐藏溢出内容
}
}
.resize-handle {
width: 8px;
height: 100%;
background: transparent;
cursor: col-resize;
position: relative;
user-select: none;
z-index: 10;
&::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 2px;
// height: 40px;
background: #fff;
}
&:hover {
background: transparent;
}
}
.right-wrapper{
// width: 40%;
width: v-bind(rightWidth);
height: 830px;
// position: absolute;
// right: 0;
flex: 1;
}
.temporary{
position: absolute;
right: 0'';
right: 0;
top: 48px;
z-index: 999;
width: 1069px;
height: 429px;
}
}
</style>