2020-07-10 20:13:11 -05:00
|
|
|
<template>
|
2020-10-17 06:12:00 -05:00
|
|
|
<XColumn :menu="menu" :column="column" :is-stacked="isStacked">
|
2020-07-10 20:13:11 -05:00
|
|
|
<template #header>
|
2020-10-17 06:12:00 -05:00
|
|
|
<Fa :icon="faListUl"/><span style="margin-left: 8px;">{{ column.name }}</span>
|
2020-07-10 20:13:11 -05:00
|
|
|
</template>
|
|
|
|
|
2020-10-17 06:12:00 -05:00
|
|
|
<XTimeline v-if="column.listId" ref="timeline" src="list" :list="column.listId" @after="() => $emit('loaded')"/>
|
|
|
|
</XColumn>
|
2020-07-10 20:13:11 -05:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 06:12:00 -05:00
|
|
|
import { defineComponent } from 'vue';
|
2020-07-10 20:13:11 -05:00
|
|
|
import { faListUl, faCog } from '@fortawesome/free-solid-svg-icons';
|
|
|
|
import XColumn from './column.vue';
|
|
|
|
import XTimeline from '../timeline.vue';
|
2020-10-17 06:12:00 -05:00
|
|
|
import * as os from '@/os';
|
2020-07-10 20:13:11 -05:00
|
|
|
|
2020-10-17 06:12:00 -05:00
|
|
|
export default defineComponent({
|
2020-07-10 20:13:11 -05:00
|
|
|
components: {
|
|
|
|
XColumn,
|
|
|
|
XTimeline,
|
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
column: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
isStacked: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
faListUl
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
watch: {
|
|
|
|
mediaOnly() {
|
|
|
|
(this.$refs.timeline as any).reload();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
created() {
|
|
|
|
this.menu = [{
|
|
|
|
icon: faCog,
|
2020-07-25 23:30:36 -05:00
|
|
|
text: this.$t('selectList'),
|
2020-07-10 20:13:11 -05:00
|
|
|
action: this.setList
|
|
|
|
}];
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
if (this.column.listId == null) {
|
|
|
|
this.setList();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
async setList() {
|
2020-10-17 06:12:00 -05:00
|
|
|
const lists = await os.api('users/lists/list');
|
|
|
|
const { canceled, result: list } = await os.dialog({
|
2020-07-25 23:30:36 -05:00
|
|
|
title: this.$t('selectList'),
|
2020-07-10 20:13:11 -05:00
|
|
|
type: null,
|
|
|
|
select: {
|
|
|
|
items: lists.map(x => ({
|
|
|
|
value: x, text: x.name
|
|
|
|
})),
|
|
|
|
default: this.column.listId
|
|
|
|
},
|
|
|
|
showCancelButton: true
|
|
|
|
});
|
|
|
|
if (canceled) return;
|
2020-10-17 06:12:00 -05:00
|
|
|
this.column.listId = list.id;
|
2020-07-10 20:13:11 -05:00
|
|
|
this.$store.commit('deviceUser/updateDeckColumn', this.column);
|
|
|
|
},
|
|
|
|
|
|
|
|
focus() {
|
|
|
|
(this.$refs.timeline as any).focus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
</style>
|