tasks and teams overview subheader refactor

This commit is contained in:
Filip Kaluža committed 2023-01-12 18:22:48 +01:00
1 parent c542ea7760
commit a05d69eedc
4 files changed
+68 -32

No files matched your search

+8 -7
View File
@@ -1,6 +1,6 @@
<template>
<div>
<A-task-filter :unscheduledTime="unscheduledTime" @weekChange="getWeekData" />
<A-task-filter :unscheduledTime="unscheduledTime" @dataChanged="getTimelineData" />
<W-loadable :content="timelineData" class="w-loadable" empty-message="Nepodarilo sa nacitat data!">
<Z-timeline :calData="timelineData" :calConfig="config" :splits="splitDays" @eventMoved="onEventMoved" @completeTask="completeTask" @deleteTask="deleteTask" />
@@ -33,13 +33,14 @@ export default {
},
methods: {
async getWeekData(week) {
this.config.date = week.firstDay
async getTimelineData(data) {
this.config.date = data.firstDay
const lastDay = addDays(data.firstDay, 6)
try {
this.timelineData = await this.$axios.get_auth_data('v1/overview/tasks')
this.formatTimelineDataToTimelineFormat(week.firstDay)
this.generateDays(week.firstDay)
this.generateNonWorkingHours(week.firstDay)
this.timelineData = await this.$axios.get_auth_data('v1/overview/tasks', {firstDay: data.firstDay, lastDay: lastDay, employeeId: data.employeeId})
this.formatTimelineDataToTimelineFormat(data.firstDay)
this.generateDays(data.firstDay)
this.generateNonWorkingHours(data.firstDay)
} catch (error) {
this.timelineData = {error: error || 'Nepodarilo sa nacitat data!'}
console.error(error)