Files
gnss-tool-kit/src/render/components/ScrollBoardTable.vue

71 lines
1.5 KiB
Vue
Raw Normal View History

2021-11-21 15:23:06 +08:00
<template>
<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>
<div class="table-body flex-grow">
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'
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-27 12:04:37 +08:00
satellites: []
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)
})
2021-11-24 22:57:27 +08:00
// console.log(satellites, '====================');
2021-11-24 07:57:42 +08:00
data.satellites = satellites
}
defineExpose({ update })
2021-11-21 15:23:06 +08:00
</script>
<style scoped>
.table-header {
background-color: rgb(25, 129, 246);
}
.row-item {
line-height: 38px;
}
2021-11-21 15:23:06 +08:00
</style>