Introduced ProfileStore

Corrected All Links to DataStore
This commit is contained in:
2024-12-21 22:33:42 +01:00
parent 813944fc23
commit b465f4a75a
64 changed files with 508 additions and 959 deletions

View File

@@ -7,6 +7,7 @@ definePageMeta({
})
const dataStore = useDataStore()
const profileStore = useProfileStore()
const route = useRoute()
const router = useRouter()
const toast = useToast()
@@ -110,7 +111,7 @@ setupPage()
<UCard class="mt-5">
<div v-if="item.label === 'Informationen'">
<div class="truncate">
<p>Mitarbeiter: {{dataStore.profiles.find(item => item.id === itemInfo.user) ? dataStore.profiles.find(item => item.id === itemInfo.user).fullName : ""}}</p>
<p>Mitarbeiter: {{profileStore.profiles.find(item => item.id === itemInfo.user) ? profileStore.profiles.find(item => item.id === itemInfo.user).fullName : ""}}</p>
<p>Start: {{dayjs(itemInfo.start).format("DD.MM.YYYY")}}</p>
<p>Ende: {{dayjs(itemInfo.end).format("DD.MM.YYYY")}}</p>
<p>Grund: {{itemInfo.reason}}</p>
@@ -151,14 +152,14 @@ setupPage()
>
<USelectMenu
v-model="itemInfo.user"
:options="dataStore.profiles"
:options="profileStore.profiles"
option-attribute="fullName"
value-attribute="id"
searchable
:search-attributes="['fullName']"
>
<template #label>
{{dataStore.getProfileById(itemInfo.user) ? dataStore.getProfileById(itemInfo.user).fullName : "Mitarbeiter auswählen"}}
{{profileStore.getProfileById(itemInfo.user) ? profileStore.getProfileById(itemInfo.user).fullName : "Mitarbeiter auswählen"}}
</template>
</USelectMenu>
</UFormGroup>

View File

@@ -61,7 +61,7 @@
</span>
</template>
<template #user-data="{row}">
{{dataStore.profiles.find(profile => profile.id === row.user) ? dataStore.profiles.find(profile => profile.id === row.user).fullName : ""}}
{{profileStore.profiles.find(profile => profile.id === row.user) ? profileStore.profiles.find(profile => profile.id === row.user).fullName : ""}}
</template>
</UTable>
</template>
@@ -84,6 +84,7 @@ defineShortcuts({
})
const dataStore = useDataStore()
const profileStore = useProfileStore()
const router = useRouter()
const templateColumns = [