2020-07-11 10:13:11 +09:00
|
|
|
<template>
|
2023-05-20 10:12:18 +09:00
|
|
|
<XColumn :menu="menu" :column="column" :isStacked="isStacked">
|
2020-07-11 10:13:11 +09:00
|
|
|
<template #header>
|
2022-12-19 19:01:30 +09:00
|
|
|
<i class="ti ti-antenna"></i><span style="margin-left: 8px;">{{ column.name }}</span>
|
2020-07-11 10:13:11 +09:00
|
|
|
</template>
|
|
|
|
|
2023-05-29 17:24:46 +09:00
|
|
|
<MkTimeline v-if="column.antennaId" ref="timeline" src="antenna" :antenna="column.antennaId"/>
|
2020-10-17 20:12:00 +09:00
|
|
|
</XColumn>
|
2020-07-11 10:13:11 +09:00
|
|
|
</template>
|
|
|
|
|
2022-03-21 03:11:14 +09:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { onMounted } from 'vue';
|
2020-07-11 10:13:11 +09:00
|
|
|
import XColumn from './column.vue';
|
2022-07-17 05:33:21 +09:00
|
|
|
import { updateColumn, Column } from './deck-store';
|
2023-02-22 11:00:34 +09:00
|
|
|
import MkTimeline from '@/components/MkTimeline.vue';
|
2021-11-12 02:02:25 +09:00
|
|
|
import * as os from '@/os';
|
2022-03-21 03:11:14 +09:00
|
|
|
import { i18n } from '@/i18n';
|
2020-07-11 10:13:11 +09:00
|
|
|
|
2022-03-21 03:11:14 +09:00
|
|
|
const props = defineProps<{
|
|
|
|
column: Column;
|
|
|
|
isStacked: boolean;
|
|
|
|
}>();
|
2020-07-11 10:13:11 +09:00
|
|
|
|
2023-02-22 11:00:34 +09:00
|
|
|
let timeline = $shallowRef<InstanceType<typeof MkTimeline>>();
|
2020-07-11 10:13:11 +09:00
|
|
|
|
2022-03-21 03:11:14 +09:00
|
|
|
onMounted(() => {
|
|
|
|
if (props.column.antennaId == null) {
|
|
|
|
setAntenna();
|
2020-07-11 10:13:11 +09:00
|
|
|
}
|
|
|
|
});
|
2022-03-21 03:11:14 +09: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 => ({
|
2022-07-17 05:33:21 +09:00
|
|
|
value: x, text: x.name,
|
2022-03-21 03:11:14 +09:00
|
|
|
})),
|
2022-07-17 05:33:21 +09:00
|
|
|
default: props.column.antennaId,
|
2022-03-21 03:11:14 +09:00
|
|
|
});
|
|
|
|
if (canceled) return;
|
|
|
|
updateColumn(props.column.id, {
|
2022-07-17 05:33:21 +09:00
|
|
|
antennaId: antenna.id,
|
2022-03-21 03:11:14 +09:00
|
|
|
});
|
|
|
|
}
|
2022-07-17 05:33:21 +09:00
|
|
|
|
2023-07-05 13:04:27 +09:00
|
|
|
function editAntenna() {
|
|
|
|
os.pageWindow('my/antennas/' + props.column.antennaId);
|
|
|
|
}
|
|
|
|
|
|
|
|
const menu = [
|
|
|
|
{
|
|
|
|
icon: 'ti ti-pencil',
|
|
|
|
text: i18n.ts.selectAntenna,
|
|
|
|
action: setAntenna,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
icon: 'ti ti-settings',
|
|
|
|
text: i18n.ts.editAntenna,
|
|
|
|
action: editAntenna,
|
|
|
|
},
|
|
|
|
];
|
2022-07-17 05:33:21 +09:00
|
|
|
|
2022-03-21 03:11:14 +09:00
|
|
|
/*
|
|
|
|
function focus() {
|
|
|
|
timeline.focus();
|
|
|
|
}
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
focus,
|
|
|
|
});
|
|
|
|
*/
|
2020-07-11 10:13:11 +09:00
|
|
|
</script>
|