<template>
|
<div class="device-card" @click="emit('click', data)">
|
<div class="header">
|
<div class="title">
|
<el-tooltip
|
class="title-tooltip"
|
:content="data.name || '-'"
|
placement="top"
|
effect="dark"
|
:show-after="200"
|
>
|
<span class="name">{{ data.name }}</span>
|
</el-tooltip>
|
|
<span class="status">
|
<span :class="data.statusType">
|
|
</span>
|
|
<span>
|
{{ data.status }}
|
</span>
|
</span>
|
</div>
|
</div>
|
|
<div class="content">
|
<div class="row">
|
<div class="col">
|
<span class="label">方位角</span>
|
{{ data.azimuth }}°
|
</div>
|
<div class="col">
|
<span class="label">俯仰角</span>
|
{{ data.pitch }}°
|
</div>
|
</div>
|
<div class="row">
|
<div class="col">
|
<span class="label">有效范围</span>
|
{{ Number(data.range).toFixed(0) }}m
|
</div>
|
<div class="col">
|
<span class="label">设备型号</span>
|
{{ data.model }}
|
</div>
|
</div>
|
<div>
|
<span class="label">类型</span>
|
<span class="value">{{ data.type }}</span>
|
</div>
|
<div>
|
<span class="label">厂商</span>
|
<span class="value">{{ data.manufacturer }}</span>
|
</div>
|
<div>
|
<span class="label">部署位置</span>
|
<span class="value">{{ data.longitude }},{{ data.latitude }}</span>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script setup>
|
const props = defineProps({
|
data: {
|
type: Object,
|
required: true,
|
default: () => ({})
|
}
|
})
|
|
const emit = defineEmits(['click'])
|
</script>
|
|
<style scoped lang="scss">
|
.device-card {
|
margin-top: 10px;
|
padding: 10px;
|
color: #fff;
|
background: #191933;
|
border-radius: 6px 6px 6px 6px;
|
|
&:first-child {
|
margin-top: 0;
|
}
|
|
.header {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
|
.title {
|
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;
|
color: #FFFFFF;
|
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;
|
justify-content: space-between;
|
height: 21px;
|
|
background: #303041;
|
border-radius: 10px;
|
gap: 6px;
|
|
span {
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 400;
|
font-size: 10px;
|
color: #FFFFFF;
|
text-align: center;
|
font-style: normal;
|
text-transform: none;
|
}
|
|
|
span.offline {
|
width: 4px;
|
height: 4px;
|
background: #939393;
|
border-radius: 50%;
|
}
|
|
span.fault {
|
width: 4px;
|
height: 4px;
|
background: #FF4444;
|
border-radius: 50%;
|
}
|
}
|
}
|
}
|
|
.content {
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-weight: 400;
|
font-size: 12px;
|
color: #9E9EBA;
|
text-align: left;
|
font-style: normal;
|
text-transform: none;
|
|
&>div {
|
margin-top: 10px;
|
line-height: 22px;
|
|
span.label {
|
margin-right: 10px;
|
color: #D4D5D7;
|
}
|
}
|
|
.row {
|
display: flex;
|
|
&>div {
|
width: 0;
|
flex: 1;
|
}
|
}
|
}
|
}
|
</style>
|