feat(FE): ShowInstance, tracklist and various
This commit is contained in:
parent
e088adf286
commit
0ce6ff2ab3
1 changed files with 20 additions and 10 deletions
|
@ -5,11 +5,13 @@ import {onMounted, ref, type PropType} from "vue";
|
|||
import type {ShowInstance} from "@models/show/showInstance.ts";
|
||||
import {extractTime} from "@/helpers/DateFormatter.ts";
|
||||
import Playlist from "@components/content/Playlist.vue";
|
||||
import {getPlaylist} from "@models/playlist.ts";
|
||||
import {getPlaylist, getPlaylistContent} from "@models/playlist.ts";
|
||||
import {getUser} from "@models/User.ts";
|
||||
import PlaylistEditor from "@partials/PlaylistEditor.vue";
|
||||
import Sources from "@partials/Sources.vue";
|
||||
import TrackList from "@partials/TrackList.vue";
|
||||
|
||||
|
||||
const emits = defineEmits(['toggle-menu-edit-instance']);
|
||||
// Props
|
||||
const props = defineProps({
|
||||
showInstance: {
|
||||
|
@ -29,29 +31,32 @@ const showInstanceTime = ref({
|
|||
endsDate: new Date(showInstanceStore.currentShowInstance.ends),
|
||||
endsTime: extractTime(showInstanceStore.currentShowInstance.ends, true),
|
||||
});
|
||||
const playlist = ref({});
|
||||
const playlist = ref({tracks: []});
|
||||
|
||||
// Funcs
|
||||
onMounted(async () => {
|
||||
playlist.value = await getPlaylist({id: showInstanceStore.currentShowInstance.show.autoplaylistId})
|
||||
playlist.value = await getPlaylistContent(showInstanceStore.currentShowInstance.show.autoplaylist_id)
|
||||
})
|
||||
|
||||
const goBack = () => {
|
||||
showInstanceStore.resetShowInstance();
|
||||
// emits('toggle-menu-edit-instance');playlist.value = await getPlaylist({id: showInstanceStore.currentShowInstance.show.autoplaylistId})
|
||||
emits('toggle-menu-edit-instance');
|
||||
}
|
||||
|
||||
const saveInstance = async () => {
|
||||
const startsDateTime = showInstanceTime.value.startsDate + ' ' + showInstanceTime.value.startsTime;
|
||||
const endsDateTime = showInstanceTime.value.endsDate + ' ' + showInstanceTime.value.endsTime;
|
||||
|
||||
showInstanceStore.updateField({key: 'starts', value: startsDateTime })
|
||||
showInstanceStore.updateField({key: 'ends', value: endsDateTime })
|
||||
showInstanceStore.updateField({key: 'starts', value: startsDateTime})
|
||||
showInstanceStore.updateField({key: 'ends', value: endsDateTime})
|
||||
|
||||
await showInstanceStore.saveShowInstance();
|
||||
goBack()
|
||||
}
|
||||
|
||||
const update = () => {
|
||||
console.log('update')
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<v-row no-gutters>
|
||||
|
@ -114,9 +119,14 @@ const saveInstance = async () => {
|
|||
|
||||
<!-- Empty row for custom component -->
|
||||
<v-row no-gutters>
|
||||
<v-col cols="12">
|
||||
<!-- Insert your custom component here -->
|
||||
<PlaylistEditor :item="playlist"/>
|
||||
<v-col>
|
||||
<TrackList
|
||||
:tracks="playlist.tracks"
|
||||
@update-tracks="update"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<Sources/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue