2024-10-03 13:43:13 +02:00
|
|
|
<template>
|
|
|
|
<MainTemplate>
|
|
|
|
<template #topBar>
|
|
|
|
<div class="flex flex-row items-center justify-between pt-5 pb-3 px-7">
|
|
|
|
<h1 class="font-bold text-xl h-8">Protokolle</h1>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<template #diffMain>
|
|
|
|
<div class="flex flex-col w-full h-full gap-2 justify-center px-7">
|
2024-10-11 14:43:56 +02:00
|
|
|
<Pagination
|
|
|
|
:items="protocols"
|
|
|
|
:totalCount="totalCount"
|
|
|
|
:indicateLoading="loading == 'loading'"
|
|
|
|
@load-data="(offset, count, search) => fetchProtocols(offset, count)"
|
|
|
|
@search="(search) => fetchProtocols(0, 25, true)"
|
|
|
|
>
|
|
|
|
<template #pageRow="{ row }: { row: ProtocolViewModel }">
|
|
|
|
<ProtocolListItem :protocol="row" />
|
|
|
|
</template>
|
|
|
|
</Pagination>
|
2024-10-03 13:43:13 +02:00
|
|
|
|
|
|
|
<div class="flex flex-row gap-4">
|
|
|
|
<button primary class="!w-fit" @click="openCreateModal">Protokoll erstellen</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</MainTemplate>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { defineAsyncComponent, defineComponent, markRaw } from "vue";
|
|
|
|
import { mapActions, mapState } from "pinia";
|
|
|
|
import MainTemplate from "@/templates/Main.vue";
|
|
|
|
import { ChevronRightIcon, ChevronLeftIcon } from "@heroicons/vue/20/solid";
|
|
|
|
import { useProtocolStore } from "@/stores/admin/protocol";
|
|
|
|
import ProtocolListItem from "@/components/admin/club/protocol/ProtocolListItem.vue";
|
|
|
|
import { useModalStore } from "@/stores/modal";
|
2024-10-11 14:43:56 +02:00
|
|
|
import Pagination from "../../../../components/Pagination.vue";
|
|
|
|
import type { ProtocolViewModel } from "../../../../viewmodels/admin/protocol.models";
|
2024-10-03 13:43:13 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
export default defineComponent({
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
currentPage: 0,
|
|
|
|
maxEntriesPerPage: 25,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
2024-10-11 14:43:56 +02:00
|
|
|
...mapState(useProtocolStore, ["protocols", "totalCount", "loading"]),
|
2024-10-03 13:43:13 +02:00
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.fetchProtocols(0, this.maxEntriesPerPage, true);
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions(useProtocolStore, ["fetchProtocols"]),
|
|
|
|
...mapActions(useModalStore, ["openModal"]),
|
|
|
|
openCreateModal() {
|
|
|
|
// this.openModal(
|
|
|
|
// markRaw(defineAsyncComponent(() => import("@/components/admin/club/protocol/CreateProtocolModal.vue")))
|
|
|
|
// );
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|