吉安感知网项目-前端
chenyao
2 days ago 7224851bf14cab706d36f695331488941ed4aba6
applications/drone-command/src/views/dataCockpit/components/RightContainer.vue
@@ -2,158 +2,183 @@
 * @Author       : yuan
 * @Date         : 2026-01-07 15:17:54
 * @LastEditors  : yuan
 * @LastEditTime : 2026-01-08 15:58:15
 * @LastEditTime : 2026-02-09 15:20:23
 * @FilePath     : \applications\drone-command\src\views\dataCockpit\components\RightContainer.vue
 * @Description  : 
 * Copyright 2026 OBKoro1, All Rights Reserved. 
 * 2026-01-07 15:17:54
-->
<template>
   <div class="right-container">
   <div class="right-container" :class="{ collapsed: collapsedModel }">
      <div class="wrapper">
         <TitleTemplate>侦测反制设备</TitleTemplate>
         <TitleTemplate :className="'equipment-scene'">侦测反制设备&场景部署</TitleTemplate>
         <div class="category-container">
            <div class="category-item" v-for="(item, ind) in categoryList" :key="ind">
               <div class="category-item-logo">
                  <img :src="item.logo" alt="">
               </div>
               <div class="category-item-content">
                  <span class="name">{{ item.name }}</span>
                  <span class="val">{{ item.val }}</span>
               </div>
         <div class="tabs-container">
            <div
               class="tabs-item"
               v-for="item in tabs"
               :key="item.id"
               @click="activeTab = item.id"
               :class="{ active: activeTab === item.id }"
            >
               {{ item.name }}
            </div>
         </div>
         <div class="content">
            <RealEquipmentTemplate v-for="item in counterDeviceStatusList" :key="item.id" :data="item"
               @history="onHistory" @click="onCardClick" />
            <DetectionCountermeasure
               v-if="activeTab === 1"
               @update:allDevices="handleUpdateAllDevices"
            />
            <SceneDeployment v-else @click="(item) => emit('scene-click', item)" />
         </div>
      </div>
      <div class="collapse-btn" @click="toggleCollapse">
         <span class="arrow" :class="collapsedModel ? 'left' : 'right'"></span>
      </div>
   </div>
