Corrected Empty Slot for Tables

This commit is contained in:
2023-12-21 16:17:43 +01:00
parent 1573cb2b1e
commit 3625db30ec
10 changed files with 210 additions and 216 deletions

View File

@@ -17,7 +17,7 @@
:rows="filteredRows" :rows="filteredRows"
:columns="itemColumns" :columns="itemColumns"
@select="selectItem" @select="selectItem"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
> >
<template #customer-data="{row}"> <template #customer-data="{row}">
{{customers.find(customer => customer.id === row.customer) ? customers.find(customer => customer.id === row.customer).name : row.customer }} {{customers.find(customer => customer.id === row.customer) ? customers.find(customer => customer.id === row.customer).name : row.customer }}

View File

@@ -18,6 +18,7 @@
:columns="customerColumns" :columns="customerColumns"
@select="selectCustomer" @select="selectCustomer"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
/> />
</div> </div>

View File

@@ -16,7 +16,7 @@
:rows="filteredRows" :rows="filteredRows"
:columns="itemColumns" :columns="itemColumns"
@select="selectItem" @select="selectItem"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
/> />

View File

@@ -7,7 +7,7 @@
:rows="jobs" :rows="jobs"
:columns="columns" :columns="columns"
@select="selectJob" @select="selectJob"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
/> />
</div> </div>

View File

@@ -16,6 +16,7 @@
:rows="filteredRows" :rows="filteredRows"
:columns="itemColumns" :columns="itemColumns"
@select="selectItem" @select="selectItem"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
> >
<template #tags-data="{row}"> <template #tags-data="{row}">
<UBadge <UBadge

View File

@@ -124,6 +124,7 @@
:rows="filteredRows" :rows="filteredRows"
:columns="taskColumns" :columns="taskColumns"
@select="inspectTask" @select="inspectTask"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
> >
<template #created_at-data="{row}"> <template #created_at-data="{row}">
{{ dayjs(row.created_at).format("DD.MM.YY HH:mm") }} {{ dayjs(row.created_at).format("DD.MM.YY HH:mm") }}

View File

