From 30794a32ead67f249c47d326763d5b2e3780772e Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Mon, 21 Apr 2025 16:03:28 +0800
Subject: [PATCH] 调试盘
---
src/views/device/components/DockControlPanel.vue | 52 +++++++++++++++++++++++++++++-----------------------
1 files changed, 29 insertions(+), 23 deletions(-)
diff --git a/src/views/device/components/DockControlPanel.vue b/src/views/device/components/DockControlPanel.vue
index 3d1158d..4fc7f82 100644
--- a/src/views/device/components/DockControlPanel.vue
+++ b/src/views/device/components/DockControlPanel.vue
@@ -26,14 +26,13 @@
</div>
</div>
</div>
- <el-divider>无人机设置</el-divider>
-
+ <el-divider v-if="deviceInfo">无人机设置</el-divider>
<!-- 设置 0:白热,1:黑热,2:描红,3:医疗,5:彩虹 1,6:铁红,8:北极,11:熔岩,12:热铁,13:彩虹 2 -->
<div class="control-cmd-box">
- <div class="control-cmd-item">
- <div class="control-cmd-item-left">调色盘样式</div>
+ <div class="control-cmd-item" v-for="(item, index) in cameras">
+ <div class="control-cmd-item-left">调色盘样式 {{ item.payload_index }}</div>
<div class="control-cmd-item-right">
- <el-select @change="changs" v-model="valueStyle" placeholder="请选择">
+ <el-select @change="changs($event, item)" v-model="valueStyle" placeholder="请选择">
<el-option v-for="item in paletteOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
@@ -62,6 +61,10 @@
// 定义一个数据videoList
const videoList = reactive([])
+// 摄像头信息
+let cameras = reactive([])
+// 无人机信息
+let deviceInfo = ref()
// 调色盘选项数据
const paletteOptions = [
@@ -100,19 +103,19 @@
watch(
() => Store.state.device.videoSurveillance,
newObj => {
- // console.log('视频类型监听中', newObj)
- // if (newObj && newObj.live_status && newObj.live_status.length) {
- // let arr = newObj.live_status || []
- // if (videoList.length == arr.length) {
- // return
- // }
- // arr.forEach(element => {
- // let video_id = element.video_id
- // element.payIndex = video_id.split('/')[1].split('-')[1]
- // })
- // // videoList.length = 0 // 清空数组
- // videoList.push(...arr) // 添加新元素
- // }
+ console.log('视频类型监听中', newObj)
+ if (newObj && newObj.live_status && newObj.live_status.length) {
+ let arr = newObj.live_status || []
+ if (videoList.length == arr.length) {
+ return
+ }
+ arr.forEach(element => {
+ let video_id = element.video_id
+ element.payIndex = video_id.split('/')[1].split('-')[1]
+ })
+ // videoList.length = 0 // 清空数组
+ videoList.push(...arr) // 添加新元素
+ }
},
{
immediate: true,
@@ -131,6 +134,9 @@
devices['device'] = value.deviceInfo[props.deviceInfo.child_sn]
devices['dock'] = value.dockInfo[props.deviceInfo.device_sn]
devices['gateway'] = value.gatewayInfo
+ let cameraList = value.deviceInfo[props.deviceInfo.child_sn]?.cameras || []
+ cameras = reactive([...cameraList])
+ deviceInfo = ref(value.deviceInfo[props.deviceInfo.child_sn])
updateDeviceCmdInfoByOsd(cmdList.value, devices)
}
},
@@ -264,13 +270,13 @@
useConnectWebSocket(messageHandler, webSorketUrl)
// 添加 changs 方法
-async function changs (value) {
+async function changs (value, item) {
const payload = {
- thermal_current_palette_style: value
+ [item.payload_index]: {
+ thermal_current_palette_style: value
+ }
}
- console.log('payload1111111', payload)
- console.log('deviceInfo22222222', props.sn)
- console.log('deviceInfo22222222', props.deviceInfo.workspace_id)
+ console.log('payload', payload)
let data = await setThermalCurrentPaletteStyle(props.sn, props.deviceInfo.workspace_id, payload)
if (data.code === 0) {
message.success('修改成功')
--
Gitblit v1.9.3