Compare commits

...

2 Commits

Author SHA1 Message Date
afe078dd1d merge 2025-12-26 01:15:06 +08:00
5f52ac4956 视频树数据 2025-12-26 01:14:12 +08:00
6 changed files with 26 additions and 46 deletions

View File

@@ -5,8 +5,8 @@ VITE_WS_BASE_URL ='ws://220.185.188.222:8055/api/gisWs'
# VITE_APP_BASE_URL = 'http://125.124.131.105:6811/api'
# 成彬本地
# VITE_APP_BASE_URL = 'http://100.95.157.241:6061/api'
VITE_APP_BASE_URL = 'http://100.95.236.218:6061/api'
VITE_APP_BASE_URL = 'http://100.95.157.241:6061/api'
# VITE_APP_BASE_URL = 'http://100.95.236.218:6061/api'
# VITE_APP_BASE_URL = 'http://119.167.138.11:6061/video-service'
# 智能体访问地址

View File

@@ -24,7 +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'
import { dsVideoList, findUavPage, findEnvPage } from '@/api/device.js'
const mapStore = useMapStore()
const UAV = computed(() => mapStore.legend.UAV)
@@ -333,7 +333,7 @@ const initMonitor = () => {
pageNo: 1,
pageSize: 9999
}
videoCameraFindPage(params).then(res => {
dsVideoList(params).then(res => {
if (res.success) {
geography.monitor = res.result.records
addMonitorToMap()

View File

@@ -92,8 +92,8 @@ const getLocationSymbol = () => [
}
]
const baseConfig = {
center: [ 120.67, 28.01 ],
zoom: 12,
center: [ 120.88, 28.01 ],
zoom: 10,
maxZoom: 20,
minZoom: 5,
attribution: '',

View File

@@ -23,10 +23,10 @@
<script setup>
import { computed, nextTick, onMounted, ref } from 'vue'
// import { useStore } from 'vuex'
const mapStore = useMapStore()
const Detail = ref(null)
// const store = useStore()
// const data = computed(() => store.state.mapStore.uavs.data)
const data = computed(() => mapStore.windowInfo.data)
const ip = '198.16.74.210'
onMounted(() => {

View File

@@ -20,14 +20,14 @@
<div style="width: 100%;height: 100%;" :class="[`video-window${item}`]">
<!-- 视频预览组件 -->
<HikPlayerComponent
v-if="deviceType === 'CCTV' && haikang[item-1]?.codes"
v-if="videoType === 'CCTV' && haikang[item-1]?.codes"
ref="videoPreview"
:id="item"
:cameraIndexCode="haikang[item-1]?.codes"
:layout="haikang[item-1]?.layout"
@close="closeVideo">
</HikPlayerComponent>
<FlvPlayerComponent v-if="deviceType === 'UAV' && haikang[item-1]?.codes" :id="'uav'+item" :url="haikang[item-1]?.codes"/>
<FlvPlayerComponent v-if="videoType === 'UAV' && haikang[item-1]?.codes" :id="'uav'+item" :url="haikang[item-1]?.codes"/>
</div>
</div>
</div>
@@ -51,7 +51,7 @@ const active = ref(4)
const haikang = ref([])
const videoPreview = ref(null)
const props = defineProps({
deviceType: {
videoType: {
type: String,
default: () => ''
}
@@ -91,14 +91,14 @@ const closeVideo = (data, item) => {
}
// 点击视频预览
const handleNodeClick = (node) => {
if(props.deviceType === 'CCTV' && node.videoCode) {
if(props.videoType === 'CCTV' && node.videoCode) {
let index = haikang.value.findIndex(i => !i)
console.log(index, haikang.value, 'value')
if(index !== -1) {
haikang.value[index] = { codes: node.videoCode }
}
}
if(props.deviceType === 'UAV' && node.droneSn) {
if(props.videoType === 'UAV' && node.droneSn) {
toggleFly(node)
}
}
@@ -113,7 +113,10 @@ const toggleFly = (data) => {
if(res.success) {
let index = haikang.value.findIndex(i => !i)
if(index !== -1) {
haikang.value[index] = { codes: res.result.httpUrl }
setTimeout(() => {
haikang.value[index] = { codes: res.result.httpUrl }
}, 10000)
h
}
}
})

View File

@@ -8,7 +8,7 @@
@node-click="handleNodeClick">
<template v-slot="{ node, data }">
<!-- <img src="@/assets/images/livePreview/icon-monitor.png" alt=""> -->
<span :class="(!data.sourceType && treeType === 'UAV') ? 'offline': ''">{{ node.label }}</span>
<span :class="(data.sourceType!=='2' && treeType === 'UAV') ? 'offline': ''">{{ node.label }}</span>
</template>
</el-tree>
</div>
@@ -29,34 +29,11 @@ const refresh = (type) => {
if(type === 'CCTV') {
const params = {}
findVideoLevelList(params).then(res => {
if (res.success) {
const data = res.result.records
const groupedData = {}
data.forEach(item => {
const belong = item.videoBelong
if (!groupedData[belong]) {
groupedData[belong] = []
}
groupedData[belong].push(item)
})
// 转换为树形结构
const result = Object.keys(groupedData).map(belong => {
const children = groupedData[belong]
if (children.length === 1) {
// 只有一个子元素,直接返回该子元素
return children[0]
}
// 有多个子元素,返回分组节点
return {
videoName: belong,
longitude: children[0].longitude,
latitude: children[0].latitude,
children: children
}
})
tableData.value = result
}
const arr = []
Object.keys(res.data).forEach(i => {
arr.push({ videoName: i, children: res.data[i] })
})
tableData.value = arr
})
}else if(type === 'UAV') {
const params = {
@@ -97,10 +74,10 @@ const refresh = (type) => {
}
const handleNodeClick = (data, node) => {
if(!data.sourceType) {
return false
}
if(!data.children || data.children.length === 0) {
if(treeType.value === 'UAV' && !data.sourceType) {
return false
}
emit('handle', node.data)
}
}