无人机管理后台前端(已迁走)
linwe
2025-04-21 30794a32ead67f249c47d326763d5b2e3780772e
调试盘
2 files modified
53 ■■■■■ changed files
src/api/device-setting/index.js 1 ●●●● patch | view | raw | blame | history
src/views/device/components/DockControlPanel.vue 52 ●●●●● patch | view | raw | blame | history
src/api/device-setting/index.js
@@ -30,6 +30,7 @@
export const setThermalCurrentPaletteStyle = (deviceSn, workspaceId, body) => {
  return request({
    // /manage/api/v1/devices/selectDevicePage
    // url: `/localApi/manage/api/v1/devices/${workspaceId}/devices/${deviceSn}/setThermalCurrentPaletteStyle`,
    url: `/drone-device-core/manage/api/v1/devices/${workspaceId}/devices/${deviceSn}/setThermalCurrentPaletteStyle`,
    method: 'put',
    body,
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('修改成功')