@@ -24,6 +24,18 @@ const timeInfo = ref({
type: null type: null
}) })
const filteredRows = computed(() => {
if(user.value && times.value) {
return times.value.filter(time => time.user === user.value.id)
} else {
return []
}
})
const createTimeInfo = ref({ const createTimeInfo = ref({
user: "", user: "",
start: new Date(), start: new Date(),
@@ -65,13 +77,9 @@ const columns = [
} }
] ]
const runningTimeInfo = ref({ const runningTimeInfo = ref({})
})
const showAddTimeModal = ref(false) const showAddTimeModal = ref(false)
const addTimeInfo = ref({
})
const startTime = async () => { const startTime = async () => {
@@ -160,7 +168,7 @@ const selectStartedTime = () => {
</script> </script>
<template> <template>
<div> <div class="flex items-center gap-1">
<UButton <UButton
class="controlButton" class="controlButton"
@click="startTime" @click="startTime"
@@ -175,18 +183,56 @@ const selectStartedTime = () => {
> >
Stop Stop
</UButton> </UButton>
<!--<UButton
class="controlButton"
@click="selectStartedTime"
>
Zeit Wählen
</UButton>-->
<UButton <UButton
class="controlButton" class="controlButton"
@click="showAddTimeModal = true" @click="showAddTimeModal = true"
> >
Erstellen Erstellen
</UButton> </UButton>
</div>
<div v-if="runningTimeInfo.id" class="mt-3">
Start: {{dayjs(runningTimeInfo.start).format("DD.MM.YY HH:mm")}}
<UFormGroup
label="Notizen:"
>
<UTextarea
v-model="runningTimeInfo.notes"
/>
</UFormGroup>
<UFormGroup
label="Projekt:"
>
<USelectMenu
:options="projects"
option-attribute="name"
value-attribute="id"
v-model="runningTimeInfo.projectId"
>
<template #label>
{{ projects.find(project => project.id === runningTimeInfo.projectId) ? projects.find(project => project.id === runningTimeInfo.projectId).name : "Projekt auswählen" }}
</template>
</USelectMenu>
</UFormGroup>
<UFormGroup
label="Kategorie:"
>
<USelectMenu
v-model="runningTimeInfo.type"
:options="timeTypes"
option-attribute="label"
value-attribute="label"
>
<template #label>
{{runningTimeInfo.type ? runningTimeInfo.type : "Kategorie auswählen"}}
</template>
</USelectMenu>
</UFormGroup>
</div>
<UModal <UModal
v-model="showAddTimeModal" v-model="showAddTimeModal"
@@ -226,7 +272,7 @@ const selectStartedTime = () => {
:preview-format="format" :preview-format="format"
/> />
</UFormGroup> </UFormGroup>
<!-- <UFormGroup <!-- <UFormGroup
label="Dauer:" label="Dauer:"
> >
<UInput <UInput
@@ -294,66 +340,13 @@ const selectStartedTime = () => {
</UCard> </UCard>
</UModal> </UModal>
<div>
<div v-if="runningTimeInfo.id" class="mt-3">
Start: {{dayjs(runningTimeInfo.start).format("DD.MM.YY HH:mm")}}
<UFormGroup
label="Notizen:"
>
<UTextarea
v-model="runningTimeInfo.notes"
/>
</UFormGroup>
<UFormGroup
label="Projekt:"
>
<USelectMenu
:options="projects"
option-attribute="name"
value-attribute="id"
v-model="runningTimeInfo.projectId"
>
<template #label>
{{ projects.find(project => project.id === runningTimeInfo.projectId) ? projects.find(project => project.id === runningTimeInfo.projectId).name : "Projekt auswählen" }}
</template>
</USelectMenu>
</UFormGroup>
<UFormGroup
label="Kategorie:"
>
<USelectMenu
v-model="runningTimeInfo.type"
:options="timeTypes"
option-attribute="label"
value-attribute="label"
>
<template #label>
{{runningTimeInfo.type ? runningTimeInfo.type : "Kategorie auswählen"}}
</template>
</USelectMenu>
</UFormGroup>
</div>
</div>
<UDivider class="mt-3"/> <UDivider class="mt-3"/>
<UTable <UTable
class="mt-3" class="mt-3"
v-if="times && user"
:columns="columns" :columns="columns"
:rows="times.filter(time => time.user === user.id)" :rows="filteredRows"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
> >
<template #user-data="{row}"> <template #user-data="{row}">
{{profiles.find(profile => profile.id === row.user) ? profiles.find(profile => profile.id === row.user).firstName + " " + profiles.find(profile => profile.id === row.user).lastName : row.user }} {{profiles.find(profile => profile.id === row.user) ? profiles.find(profile => profile.id === row.user).firstName + " " + profiles.find(profile => profile.id === row.user).lastName : row.user }}
@@ -369,8 +362,6 @@ const selectStartedTime = () => {
{{projects.find(project => project.id === row.projectId) ? projects.find(project => project.id === row.projectId).name : ""}} {{projects.find(project => project.id === row.projectId) ? projects.find(project => project.id === row.projectId).name : ""}}
</template> </template>
</UTable> </UTable>
</div>
</template> </template>
<style scoped> <style scoped>

View File

@@ -16,7 +16,7 @@
:rows="filteredRows" :rows="filteredRows"
:columns="itemColumns" :columns="itemColumns"
@select="selectItem" @select="selectItem"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
/> />

View File

@@ -17,7 +17,7 @@
:rows="filteredRows" :rows="filteredRows"
:columns="itemColumns" :columns="itemColumns"
@select="selectItem" @select="selectItem"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
/> />
</div> </div>

View File

@@ -133,7 +133,7 @@ export const useDataStore = defineStore('data', {
}, },
async fetchVendors() { async fetchVendors() {
// @ts-ignore // @ts-ignore
this.vendors = (await supabase.from("vendors").select()).data this.vendors = (await supabase.from("vendors").select().order('vendorNumber',{ascending: true})).data
}, },
async fetchVendorInvoices() { async fetchVendorInvoices() {
// @ts-ignore // @ts-ignore