2020-07-10 20:13:11 -05:00
|
|
|
<template>
|
2023-05-19 20:12:18 -05:00
|
|
|
<XColumn :menu="menu" :column="column" :isStacked="isStacked">
|
2020-07-10 20:13:11 -05:00
|
|
|
<template #header>
|
2022-12-19 04:01:30 -06:00
|
|
|
<i class="ti ti-list"></i><span style="margin-left: 8px;">{{ column.name }}</span>
|
2020-07-10 20:13:11 -05:00
|
|
|
</template>
|
|
|
|
|
2023-05-29 03:24:46 -05:00
|
|
|
<MkTimeline v-if="column.listId" ref="timeline" src="list" :list="column.listId"/>
|
2020-10-17 06:12:00 -05:00
|
|
|
</XColumn>
|
2020-07-10 20:13:11 -05:00
|
|
|
</template>
|
|
|
|
|
2022-03-20 13:11:14 -05:00
|
|
|
<script lang="ts" setup>
|
2022-07-10 05:47:29 -05:00
|
|
|
import { } from 'vue';
|
2020-07-10 20:13:11 -05:00
|
|
|
import XColumn from './column.vue';
|
2022-07-16 15:33:21 -05:00
|
|
|
import { updateColumn, Column } from './deck-store';
|
2023-02-21 20:00:34 -06:00
|
|
|
import MkTimeline from '@/components/MkTimeline.vue';
|
2021-11-11 11:02:25 -06:00
|
|
|
import * as os from '@/os';
|
2022-03-20 13:11:14 -05:00
|
|
|
import { i18n } from '@/i18n';
|
2020-07-10 20:13:11 -05:00
|
|
|
|
2022-03-20 13:11:14 -05:00
|
|
|
const props = defineProps<{
|
|
|
|
column: Column;
|
|
|
|
isStacked: boolean;
|
|
|
|
}>();
|
2020-07-10 20:13:11 -05:00
|
|
|
|
2023-02-21 20:00:34 -06:00
|
|
|
let timeline = $shallowRef<InstanceType<typeof MkTimeline>>();
|
2020-07-10 20:13:11 -05:00
|
|
|
|
2022-03-20 13:11:14 -05:00
|
|
|
if (props.column.listId == null) {
|
|
|
|
setList();
|
|
|
|
}
|
2020-07-10 20:13:11 -05:00
|
|
|
|
2022-03-20 13:11:14 -05:00
|
|
|
async function setList() {
|
|
|
|
const lists = await os.api('users/lists/list');
|
|
|
|
const { canceled, result: list } = await os.select({
|
|
|
|
title: i18n.ts.selectList,
|
|
|
|
items: lists.map(x => ({
|
2022-07-16 15:33:21 -05:00
|
|
|
value: x, text: x.name,
|
2022-03-20 13:11:14 -05:00
|
|
|
})),
|
2022-07-16 15:33:21 -05:00
|
|
|
default: props.column.listId,
|
2022-03-20 13:11:14 -05:00
|
|
|
});
|
|
|
|
if (canceled) return;
|
|
|
|
updateColumn(props.column.id, {
|
2022-07-16 15:33:21 -05:00
|
|
|
listId: list.id,
|
2022-03-20 13:11:14 -05:00
|
|
|
});
|
|
|
|
}
|
2020-07-10 20:13:11 -05:00
|
|
|
|
2023-07-04 23:04:27 -05:00
|
|
|
function editList() {
|
|
|
|
os.pageWindow('my/lists/' + props.column.listId);
|
|
|
|
}
|
|
|
|
|
|
|
|
const menu = [
|
|
|
|
{
|
|
|
|
icon: 'ti ti-pencil',
|
|
|
|
text: i18n.ts.selectList,
|
|
|
|
action: setList,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
icon: 'ti ti-settings',
|
|
|
|
text: i18n.ts.editList,
|
|
|
|
action: editList,
|
|
|
|
},
|
|
|
|
];
|
2020-07-10 20:13:11 -05:00
|
|
|
</script>
|