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://125.124.131.105:6811/api'
# 成彬本地 # 成彬本地
# VITE_APP_BASE_URL = 'http://100.95.157.241: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://100.95.236.218:6061/api'
# VITE_APP_BASE_URL = 'http://119.167.138.11:6061/video-service' # 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 { monitors, uavs, stations, environmentals, fences, detailFences } from './js/mock.js'
import InfoWindowComponent from '@/components/Map/window/index.vue' import InfoWindowComponent from '@/components/Map/window/index.vue'
import TrawlerInfoWindowComponent from '@/components/Map/window/trawler.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 mapStore = useMapStore()
const UAV = computed(() => mapStore.legend.UAV) const UAV = computed(() => mapStore.legend.UAV)
@@ -333,7 +333,7 @@ const initMonitor = () => {
pageNo: 1, pageNo: 1,
pageSize: 9999 pageSize: 9999
} }
videoCameraFindPage(params).then(res => { dsVideoList(params).then(res => {
if (res.success) { if (res.success) {
geography.monitor = res.result.records geography.monitor = res.result.records
addMonitorToMap() addMonitorToMap()

View File

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

View File

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

View File

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

View File

@@ -8,7 +8,7 @@
@node-click="handleNodeClick"> @node-click="handleNodeClick">
<template v-slot="{ node, data }"> <template v-slot="{ node, data }">
<!-- <img src="@/assets/images/livePreview/icon-monitor.png" alt=""> --> <!-- <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> </template>
</el-tree> </el-tree>
</div> </div>
@@ -29,34 +29,11 @@ const refresh = (type) => {
if(type === 'CCTV') { if(type === 'CCTV') {
const params = {} const params = {}
findVideoLevelList(params).then(res => { findVideoLevelList(params).then(res => {
if (res.success) { const arr = []
const data = res.result.records Object.keys(res.data).forEach(i => {
const groupedData = {} arr.push({ videoName: i, children: res.data[i] })
data.forEach(item => {
const belong = item.videoBelong
if (!groupedData[belong]) {
groupedData[belong] = []
}
groupedData[belong].push(item)
}) })
// 转换为树形结构 tableData.value = arr
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
}
}) })
}else if(type === 'UAV') { }else if(type === 'UAV') {
const params = { const params = {
@@ -97,10 +74,10 @@ const refresh = (type) => {
} }
const handleNodeClick = (data, node) => { const handleNodeClick = (data, node) => {
if(!data.sourceType) { if(!data.children || data.children.length === 0) {
if(treeType.value === 'UAV' && !data.sourceType) {
return false return false
} }
if(!data.children || data.children.length === 0) {
emit('handle', node.data) emit('handle', node.data)
} }
} }