2020-07-11 01:13:11 +00:00
|
|
|
<template>
|
2022-03-20 18:11:14 +00:00
|
|
|
<XColumn :func="{ handler: setAntenna, title: $ts.selectAntenna }" :column="column" :is-stacked="isStacked" @parent-focus="$event => emit('parent-focus', $event)">
|
2020-07-11 01:13:11 +00:00
|
|
|
<template #header>
|
2021-04-20 14:22:59 +00:00
|
|
|
<i class="fas fa-satellite"></i><span style="margin-left: 8px;">{{ column.name }}</span>
|
2020-07-11 01:13:11 +00:00
|
|
|
</template>
|
|
|
|
|
2022-03-20 18:11:14 +00:00
|
|
|
<XTimeline v-if="column.antennaId" ref="timeline" src="antenna" :antenna="column.antennaId" @after="() => emit('loaded')"/>
|
2020-10-17 11:12:00 +00:00
|
|
|
</XColumn>
|
2020-07-11 01:13:11 +00:00
|
|
|
</template>
|
|
|
|
|
2022-03-20 18:11:14 +00:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { onMounted } from 'vue';
|
2020-07-11 01:13:11 +00:00
|
|
|
import XColumn from './column.vue';
|
2021-11-11 17:02:25 +00:00
|
|
|
import XTimeline from '@/components/timeline.vue';
|
|
|
|
import * as os from '@/os';
|
2022-03-20 18:11:14 +00:00
|
|
|
import { updateColumn, Column } from './deck-store';
|
|
|
|
import { i18n } from '@/i18n';
|
2020-07-11 01:13:11 +00:00
|
|
|
|
2022-03-20 18:11:14 +00:00
|
|
|
const props = defineProps<{
|
|
|
|
column: Column;
|
|
|
|
isStacked: boolean;
|
|
|
|
}>();
|
2020-07-11 01:13:11 +00:00
|
|
|
|
2022-03-20 18:11:14 +00:00
|
|
|
const emit = defineEmits<{
|
2022-05-19 08:35:43 +00:00
|
|
|
(ev: 'loaded'): void;
|
|
|
|
(ev: 'parent-focus', direction: 'up' | 'down' | 'left' | 'right'): void;
|
2022-03-20 18:11:14 +00:00
|
|
|
}>();
|
2020-07-11 01:13:11 +00:00
|
|
|
|
2022-03-20 18:11:14 +00:00
|
|
|
let timeline = $ref<InstanceType<typeof XTimeline>>();
|
2020-07-11 01:13:11 +00:00
|
|
|
|
2022-03-20 18:11:14 +00:00
|
|
|
onMounted(() => {
|
|
|
|
if (props.column.antennaId == null) {
|
|
|
|
setAntenna();
|
2020-07-11 01:13:11 +00:00
|
|
|
}
|
|
|
|
});
|
2022-03-20 18:11:14 +00:00
|
|
|
|
|
|
|
async function setAntenna() {
|
|
|
|
const antennas = await os.api('antennas/list');
|
|
|
|
const { canceled, result: antenna } = await os.select({
|
|
|
|
title: i18n.ts.selectAntenna,
|
|
|
|
items: antennas.map(x => ({
|
|
|
|
value: x, text: x.name
|
|
|
|
})),
|
|
|
|
default: props.column.antennaId
|
|
|
|
});
|
|
|
|
if (canceled) return;
|
|
|
|
updateColumn(props.column.id, {
|
|
|
|
antennaId: antenna.id
|
|
|
|
});
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
function focus() {
|
|
|
|
timeline.focus();
|
|
|
|
}
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
focus,
|
|
|
|
});
|
|
|
|
*/
|
2020-07-11 01:13:11 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
</style>
|