</template>
<script setup>
import { ref, computed } from 'vue'
import TitleTemplate from './templateComponents/TitleTemplate.vue'
import RealEquipmentTemplate from './templateComponents/RealEquipmentTemplate.vue'
import zcsbLogo from '@/assets/images/dataCockpit/zcsb.png'
import fzsbLogo from '@/assets/images/dataCockpit/fzsb.png'
import SceneDeployment from './SceneDeployment.vue'
import DetectionCountermeasure from './DetectionCountermeasure.vue'
const categoryList = ref([
   {
      id: 1,
      name: '侦测设备',
      val: 169,
      logo: zcsbLogo
   },
   {
      id: 2,
      name: '反制设备',
      val: 169,
      logo: fzsbLogo
const props = defineProps({
   collapsed: {
      type: Boolean,
      default: false
   }
])
})
const counterDeviceStatusList = ref([
   {
      id: 'cd_001',
      name: '反制设备名称',
      actionText: '侦测中',          // 胶囊文案
      actionType: 'detecting',       // detecting | jamming | idle
      type: '察打一体',
      battery: 100,                  // 电量 %
      azimuth: 14,                   // 方位角
      pitch: 14,                     // 俯仰角
      statusText: '在线',            // 状态
      vendor: '厂商名称',            // 厂商
      targetCount: 10,               // 侦测目标
      range: '1.2KM'                 // 有效范围
   },
   {
      id: 'cd_002',
      name: '反制设备名称',
      actionText: '信号干扰中',
      actionType: 'jamming',
      type: '察打一体',
      battery: 100,
      azimuth: 14,
      pitch: 14,
      statusText: '在线',
      vendor: '厂商名称',
      targetCount: 10,
      range: '1.2KM'
   }
])
const emit = defineEmits(['update:collapsed', 'update:allDevices', 'scene-click'])
const onHistory = (item) => {
   console.log('历史数据:', item.id)
const collapsedModel = computed({
   get: () => props.collapsed,
   set: (val) => emit('update:collapsed', val)
})
const activeTab = ref(1)
const tabs = [
   { id: 1, name: '侦测反制设备' },
   { id: 2, name: '场景部署' }
]
const toggleCollapse = () => {
   collapsedModel.value = !collapsedModel.value
}
const onCardClick = (item) => {
   console.log('点击卡片:', item.id)
const handleUpdateAllDevices = (devices) => {
   emit('update:allDevices', devices)
}
</script>
<style lang="scss" scoped>
.category-container {
   margin-top: 20px;
.right-container {
   transition: transform 0.3s ease-in-out;
   position: relative;
   &.collapsed {
      transform: translateX(calc(100% + 17px + 32px));
   }
}
.collapse-btn {
   position: absolute;
   bottom: 454px;
   right: 300px;
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 28px;
   box-sizing: border-box;
   justify-content: center;
   color: #fff;
   z-index: 10;
   transform: translateY(50%);
   .category-item {
   .arrow {
      width: 36px;
      height: 36px;
      background: url('@/assets/images/dataCockpit/right-btn.png') center / 100% 100% no-repeat;
   }
   &:hover {
      background: rgba(40, 79, 227, 0.6);
   }
}
.tabs-container {
   position: relative;
   display: flex;
   justify-content: space-between;
   &::after {
      content: '';
      position: absolute;
      left: 0;
      bottom: 0;
      width: 100%;
      height: 1px;
      background: #333355;
   }
   .tabs-item {
      position: relative;
      width: 0;
      flex: 1;
      display: flex;
      height: 64px;
      margin-left: 26px;
      height: 68px;
      line-height: 68px;
      &-logo {
         display: flex;
         align-items: center;
      font-family: Source Code Pro, Source Code Pro;
      font-weight: 400;
      font-size: 14px;
      color: #86909C;
      text-align: center;
      font-style: normal;
      text-transform: none;
      cursor: pointer;
         img {
            width: 40px;
            height: 40px;
         }
      &:first-child {
         margin-left: 0;
      }
      &-content {
         width: 0;
         flex: 1;
         display: flex;
         flex-direction: column;
         border-bottom: 1px solid #6C6C89;
      &.active {
         font-weight: normal;
         color: #FFFFFF;
      }
         span {
            margin-left: 8px;
         }
      &::after {
         content: '';
         position: absolute;
         left: 0;
         bottom: 0;
         width: 100%;
         height: 0;
      }
         .name {
            font-family: Open Sans, Open Sans;
            font-weight: 400;
            font-size: 16px;
            color: #C3C3DD;
            line-height: 20px;
            text-align: left;
            font-style: normal;
            text-transform: none;
         }
      &.active::after {
         height: 3px;
         background: #284FE3;
         box-shadow: 0px 3px 2px 0px rgba(15, 89, 255, 0.1), 0px 7px 5px 0px rgba(15, 89, 255, 0.15), 0px 13px 10px 0px rgba(15, 89, 255, 0.18), 0px 22px 18px 0px rgba(15, 89, 255, 0.21), 0px 42px 33px 0px rgba(15, 89, 255, 0.26), 0px 100px 80px 0px rgba(15, 89, 255, 0.36);
         border-radius: 5px 5px 0px 0px;
         z-index: 9;
      }
         .val {
            margin-top: 10px;
            font-family: DIN, DIN;
            font-weight: bold;
            font-size: 22px;
            color: #FFFFFF;
            line-height: 20px;
            text-align: left;
            font-style: normal;
            text-transform: none;
         }
      .badge {
         position: absolute;
         top: 16px;
         right: -4px;
         min-width: 18px;
         line-height: 18px;
         font-size: 12px;
         color: #FFFFFF;
         background: #FF3B30;
         border-radius: 50%;
         text-align: center;
         box-shadow: 0px 2px 6px rgba(255, 59, 48, 0.6);
         pointer-events: none;
      }
   }
}
@@ -165,53 +190,4 @@
   overflow-x: hidden;
   overflow-y: auto;
}
.right-container {
   transition: transform 0.3s ease-in-out;
   /* position: relative; Removed to avoid conflict with parent absolute positioning */
   &.collapsed {
      transform: translateX(100%);
   }
}
.collapse-btn {
   position: absolute;
   top: 50%;
   left: -24px;
   width: 24px;
   height: 60px;
   background: rgba(17, 23, 34, 0.8);
   border: 1px solid #333355;
   border-right: none;
   border-radius: 4px 0 0 4px;
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: center;
   color: #fff;
   transform: translateY(-50%);
   z-index: 10;
   backdrop-filter: blur(5px);
   .arrow {
      border: solid #fff;
      border-width: 0 2px 2px 0;
      display: inline-block;
      padding: 3px;
      transition: transform 0.3s;
      &.left {
         transform: rotate(135deg);
      }
      &.right {
         transform: rotate(-45deg);
      }
   }
   &:hover {
      background: rgba(40, 79, 227, 0.6);
   }
}
</style>
</style>