吉安感知网项目-前端
chenyao
2 days ago c567cbca3b78a7e06a827acbab56a46657e31aa1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!--
 * @Author       : yuan
 * @Date         : 2026-01-07 15:17:54
 * @LastEditors  : yuan
 * @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" :class="{ collapsed: collapsedModel }">
        <div class="wrapper">
            <TitleTemplate :className="'equipment-scene'">侦测反制设备&场景部署</TitleTemplate>
 
            <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">
                <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 SceneDeployment from './SceneDeployment.vue'
import DetectionCountermeasure from './DetectionCountermeasure.vue'
 
const props = defineProps({
    collapsed: {
        type: Boolean,
        default: false
    }
})
 
const emit = defineEmits(['update:collapsed', 'update:allDevices', 'scene-click'])
 
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 handleUpdateAllDevices = (devices) => {
    emit('update:allDevices', devices)
}
</script>
 
<style lang="scss" scoped>
.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: center;
    color: #fff;
    z-index: 10;
    transform: translateY(50%);
 
    .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;
        margin-left: 26px;
        height: 68px;
        line-height: 68px;
 
        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;
 
        &:first-child {
            margin-left: 0;
        }
 
        &.active {
            font-weight: normal;
            color: #FFFFFF;
        }
 
        &::after {
            content: '';
            position: absolute;
            left: 0;
            bottom: 0;
            width: 100%;
            height: 0;
        }
 
        &.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;
        }
 
        .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;
        }
    }
}
 
.content {
    height: 0;
    flex: 1;
    margin-top: 20px;
    overflow-x: hidden;
    overflow-y: auto;
}
</style>