Ermögliche das Abrufen von Zeitkorrekturen für ein spezifisches Datum und aktualisiere die Benutzeroberfläche entsprechend
All checks were successful
Deploy production / deploy (push) Successful in 48s

This commit is contained in:
Torsten Schulz (local)
2026-08-26 16:19:39 +02:00
parent 4e6eeb470d
commit 4787700cd0
7 changed files with 77 additions and 77 deletions

View File

@@ -98,16 +98,22 @@
</form>
</div>
<!-- Tabelle der heutigen Zeitkorrekturen -->
<!-- Tabelle der Zeitkorrekturen für ein korrigiertes Datum -->
<div class="card table-card">
<h2>Zeitkorrekturen von heute</h2>
<div class="timefix-list-header">
<h2>Zeitkorrekturen</h2>
<label>
Korrigiertes Datum
<input v-model="timefixDate" type="date" @change="loadTimefixes" />
</label>
</div>
<div v-if="loading && timefixes.length === 0" class="loading">
Lade Zeitkorrekturen...
</div>
<div v-else-if="timefixes.length === 0" class="empty-state">
Keine Zeitkorrekturen für heute vorhanden.
Keine Zeitkorrekturen für dieses Datum vorhanden.
</div>
<table v-else class="timefix-table">
@@ -164,13 +170,15 @@ const authStore = useAuthStore()
const timefixes = ref([])
const availableEntries = ref([])
const loading = ref(false)
const today = new Date().toISOString().split('T')[0]
const timefixDate = ref(today)
const { showModal, modalConfig, alert, confirm, onConfirm, onCancel } = useModal()
const form = ref({
originalDate: new Date().toISOString().split('T')[0],
originalDate: today,
worklogId: '',
newDate: new Date().toISOString().split('T')[0],
newDate: today,
newTime: '',
newAction: ''
})
@@ -223,11 +231,11 @@ function onEntrySelected() {
}
}
// Lade alle Zeitkorrekturen für heute
// Lade alle Zeitkorrekturen für das ausgewählte korrigierte Datum
async function loadTimefixes() {
try {
loading.value = true
const response = await fetch(`${API_URL}/timefix`, {
const response = await fetch(`${API_URL}/timefix?date=${encodeURIComponent(timefixDate.value)}`, {
headers: authStore.getAuthHeaders()
})
@@ -251,6 +259,7 @@ async function createTimefix() {
try {
loading.value = true
const correctedDate = form.value.newDate
const response = await fetch(`${API_URL}/timefix`, {
method: 'POST',
headers: {
@@ -271,6 +280,7 @@ async function createTimefix() {
}
resetForm()
timefixDate.value = correctedDate
await Promise.all([
loadTimefixes(),
loadWorklogEntries() // Lade auch die Dropdown-Liste neu
@@ -339,9 +349,9 @@ function formatAction(action) {
// Formular zurücksetzen
function resetForm() {
form.value = {
originalDate: new Date().toISOString().split('T')[0],
originalDate: today,
worklogId: '',
newDate: new Date().toISOString().split('T')[0],
newDate: today,
newTime: '',
newAction: ''
}
@@ -464,6 +474,24 @@ input:disabled, select:disabled {
}
/* Tabelle */
.timefix-list-header {
display: flex;
justify-content: space-between;
align-items: end;
gap: 16px;
margin-bottom: 20px;
}
.timefix-list-header h2 {
margin-bottom: 0;
}
.timefix-list-header label {
display: flex;
flex-direction: column;
margin-bottom: 0;
}
.timefix-table {
width: 100%;
border-collapse: collapse;
@@ -515,4 +543,3 @@ input:disabled, select:disabled {
color: #7f8c8d;
}
</style>