c3lf-system-3/web/src/App.vue

60 lines
2.1 KiB
Vue
Raw Normal View History

2019-11-13 22:02:44 +01:00
<template>
2024-11-02 22:12:00 +01:00
<div style="min-height: 100vh; display: flex; flex-direction: column;">
2024-01-07 21:42:23 +01:00
<AddItemModal v-if="addItemModalOpen && isLoggedIn" @close="closeAddItemModal()" isModal="true"/>
<AddTicketModal v-if="addTicketModalOpen && isLoggedIn" @close="closeAddTicketModal()" isModal="true"/>
2023-12-28 22:49:55 +01:00
<AddBoxModal v-if="showAddBoxModal && isLoggedIn" @close="closeAddBoxModal()" isModal="true"/>
2024-11-02 22:12:00 +01:00
<AddEventModal v-if="showAddEventModal && isLoggedIn" @close="closeAddEventModal()" isModal="true"/>
2024-01-07 21:42:23 +01:00
<Navbar v-if="isLoggedIn" @addItemClicked="openAddItemModal()" @addTicketClicked="openAddTicketModal()"/>
2024-11-02 22:12:00 +01:00
<router-view style="flex: 1 1;"/>
2019-11-13 23:21:19 +01:00
</div>
2019-11-13 22:02:44 +01:00
</template>
<script>
2019-11-14 03:59:17 +01:00
import Navbar from '@/components/Navbar';
2019-12-27 02:39:56 +01:00
import AddItemModal from '@/components/AddItemModal';
2024-01-07 21:42:23 +01:00
import {mapState, mapMutations, mapActions, mapGetters} from 'vuex';
import AddTicketModal from "@/components/AddTicketModal.vue";
2023-12-28 22:49:55 +01:00
import AddBoxModal from "@/components/AddBoxModal.vue";
2024-11-02 22:12:00 +01:00
import AddEventModal from "@/components/AddEventModal.vue";
2019-11-14 04:37:35 +01:00
2019-11-13 22:02:44 +01:00
export default {
2023-11-27 01:14:52 +01:00
name: 'app',
2024-11-02 22:12:00 +01:00
components: {AddBoxModal, AddEventModal, Navbar, AddItemModal, AddTicketModal},
2024-01-07 21:42:23 +01:00
computed: {
2024-11-02 22:12:00 +01:00
...mapState(['loadedItems', 'layout', 'toasts', 'showAddBoxModal', 'showAddEventModal']),
2024-01-07 21:42:23 +01:00
...mapGetters(['isLoggedIn']),
},
2023-11-27 01:14:52 +01:00
data: () => ({
2024-01-07 21:42:23 +01:00
addItemModalOpen: false,
2024-06-18 20:10:10 +02:00
addTicketModalOpen: false
2023-11-27 01:14:52 +01:00
}),
methods: {
2024-11-02 22:12:00 +01:00
...mapMutations(['removeToast', 'createToast', 'closeAddBoxModal', 'openAddBoxModal', 'closeAddEventModal']),
2024-06-23 01:04:32 +02:00
...mapActions(['loadEvents', 'scheduleAfterInit']),
2024-01-07 21:42:23 +01:00
openAddItemModal() {
this.addItemModalOpen = true;
},
openAddTicketModal() {
this.addTicketModalOpen = true;
},
closeAddItemModal() {
this.addItemModalOpen = false;
2023-11-27 01:14:52 +01:00
},
2024-01-07 21:42:23 +01:00
closeAddTicketModal() {
this.addTicketModalOpen = false;
2024-06-18 20:10:10 +02:00
}
},
2023-11-27 01:14:52 +01:00
created: function () {
2024-06-18 20:10:10 +02:00
document.title = document.location.hostname;
2024-06-23 01:04:32 +02:00
this.scheduleAfterInit(() => [this.loadEvents()]);
}
2019-11-13 22:21:47 +01:00
};
2019-11-13 22:02:44 +01:00
</script>
<style>
body, html, #app {
2023-11-27 01:14:52 +01:00
background: #000;
}
2019-11-13 22:02:44 +01:00
</style>
2019-12-01 22:00:06 +01:00