This commit is contained in:
2024-04-07 17:18:58 +02:00
parent d7fafda78e
commit 491cbf15b6
7 changed files with 229 additions and 311 deletions

View File

@@ -8,6 +8,9 @@ const props = defineProps({
elementId: {
required: true,
type: String
},
renderHeadline: {
type: Boolean
}
})
const { metaSymbol } = useShortcuts()
@@ -45,6 +48,8 @@ const historyItems = computed(() => {
items = dataStore.historyItems.filter(i => i.product === elementId)
} else if(type === "profile") {
items = dataStore.historyItems.filter(i => i.profile === elementId)
} else if(type === "absencerequest") {
items = dataStore.historyItems.filter(i => i.absenceRequest === elementId)
}
return items
@@ -80,6 +85,8 @@ const addHistoryItem = async () => {
addHistoryItemData.value.product = elementId
} else if(type === "profile") {
addHistoryItemData.value.profile = elementId
} else if(type === "absencerequest") {
addHistoryItemData.value.absenceRequest = elementId
}
@@ -137,13 +144,27 @@ const renderText = (text) => {
</template>
</UCard>
</UModal>
<Toolbar>
<Toolbar
v-if="!renderHeadline"
>
<UButton
@click="showAddHistoryItemModal = true"
>
+ Eintrag
</UButton>
</Toolbar>
<div v-else>
<div :class="`flex justify-between`">
<p class="text-2xl">Logbuch</p>
<UButton
@click="showAddHistoryItemModal = true"
>
+ Eintrag
</UButton>
</div>
<UDivider class="mt-3"/>
</div>
<div
v-if="historyItems.length > 0"