无人机接入
This commit is contained in:
@@ -20,13 +20,14 @@
|
||||
<div style="width: 100%;height: 100%;" :class="[`video-window${item}`]">
|
||||
<!-- 视频预览组件 -->
|
||||
<HikPlayerComponent
|
||||
v-if="haikang[item-1]?.codes"
|
||||
v-if="deviceType === '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"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -37,6 +38,8 @@
|
||||
<script setup>
|
||||
import { nextTick, onUnmounted, ref } from 'vue'
|
||||
import HikPlayerComponent from '@/components/Player/HikPlayer.vue'
|
||||
import FlvPlayerComponent from '@/components/FlvPlayer/index.vue'
|
||||
import { getVideoStream, doStartOrStopUavAlgorithm } from '@/api/uav'
|
||||
|
||||
const control = ref([
|
||||
{ label: '1X1', value: 1 },
|
||||
@@ -47,6 +50,12 @@ const control = ref([
|
||||
const active = ref(4)
|
||||
const haikang = ref([])
|
||||
const videoPreview = ref(null)
|
||||
const props = defineProps({
|
||||
deviceType: {
|
||||
type: String,
|
||||
default: () => ''
|
||||
}
|
||||
})
|
||||
|
||||
// 根据选中的分屏数计算样式
|
||||
const getStyle = () => {
|
||||
@@ -82,13 +91,33 @@ const closeVideo = (data, item) => {
|
||||
}
|
||||
// 点击视频预览
|
||||
const handleNodeClick = (node) => {
|
||||
if(node.videoCode) {
|
||||
if(props.deviceType === '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) {
|
||||
toggleFly(node)
|
||||
}
|
||||
}
|
||||
const toggleFly = (data) => {
|
||||
setTimeout(() => {
|
||||
const params = {
|
||||
status: 'stop',
|
||||
sn: data.droneSn,
|
||||
enable_orc: false
|
||||
}
|
||||
getVideoStream(params).then(res => {
|
||||
if(res.success) {
|
||||
let index = haikang.value.findIndex(i => !i)
|
||||
if(index !== -1) {
|
||||
haikang.value[index] = { codes: res.result.httpUrl }
|
||||
}
|
||||
}
|
||||
})
|
||||
}, 20000)
|
||||
}
|
||||
changeGridType(4)
|
||||
defineExpose({
|
||||
|
||||
Reference in New Issue
Block a user