From 2800fa4f32f3900509cb4d6eefaf2bfaf54efdd7 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 21 Apr 2025 18:29:09 +0800
Subject: [PATCH] fix: 天气显示
---
src/components/CurrentTaskDetails/TaskDetailsLeft.vue | 67 +++++++++++++++++++++------------
1 files changed, 42 insertions(+), 25 deletions(-)
diff --git a/src/components/CurrentTaskDetails/TaskDetailsLeft.vue b/src/components/CurrentTaskDetails/TaskDetailsLeft.vue
index 1f80069..336d9f1 100644
--- a/src/components/CurrentTaskDetails/TaskDetailsLeft.vue
+++ b/src/components/CurrentTaskDetails/TaskDetailsLeft.vue
@@ -3,7 +3,7 @@
<div class="title">负载控制</div>
<div
class="singleCol"
- v-for="item in list1"
+ v-for="item in list1.filter(i => i.show)"
@click="cameraType(item)"
:key="item.key"
:class="{ active: item.key === cameraParams.camera_type }"
@@ -21,7 +21,7 @@
<div @click="takePictures">拍照</div>
<div @click="recordFun">{{ isRecording ? '录像中...' : '录像' }}</div>
</div>
- <div class="multiCol">
+ <div class="multiCol" v-if="wsInfo?.psdk_widget_values">
<div @click="shoutFun">{{ isRecordShouting ? '喊话' : '停止喊话' }}</div>
<div @click="broadcastFun">广播</div>
</div>
@@ -36,6 +36,7 @@
:max="cameraParams.camera_type === 'ir' ? 200 : 200"
@change="sliderChange"
/>
+ <div class="cameraZoomText">{{cameraParams.zoom_factor}}X</div>
</div>
</div>
<!-- 广播列表 -->
@@ -87,11 +88,11 @@
<script setup>
import EventBus from '@/event-bus'
-import {
- callPhotoAndVideoCmd,
- cameraParamsChangeApi,
- ptzResetModeApi,
- startVoice,
+import {
+ callPhotoAndVideoCmd,
+ cameraParamsChangeApi,
+ ptzResetModeApi,
+ startVoice,
stayAwayRiver,
getVoiceFile,
playAudio,
@@ -101,16 +102,18 @@
import Recorder from 'js-audio-recorder';
import dayjs from 'dayjs'
+const wsInfo = inject('wsInfo')
// 初始化喊话
let globalShout = null
-
const isRecording = ref(false)
-
-const list1 = ref([
- { name: '广角', key: 'wide' },
- { name: '变焦', key: 'zoom' },
- { name: '红外', key: 'ir' },
-])
+const hasIr = inject('hasIr')
+const list1 = computed(() => {
+ return [
+ { name: '广角', key: 'wide',show:true },
+ { name: '变焦', key: 'zoom', show: true },
+ { name: '红外', key: 'ir',show: hasIr.value },
+ ]
+})
const cameraParams = ref({
zoom_factor: 0,
camera_type: 'wide',
@@ -143,7 +146,7 @@
// 修改相机参数
function cameraParamsChange() {
- const { camera_type, zoom_factor} = cameraParams.value
+ const { camera_type, zoom_factor } = cameraParams.value
cameraParamsChangeApi({
sn: dockSn.value,
...cameraParams.value,
@@ -176,7 +179,7 @@
const msg = isRecording.value ? '停止录像' : '开始录像'
const emitType = isRecording.value ? 'controlPanel-timeStop' : 'controlPanel-timeStart'
- callPhotoAndVideoCmd(droneSn.value, type).then(res => {
+ callPhotoAndVideoCmd(dockSn.value, type).then(res => {
ElMessage.success(msg)
EventBus.emit(emitType)
isRecording.value = !isRecording.value
@@ -185,8 +188,11 @@
// 拍照
function takePictures() {
+ if (isRecording.value) {
+ return ElMessage.warning('请先结束录像')
+ }
// photo拍照,video_start开始录像,video_stop结束录像
- callPhotoAndVideoCmd(droneSn.value, 'photo').then(res => {
+ callPhotoAndVideoCmd(dockSn.value, 'photo').then(res => {
ElMessage.success('拍照成功')
})
}
@@ -252,7 +258,7 @@
}
}
const tableList = ref([]);
-// 分页相关
+// 分页相关
const searchParams = ref({
sn: droneSn.value,
name: '',
@@ -270,7 +276,7 @@
getFileList();
}
-// 获取文件列表
+// 获取音频文件列表
function getFileList() {
getVoiceFile(searchParams.value).then((res) => {
if (res.data.code !== 0) return ElMessage.error(res.data.msg);
@@ -342,7 +348,7 @@
top: 50%;
transform: translateY(-60%);
width: 178px;
- height: 416px;
+ padding: 20px 0;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(5px);
border-radius: 20px 20px 20px 20px;
@@ -360,16 +366,27 @@
.cameraZoom {
position: absolute;
- padding: 16px 0;
+ padding: 20px 0 15px 0;
left: 1600px;
top: -59px;
- width: 112px;
+ width: 90px;
height: 490px;
- background: rgba(64, 64, 64, 0.15);
+ background: rgba(0, 0, 0, 0.4);
+ backdrop-filter: blur(5rem);
border-radius: 20px 20px 20px 20px;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
.el-slider {
- height: 100%;
+ flex: 1;
+ }
+ .cameraZoomText{
+ font-family: Segoe UI, Segoe UI;
+ font-weight: 400;
+ font-size: 22px;
+ color: #ffffff;
+ margin-top: 20px;
}
}
@@ -583,7 +600,7 @@
bottom: 10px;
height: 32px;
display: flex;
-
+
:deep(.number) {
color: #EDEDED;
}
--
Gitblit v1.9.3