更新飞行界面,更换python接口
parent
0c70023e30
commit
1078b2b0aa
|
|
@ -31,10 +31,11 @@ VITE_GLOB_MEDIALIBRARY_IMAGE_URL = http://175.27.168.120:6013/test/
|
|||
VITE_GLOB_APP_HEADER_TITLE = 低空数智平台
|
||||
|
||||
VITE_GLOB_PY_URL = http://192.168.10.131:9309
|
||||
VITE_GLOB_PY_WS_URL = ws://192.168.10.131:9309
|
||||
|
||||
VITE_GLOB_MQTT_URL = wrj.wisestcity.com
|
||||
VITE_GLOB_MQTT_PORT = 6010
|
||||
|
||||
VITE_GLOB_APP_RTMP_URL = rtmp://wrj.wisestcity.com:8081
|
||||
VITE_GLOB_APP_FLV_URL = http://wrj.wisestcity.com:8081
|
||||
VITE_GLOB_APP_RTMP_URL = rtmp://wrj.wisestcity.com:1986
|
||||
VITE_GLOB_APP_FLV_URL = http://wrj.wisestcity.com:1986
|
||||
VITE_GLOB_SRS_API_URL = http://wrj.wisestcity.com:1985
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div :class="`${prefixCls}-toolbar`" class="flex items-center px-2 py-1">
|
||||
<template v-for="item in toolbarItemList" :key="item.type">
|
||||
<Tooltip placement="bottom" v-bind="item.disabled ? { visible: false } : {}">
|
||||
<Tooltip placement="bottom" v-bind="item.disabled ? { open: false } : {}">
|
||||
<template #title>{{ item.tooltip }}</template>
|
||||
<span :class="`${prefixCls}-toolbar__icon`" v-if="item.icon" @click="onControl(item)">
|
||||
<Icon
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@
|
|||
</a-tooltip>
|
||||
|
||||
|
||||
<a-popover placement="bottom" v-if="props.splitPlugin" v-model:visible="splitPanelVisible">
|
||||
<a-popover placement="bottom" v-if="props.splitPlugin" v-model:open="splitPanelVisible">
|
||||
<template #content>
|
||||
<div class="split-panel">
|
||||
<p class="split-panel-item" @click="handlerDrawLineString()">绘制线分割</p>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div :class="prefixCls">
|
||||
<Popover
|
||||
v-model:visible="visible"
|
||||
v-model:open="visible"
|
||||
title=""
|
||||
trigger="click"
|
||||
:overlayClassName="`${prefixCls}__overlay`"
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ class LiveStreamPlugin {
|
|||
src: live_url + '.flv', // 播放地址
|
||||
},
|
||||
],
|
||||
licenseUrl: live_url + '.flv', // license 地址,必传。参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
|
||||
autoplay: true, // 是否自动播放
|
||||
});
|
||||
}, 1000);
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ export function getAppEnvConfig() {
|
|||
VITE_GLOB_FILE_PREVIEW,
|
||||
VITE_GLOB_APP_HEADER_TITLE,
|
||||
VITE_GLOB_PY_URL,
|
||||
VITE_GLOB_PY_WS_URL,
|
||||
VITE_GLOB_MQTT_URL,
|
||||
VITE_GLOB_MQTT_PORT,
|
||||
VITE_GLOB_APP_RTMP_URL,
|
||||
|
|
@ -70,6 +71,7 @@ export function getAppEnvConfig() {
|
|||
VITE_GLOB_FILE_PREVIEW,
|
||||
VITE_GLOB_APP_HEADER_TITLE,
|
||||
VITE_GLOB_PY_URL,
|
||||
VITE_GLOB_PY_WS_URL,
|
||||
VITE_GLOB_MQTT_URL,
|
||||
VITE_GLOB_MQTT_PORT,
|
||||
VITE_GLOB_APP_RTMP_URL,
|
||||
|
|
|
|||
|
|
@ -651,7 +651,6 @@
|
|||
import { ref, watch, onMounted, onBeforeUnmount, computed, nextTick } from 'vue';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { getAppEnvConfig } from '@/utils/env';
|
||||
const { VITE_GLOB_MEDIALIBRARY_IMAGE_URL } = getAppEnvConfig();
|
||||
|
||||
const props = defineProps(['recordList', 'nowRecord', 'groupIndex', 'isEdit', 'graffitiColor']);
|
||||
const emits = defineEmits(['chooseNowImageGroup']);
|
||||
|
|
|
|||
|
|
@ -68,8 +68,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<!-- 飞行器控制盒 -->
|
||||
<!-- <div class="uav-box" ref="uavBox" v-if="uavBoxVisible"> -->
|
||||
<div class="uav-box" ref="uavBox" v-if="1">
|
||||
<div class="uav-box" ref="uavBox" v-if="uavBoxVisible">
|
||||
<UavBox @closeUavBox="uavBoxVisible = false" @flyLog="logVisible = true" @flyTo="flyTobtn" @patrol="patrolbtn"
|
||||
@taskSubmitted="handleTaskSubmitted" />
|
||||
</div>
|
||||
|
|
@ -203,7 +202,8 @@ import axios from 'axios';
|
|||
import TCPlayer from 'tcplayer.js';
|
||||
import 'tcplayer.js/dist/tcplayer.min.css'; //引入插件和样式文件
|
||||
import { io, Socket } from 'socket.io-client';
|
||||
|
||||
import { getAppEnvConfig } from '@/utils/env';
|
||||
const { VITE_GLOB_PY_WS_URL } = getAppEnvConfig();
|
||||
// 消息提示实例
|
||||
const { createConfirm, createMessage } = useMessage();
|
||||
// 飞行器控制盒引用
|
||||
|
|
@ -260,7 +260,7 @@ const flyToVisible = ref(false);
|
|||
// Socket相关
|
||||
const socket = ref<Socket | null>(null);
|
||||
const socketConnected = ref(false);
|
||||
const socketUrl = ref('http://localhost:5000'); // Socket服务器地址
|
||||
const socketUrl = ref(`${VITE_GLOB_PY_WS_URL}`); // Socket服务器地址
|
||||
|
||||
// 连接Socket服务
|
||||
const connectSocket = () => {
|
||||
|
|
@ -424,7 +424,7 @@ watch(
|
|||
() => {
|
||||
nextTick(() => {
|
||||
if (myDiv.value) {
|
||||
myDiv.value.scrollTop = myDiv.value.scrollHeight;
|
||||
(myDiv.value as HTMLElement).scrollTop = (myDiv.value as HTMLElement).scrollHeight;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -648,8 +648,7 @@ const getRtmpList = () => {
|
|||
// 检查直播流是否活跃
|
||||
if (res.data.streams[index].publish.active) {
|
||||
// 播放直播
|
||||
player.src(live_info.url + liveCode.value + '.flv');
|
||||
player.play();
|
||||
reloadLive()
|
||||
// 记录日志
|
||||
airPortStoreVal.setflyLog({
|
||||
type: 'success',
|
||||
|
|
@ -690,8 +689,21 @@ const startLiveFun = () => {
|
|||
};
|
||||
// 重新加载直播
|
||||
const reloadLive = () => {
|
||||
player.src(live_info.url + liveCode.value + '.flv');
|
||||
let liveUrl = `${live_info.url}/${liveCode.value}.flv`
|
||||
if(player){
|
||||
player.src(liveUrl);
|
||||
player.play();
|
||||
}else{
|
||||
// 初始化视频播放器
|
||||
player = TCPlayer('player-container-id', {
|
||||
sources: [
|
||||
{
|
||||
src: liveUrl, // 播放地址
|
||||
},
|
||||
],
|
||||
autoplay: true, // 是否自动播放
|
||||
});
|
||||
}
|
||||
};
|
||||
// 停止直播任务ID
|
||||
const stopTid = buildGUID();
|
||||
|
|
@ -827,7 +839,7 @@ onMounted(() => {
|
|||
// 监听键盘事件
|
||||
document.addEventListener('keydown', handleKeyDown);
|
||||
document.addEventListener('keyup', handleKeyUp);
|
||||
|
||||
if (liveVisible.value && live_info) {
|
||||
// 初始化视频播放器
|
||||
player = TCPlayer('player-container-id', {
|
||||
sources: [
|
||||
|
|
@ -835,9 +847,10 @@ onMounted(() => {
|
|||
src: live_info.url + liveCode.value + '.flv', // 播放地址
|
||||
},
|
||||
],
|
||||
licenseUrl: live_info.url + liveCode.value + '.flv', // license 地址,必传
|
||||
autoplay: true, // 是否自动播放
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 监听位置获取事件
|
||||
EventBus.on('obtainTheLocation', (val: any) => {
|
||||
|
|
|
|||
|
|
@ -463,7 +463,7 @@
|
|||
</div>
|
||||
<!-- 快捷键提示弹窗 -->
|
||||
<a-modal
|
||||
v-model:visible="shortcutVisible"
|
||||
v-model:open="shortcutVisible"
|
||||
title="快捷键"
|
||||
width="1000px"
|
||||
height="500px"
|
||||
|
|
@ -1644,15 +1644,23 @@
|
|||
setTimeout(() => {
|
||||
liveCode.value = uavInfo.sn;
|
||||
const initVideoUrl = isAiVideo.value && aiLiveUrl.value ? aiLiveUrl.value : live_info.url + liveCode.value + '.flv';
|
||||
try{
|
||||
player = TCPlayer('player-container-id-live', {
|
||||
sources: [
|
||||
{
|
||||
src: initVideoUrl, // 播放地址
|
||||
},
|
||||
],
|
||||
licenseUrl: initVideoUrl, // license 地址,必传。参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
|
||||
autoplay: true, // 是否自动播放
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('视频播放失败:', error);
|
||||
airPortStoreVal.setflyLog({
|
||||
type: 'error',
|
||||
title: '视频播放',
|
||||
content: '失败: ' + (error.message || '未知错误'),
|
||||
});
|
||||
}
|
||||
getRtmpList();
|
||||
let receivedMessages = {};
|
||||
getClient().on('message', (topic, message) => {
|
||||
|
|
|
|||
|
|
@ -137,7 +137,6 @@
|
|||
src: live_info.url + liveCode.value + '.flv', // 播放地址
|
||||
},
|
||||
],
|
||||
licenseUrl: live_info.url + liveCode.value + '.flv', // license 地址,必传。参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
|
||||
autoplay: true, // 是否自动播放
|
||||
});
|
||||
getClient().on('message', (topic, message) => {
|
||||
|
|
@ -145,12 +144,28 @@
|
|||
if (rs.method == 'live_start_push' && rs.tid == startTid) {
|
||||
if (rs.data.result == 0) {
|
||||
createMessage.success('开始直播成功');
|
||||
if (player) {
|
||||
try {
|
||||
player.src(live_info.url + liveCode.value + '.flv');
|
||||
player.play();
|
||||
player.play().catch((error) => {
|
||||
console.error('视频播放失败:', error);
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('设置视频源失败:', error);
|
||||
}
|
||||
}
|
||||
} else if (rs.data.result == 513003) {
|
||||
createMessage.success('直播已开启');
|
||||
if (player) {
|
||||
try {
|
||||
player.src(live_info.url + liveCode.value + '.flv');
|
||||
player.play();
|
||||
player.play().catch((error) => {
|
||||
console.error('视频播放失败:', error);
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('设置视频源失败:', error);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
createMessage.error('开始直播失败,' + errorName(rs.data.result));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,13 +216,24 @@
|
|||
maxTime: 0,
|
||||
});
|
||||
const playVideo = () => {
|
||||
// 销毁之前的播放器实例
|
||||
if (player) {
|
||||
try {
|
||||
player.dispose();
|
||||
player = null;
|
||||
} catch (error) {
|
||||
console.error('销毁播放器失败:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// 创建新的播放器实例
|
||||
player = TCPlayer('player-container-id-live', {
|
||||
sources: [
|
||||
{
|
||||
src: live_info.url + liveCode.value + '.flv', // 播放地址
|
||||
},
|
||||
],
|
||||
licenseUrl: live_info.url + liveCode.value + '.flv', // license 地址,必传。参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
|
||||
autoplay: true, // 是否自动播放
|
||||
});
|
||||
};
|
||||
const stopTid = buildGUID();
|
||||
|
|
@ -240,8 +251,21 @@
|
|||
emits('loadLiveStreaming');
|
||||
};
|
||||
const reloadLive = () => {
|
||||
if (player) {
|
||||
try {
|
||||
player.src(live_info.url + liveCode.value + '.flv');
|
||||
player.play();
|
||||
player.play().catch((error) => {
|
||||
console.error('视频播放失败:', error);
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('重新加载视频失败:', error);
|
||||
// 重新初始化播放器
|
||||
playVideo();
|
||||
}
|
||||
} else {
|
||||
// 如果播放器不存在,重新初始化
|
||||
playVideo();
|
||||
}
|
||||
};
|
||||
onMounted(() => {
|
||||
console.log(props.uavStatus);
|
||||
|
|
@ -267,12 +291,28 @@
|
|||
if (rs.method == 'live_start_push' && rs.tid == startTid) {
|
||||
if (rs.data.result == 0) {
|
||||
createMessage.success('无人机开始直播成功');
|
||||
if (player) {
|
||||
try {
|
||||
player.src(live_info.url + liveCode.value + '.flv');
|
||||
player.play();
|
||||
player.play().catch((error) => {
|
||||
console.error('视频播放失败:', error);
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('设置视频源失败:', error);
|
||||
}
|
||||
}
|
||||
} else if (rs.data.result == 513003) {
|
||||
createMessage.success('无人机直播已开启');
|
||||
if (player) {
|
||||
try {
|
||||
player.src(live_info.url + liveCode.value + '.flv');
|
||||
player.play();
|
||||
player.play().catch((error) => {
|
||||
console.error('视频播放失败:', error);
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('设置视频源失败:', error);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
createMessage.error('开始直播失败,' + errorName(rs.data.result));
|
||||
}
|
||||
|
|
@ -288,16 +328,32 @@
|
|||
} else if (rs.method == 'live_set_quality' && rs.tid == qualityTid) {
|
||||
if (rs.data.result == 0) {
|
||||
createMessage.success('无人机设置清晰度成功');
|
||||
if (player) {
|
||||
try {
|
||||
player.src(live_info.url + '4.flv');
|
||||
player.play();
|
||||
player.play().catch((error) => {
|
||||
console.error('视频播放失败:', error);
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('设置视频源失败:', error);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
createMessage.error('无人机设置清晰度失败,' + errorName(rs.data.result));
|
||||
}
|
||||
} else if (rs.method == 'live_lens_change' && rs.tid == lensTid) {
|
||||
if (rs.data.result == 0) {
|
||||
createMessage.success('无人机设置直播镜头成功');
|
||||
if (player) {
|
||||
try {
|
||||
player.src(live_info.url + liveCode.value + '.flv');
|
||||
player.play();
|
||||
player.play().catch((error) => {
|
||||
console.error('视频播放失败:', error);
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('设置视频源失败:', error);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
createMessage.error('无人机设置直播镜头失败,' + errorName(rs.data.result));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@
|
|||
</div>
|
||||
<div class="table-title-item" style="width: 57px;border-right: 0px;">编辑</div>
|
||||
</div>
|
||||
<div class="setting-table-item" v-for="item in project.userIds">
|
||||
<div class="setting-table-item" v-for="item in project.userIds" v-if="item">
|
||||
<div class="table-item-col" style="width: 119px;padding-left: 12px; justify-content: start;">
|
||||
{{ item.name }}
|
||||
<div class="user-icon" v-if="userId == item.id"></div>
|
||||
|
|
@ -172,7 +172,7 @@
|
|||
</div>
|
||||
<div class="table-title-item" style="width: 57px;border-right: 0px;">编辑</div>
|
||||
</div>
|
||||
<div class="setting-table-item" v-for="item in project.deviceIds">
|
||||
<div class="setting-table-item" v-for="item in project.deviceIds" v-if="item">
|
||||
<div class="table-item-col" style="width: 119px;padding-left: 12px; justify-content: start;">
|
||||
{{item.name}}
|
||||
<div class="time-icon"></div>
|
||||
|
|
@ -252,21 +252,19 @@ watch(() => props.addModal, (newValue) => {
|
|||
project.value.userIds.push(user)
|
||||
}
|
||||
}else if(newValue && props.modalType == 'update'){
|
||||
let userId = props.updateProject.users.map(item => item.id)
|
||||
let userlist = userList.value.filter(item => userId.includes(item.id))
|
||||
// let deviceId = props.updateProject.lasaDronePort.map(item => item.id)
|
||||
// let deviceArray = deviceList.value.filter(item => deviceId.includes(item.id))
|
||||
let userIds = props.updateProject?.users?.map(item => item.id) || []
|
||||
let userlist = userList.value.filter(item => userIds.includes(item.id))
|
||||
project.value = {
|
||||
...props.updateProject.workspace,
|
||||
requestCodeCutOffTime: props.updateProject.workspace.requestCodeCutOffTime? dayjs(props.updateProject.workspace.requestCodeCutOffTime): '',
|
||||
...props.updateProject?.workspace || {},
|
||||
requestCodeCutOffTime: props.updateProject?.workspace?.requestCodeCutOffTime? dayjs(props.updateProject.workspace.requestCodeCutOffTime): '',
|
||||
userIds: userlist,
|
||||
lockfly: props.updateProject.lasaSpaceLockFlies,
|
||||
deviceIds: props.updateProject.lasaDronePort
|
||||
lockfly: props.updateProject?.lasaSpaceLockFlies || [],
|
||||
deviceIds: props.updateProject?.lasaDronePort || []
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const userId = localStorage.getItem('userid')
|
||||
const userId = parseInt(localStorage.getItem('userid') || '-1')
|
||||
const childSetting = ref({
|
||||
open: false,
|
||||
type: ''
|
||||
|
|
@ -330,16 +328,18 @@ const deviceList = ref([])
|
|||
|
||||
onMounted(() => {
|
||||
getAccountList({page:1,limit:999}).then(res => {
|
||||
userList.value = res.items
|
||||
userList.value = res.items || []
|
||||
if(userId == -1){
|
||||
project.value.userIds.push({id:-1,name:'超级管理员',role:'超级管理员'})
|
||||
return
|
||||
}
|
||||
let user = userList.value.find(item => item.id == userId)
|
||||
if(user){
|
||||
project.value.userIds.push(user)
|
||||
}
|
||||
})
|
||||
GetUavList().then(res => {
|
||||
deviceList.value = res
|
||||
deviceList.value = res || []
|
||||
})
|
||||
})
|
||||
const closeAddModal = () => {
|
||||
|
|
|
|||
|
|
@ -171,6 +171,7 @@ export interface GlobEnvConfig {
|
|||
VITE_GLOB_FILE_PREVIEW?: string;
|
||||
VITE_GLOB_APP_HEADER_TITLE?: string;
|
||||
VITE_GLOB_PY_URL?: string;
|
||||
VITE_GLOB_PY_WS_URL?: string;
|
||||
VITE_GLOB_MQTT_URL?: string;
|
||||
VITE_GLOB_MQTT_PORT?: number;
|
||||
VITE_GLOB_APP_RTMP_URL?: string;
|
||||
|
|
|
|||
Loading…
Reference in New Issue