| | |
| | | <div class="drone-card"> |
| | | <div class="header"> |
| | | <div class="title"> |
| | | <span class="name">{{ data.droneName }}</span> |
| | | <el-tooltip class="title-tooltip" :content="data.droneName || '-'" placement="top" effect="dark" |
| | | :show-after="200"> |
| | | <span class="name">{{ data.droneName }}</span> |
| | | </el-tooltip> |
| | | <span class="status"> |
| | | <span :class="getStatusType(data)"> |
| | | |
| | |
| | | </div> |
| | | |
| | | <div class="actions"> |
| | | <span class="star" @click="emit('favorite')"> |
| | | {{ data.isFavorite ? '★' : '☆' }} |
| | | </span> |
| | | <img |
| | | class="favorite-icon" |
| | | :src="favoriteIcon" |
| | | alt="收藏" |
| | | @click="emit('favorite')" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | |
| | | <div class="footer"> |
| | | <el-button v-if="showSignalBtn(data)" class="general" color="#2B2B4C" @click="emit('signal')">信号干扰</el-button> |
| | | <el-button v-if="showCounterBtn(data)" color="#284FE3" type="primary" @click="emit('counter')">诱导驱离</el-button> |
| | | <el-button class="general" color="#2B2B4C" @click="handleSignal">信号干扰</el-button> |
| | | <el-button color="#284FE3" type="primary" @click="handleCounter">诱导驱离</el-button> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed } from 'vue' |
| | | import { saveOperationLog } from '@ztzf/apis' |
| | | import { useRoute } from 'vue-router' |
| | | import favoriteNo from '@/assets/images/dataCockpit/favorite-n.png' |
| | | import favoriteYes from '@/assets/images/dataCockpit/favorite-y.png' |
| | | |
| | | const props = defineProps({ |
| | | data: { |
| | | type: Object, |
| | |
| | | } |
| | | }) |
| | | |
| | | const route = useRoute() |
| | | const emit = defineEmits(['signal', 'counter', 'favorite']) |
| | | const favoriteIcon = computed(() => (props.data?.isFavorite ? favoriteYes : favoriteNo)) |
| | | |
| | | // 信号干扰操作 |
| | | const handleSignal = () => { |
| | | saveOperationLog({ |
| | | requestUri: route.path, |
| | | title: `${route.name || '数据驾驶舱'}-信号干扰`, |
| | | type: 1 |
| | | }) |
| | | emit('signal') |
| | | } |
| | | |
| | | const handleCounter = () => { |
| | | saveOperationLog({ |
| | | requestUri: route.path, |
| | | title: `${route.name || '数据驾驶舱'}-诱导驱离`, |
| | | type: 1 |
| | | }) |
| | | emit('counter') |
| | | } |
| | | |
| | | const getStatusText = (item) => { |
| | | const status = item?.flightStatus |
| | |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 6px; |
| | | min-width: 0; |
| | | |
| | | .title-tooltip { |
| | | flex: 1; |
| | | min-width: 0; |
| | | display: block; |
| | | } |
| | | |
| | | .name { |
| | | display: inline-block; |
| | | max-width: 100%; |
| | | font-family: Source Han Sans CN, Source Han Sans CN; |
| | | font-weight: bold; |
| | | font-size: 14px; |
| | |
| | | text-align: left; |
| | | font-style: normal; |
| | | text-transform: none; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .status { |
| | | flex-shrink: 0; |
| | | padding: 0 10px; |
| | | display: flex; |
| | | align-items: center; |
| | |
| | | gap: 8px; |
| | | font-size: 16px; |
| | | cursor: pointer; |
| | | |
| | | .favorite-icon { |
| | | width: 16px; |
| | | height: 16px; |
| | | } |
| | | } |
| | | } |
| | | |