| New file |
| | |
| | | <template> |
| | | <div class="counter-card" @click="emit('click', data)"> |
| | | <!-- 头部 --> |
| | | <div class="header"> |
| | | <div class="title"> |
| | | <span class="name">{{ data.name }}</span> |
| | | |
| | | <span class="status"> |
| | | <span :class="getStatusType(data.status)"> |
| | | |
| | | </span> |
| | | |
| | | <span> |
| | | {{ getStatusText(data.status) }} |
| | | </span> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 字段区:两列 --> |
| | | <div class="content"> |
| | | <div class="row"> |
| | | <div class="col"> |
| | | <span class="label">类型</span> |
| | | {{ data.type }} |
| | | </div> |
| | | <div class="col"> |
| | | <span class="label">电量</span> |
| | | {{ data.batteryPct }}% |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row"> |
| | | <div class="col"> |
| | | <span class="label">方位角</span> |
| | | {{ data.azimuth }}° |
| | | </div> |
| | | <div class="col"> |
| | | <span class="label">俯仰角</span> |
| | | {{ data.elevation }}° |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row"> |
| | | <div class="col"> |
| | | <span class="label">状态</span> |
| | | {{ getStatusText(data.status) }} |
| | | </div> |
| | | <div class="col"> |
| | | <span class="label">厂商</span> |
| | | {{ data.manufacturer }} |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row"> |
| | | <div class="col"> |
| | | <span class="label">侦测目标</span> |
| | | {{ data.detectTargetCnt }}台 |
| | | </div> |
| | | <div class="col"> |
| | | <span class="label">有效范围</span> |
| | | {{ data.effectiveRangeKm }}KM |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 底部按钮 --> |
| | | <div class="footer"> |
| | | <el-button color="#284FE3" type="primary" @click.stop="emit('history', data)">历史数据</el-button> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | defineProps({ |
| | | data: { |
| | | type: Object, |
| | | required: true, |
| | | default: () => ({}) |
| | | } |
| | | }) |
| | | |
| | | const emit = defineEmits(['history', 'click']) |
| | | |
| | | const getStatusText = (value) => { |
| | | if (value === 0 || value === '0') return '在线' |
| | | if (value === 1 || value === '1') return '离线' |
| | | if (value === 2 || value === '2') return '故障' |
| | | if (value === 3 || value === '3') return '报废' |
| | | return value || '-' |
| | | } |
| | | |
| | | const getStatusType = (value) => { |
| | | if (value === 0 || value === '0') return 'detecting' |
| | | if (value === 2 || value === '2') return 'jamming' |
| | | return '' |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .counter-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; |
| | | |
| | | .name { |
| | | 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; |
| | | } |
| | | |
| | | .status { |
| | | 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.detecting { |
| | | width: 4px; |
| | | height: 4px; |
| | | background: #18FF4A; |
| | | border-radius: 50%; |
| | | } |
| | | |
| | | span.jamming { |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .footer { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | gap: 10px; |
| | | margin-top: 10px; |
| | | |
| | | ::v-deep(.el-button) { |
| | | width: 96px; |
| | | height: 36px; |
| | | } |
| | | } |
| | | } |
| | | </style> |