2021-11-21 15:23:06 +08:00
|
|
|
<template>
|
2021-11-24 19:37:16 +08:00
|
|
|
<div class="satellite-table h-full flex flex-col">
|
|
|
|
|
<div class="text-center text-3xl my-2">{{ title }}</div>
|
|
|
|
|
|
2021-11-21 15:23:06 +08:00
|
|
|
<div class="table-header flex">
|
|
|
|
|
<div
|
|
|
|
|
class="table-header-item leading-10 flex-1"
|
|
|
|
|
v-for="(headerItem, i) in header"
|
|
|
|
|
:key="`${headerItem}${i}`"
|
|
|
|
|
v-html="headerItem"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
2021-11-24 19:37:16 +08:00
|
|
|
<div class="table-body flex-grow bg-red-100">
|
2021-11-21 15:23:06 +08:00
|
|
|
<div
|
|
|
|
|
class="row-item flex"
|
2021-11-24 07:57:42 +08:00
|
|
|
v-for="(row, ri) in data.satellites"
|
2021-11-21 15:23:06 +08:00
|
|
|
:key="`${row.toString()}`"
|
|
|
|
|
:style="`
|
|
|
|
|
background-color: ${ri % 2 === 0 ? evenRowBGC : oddRowBGC};
|
|
|
|
|
`"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
class="ceil flex-1"
|
|
|
|
|
v-for="(ceil, ci) in row"
|
|
|
|
|
:key="`${ceil}${ri}${ci}`"
|
|
|
|
|
v-html="ceil"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { reactive } from 'vue'
|
|
|
|
|
|
2021-11-24 19:37:16 +08:00
|
|
|
defineProps({
|
|
|
|
|
title: String
|
|
|
|
|
})
|
|
|
|
|
|
2021-11-21 15:23:06 +08:00
|
|
|
const oddRowBGC = '#003B51'
|
|
|
|
|
const evenRowBGC = '#0A2732'
|
|
|
|
|
|
2021-11-24 07:57:42 +08:00
|
|
|
const header = ['卫星编号', '仰角', '方位角', '载噪比']
|
|
|
|
|
const data = reactive({
|
2021-11-24 19:37:16 +08:00
|
|
|
satellites: [
|
|
|
|
|
{id: "20", elevationDeg: 68, azimuthTrue: 322, SNRdB: 25},
|
|
|
|
|
{id: "20", elevationDeg: 68, azimuthTrue: 322, SNRdB: 25},
|
|
|
|
|
{id: "20", elevationDeg: 68, azimuthTrue: 322, SNRdB: 25},
|
|
|
|
|
{id: "20", elevationDeg: 68, azimuthTrue: 322, SNRdB: 25},
|
|
|
|
|
{id: "20", elevationDeg: 68, azimuthTrue: 322, SNRdB: 25},
|
|
|
|
|
{id: "20", elevationDeg: 68, azimuthTrue: 322, SNRdB: 25},
|
|
|
|
|
{id: "20", elevationDeg: 68, azimuthTrue: 322, SNRdB: 25},
|
|
|
|
|
{id: "20", elevationDeg: 68, azimuthTrue: 322, SNRdB: 25},
|
|
|
|
|
{id: "20", elevationDeg: 68, azimuthTrue: 322, SNRdB: 25},
|
|
|
|
|
]
|
2021-11-24 07:57:42 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const update = (GSVArr: Array<any>) => {
|
|
|
|
|
if (GSVArr.length <= 0 ) return
|
|
|
|
|
|
|
|
|
|
let satellites: any[] = []
|
|
|
|
|
GSVArr.forEach((GSV) => {
|
|
|
|
|
satellites = satellites.concat(GSV.satellites)
|
|
|
|
|
})
|
|
|
|
|
console.log(satellites, '====================');
|
|
|
|
|
data.satellites = satellites
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
defineExpose({ update })
|
2021-11-21 15:23:06 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.table-header {
|
|
|
|
|
background-color: rgb(25, 129, 246);
|
|
|
|
|
}
|
2021-11-24 19:37:16 +08:00
|
|
|
|
|
|
|
|
.row-item {
|
|
|
|
|
line-height: 38px;
|
|
|
|
|
}
|
2021-11-21 15:23:06 +08:00
|
|
|
</style>
|