Some Changes in TimeTracking and boosting Mobile View
This commit is contained in:
@@ -9,14 +9,15 @@ const toast = useToast()
|
|||||||
console.log(user)
|
console.log(user)
|
||||||
|
|
||||||
const {times, projects} = storeToRefs(useDataStore())
|
const {times, projects} = storeToRefs(useDataStore())
|
||||||
const {fetchTimes} = useDataStore()
|
const {fetchTimes, getTimeTypes} = useDataStore()
|
||||||
|
const timeTypes = getTimeTypes
|
||||||
const timeInfo = ref({
|
const timeInfo = ref({
|
||||||
user: "",
|
user: "",
|
||||||
start: "",
|
start: "",
|
||||||
end: null,
|
end: null,
|
||||||
notes: null,
|
notes: null,
|
||||||
projectId: null
|
projectId: null,
|
||||||
|
type: null
|
||||||
})
|
})
|
||||||
|
|
||||||
const runningTimeInfo = ref({
|
const runningTimeInfo = ref({
|
||||||
@@ -87,6 +88,7 @@ const selectStartedTime = () => {
|
|||||||
<UButton
|
<UButton
|
||||||
class="controlButton"
|
class="controlButton"
|
||||||
@click="stopStartedTime"
|
@click="stopStartedTime"
|
||||||
|
:disabled="!runningTimeInfo.id"
|
||||||
>
|
>
|
||||||
Stop
|
Stop
|
||||||
</UButton>
|
</UButton>
|
||||||
@@ -99,9 +101,16 @@ const selectStartedTime = () => {
|
|||||||
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
Aktuelle gestarteter Eintrag:
|
|
||||||
{{runningTimeInfo}}
|
|
||||||
|
|
||||||
|
<div class="mt-3">
|
||||||
|
Aktuelle gestarteter Eintrag:
|
||||||
|
{{runningTimeInfo.id ? runningTimeInfo : "Keine Zeit gewählt"}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="runningTimeInfo.id">
|
||||||
<UFormGroup
|
<UFormGroup
|
||||||
label="Notizen:"
|
label="Notizen:"
|
||||||
>
|
>
|
||||||
@@ -120,17 +129,37 @@ const selectStartedTime = () => {
|
|||||||
v-model="runningTimeInfo.projectId"
|
v-model="runningTimeInfo.projectId"
|
||||||
>
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
<span>{{ projects.find(project => project.id === runningTimeInfo.projectId) ? projects.find(project => project.id === runningTimeInfo.projectId).name : "" }}</span>
|
<span v-if="runningTimeInfo.projectId">{{ projects.find(project => project.id === runningTimeInfo.projectId) ? projects.find(project => project.id === runningTimeInfo.projectId).name : "" }}</span>
|
||||||
|
<span v-else>Projekt auswählen</span>
|
||||||
</template>
|
</template>
|
||||||
</USelectMenu>
|
</USelectMenu>
|
||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
|
|
||||||
|
<UFormGroup
|
||||||
|
label="Kategorie:"
|
||||||
|
>
|
||||||
|
<USelectMenu
|
||||||
|
v-model="runningTimeInfo.type"
|
||||||
|
:options="timeTypes"
|
||||||
|
option-attribute="label"
|
||||||
|
value-attribute="label"
|
||||||
|
/>
|
||||||
|
</UFormGroup>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<UTable :rows="times"/>
|
|
||||||
|
|
||||||
{{timeInfo}}
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<UDivider class="mt-3"/>
|
||||||
|
|
||||||
|
<UTable
|
||||||
|
class="mt-3"
|
||||||
|
v-if="times && user"
|
||||||
|
:rows="times.filter(time => time.user === user.id)"
|
||||||
|
/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ export const useDataStore = defineStore('data', {
|
|||||||
ownTenant: {
|
ownTenant: {
|
||||||
calendarConfig: {
|
calendarConfig: {
|
||||||
eventTypes: [] as any[]
|
eventTypes: [] as any[]
|
||||||
|
},
|
||||||
|
timeConfig: {
|
||||||
|
timeTypes: [] as any[]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
profiles: [] as any[],
|
profiles: [] as any[],
|
||||||
@@ -150,6 +153,7 @@ export const useDataStore = defineStore('data', {
|
|||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
getEventTypes: (state) => state.ownTenant.calendarConfig.eventTypes
|
getEventTypes: (state) => state.ownTenant.calendarConfig.eventTypes,
|
||||||
|
getTimeTypes: (state) => state.ownTenant.timeConfig.timeTypes
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
Reference in New Issue
Block a user