mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-22 06:49:35 +00:00
[task overview, teams overview] nenaplanovany cas
This commit is contained in:
1 parent
8d49ad7122
commit
536fa40609
7 files changed
+285
-13946
No files matched your search
@@ -19,9 +19,9 @@
|
||||
<v-btn class="subheader-icon-button next" variant="outlined" @click="nextDay()"><img :src="require('../../tasks/_components/_img/icon-next.svg')" alt=""></v-btn>
|
||||
</div>
|
||||
<v-text-field
|
||||
class="subheader-input"
|
||||
class="subheader-input disabled"
|
||||
label="Nenaplánované hodiny"
|
||||
v-model="plannedTime"
|
||||
v-model="time"
|
||||
variant="outlined"
|
||||
></v-text-field>
|
||||
</v-row>
|
||||
@@ -31,12 +31,20 @@
|
||||
import { addDays, subDays } from 'date-fns'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
unscheduledTime: {
|
||||
type: Number,
|
||||
default() {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
employees: ['Foo', 'Bar', 'Fizz', 'Buzz'],
|
||||
selectedDate: new Date(),
|
||||
day: new Date(),
|
||||
plannedTime: "35 h",
|
||||
selectedEmployee: 'Bar',
|
||||
date: new Date()
|
||||
}
|
||||
@@ -46,6 +54,12 @@ export default {
|
||||
this.getDay()
|
||||
},
|
||||
|
||||
computed: {
|
||||
time() {
|
||||
return this.unscheduledTime
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
getDay() {
|
||||
const today = new Date()
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div>
|
||||
<A-team-filter @dayChanged="getDayData" />
|
||||
<A-team-filter :unscheduledTime="unscheduledTime" @dayChanged="getDayData" />
|
||||
|
||||
<W-loadable :content="timelineData" class="w-loadable" empty-message="Nepodarilo sa nacitat data!">
|
||||
<Z-timeline :calData="timelineData" :calConfig="config" :splits="splitDays" @eventMoved="onEventMoved" />
|
||||
<Z-timeline :calData="timelineData" :calConfig="config" :splits="splitDays" @eventMoved="onEventMoved" @completeTask="completeTask" @reopenTask="reopenTask" @deleteTask="deleteTask" />
|
||||
</W-loadable>
|
||||
|
||||
<v-snackbar
|
||||
@@ -37,6 +37,7 @@ export default {
|
||||
errorToastMessage: "Nepodarilo sa nacitat data!",
|
||||
dataLoaded: false,
|
||||
splitDays: [],
|
||||
unscheduledTime: 0,
|
||||
config: {
|
||||
date: new Date(),
|
||||
scrollHour: 7,
|
||||
@@ -75,7 +76,8 @@ export default {
|
||||
|
||||
formatData() {
|
||||
this.timelineData.tasks = []
|
||||
|
||||
this.unscheduledTime = 0
|
||||
|
||||
// format events
|
||||
this.timelineData.forEach(user => {
|
||||
user.tasks.forEach(event => {
|
||||
@@ -87,7 +89,10 @@ export default {
|
||||
event.split = user.splitId
|
||||
})
|
||||
this.timelineData.tasks.push(...user.tasks)
|
||||
this.unscheduledTime += user.unscheduled_time
|
||||
})
|
||||
|
||||
this.unscheduledTime = Math.floor(this.unscheduledTime / 60) + "," + String(this.unscheduledTime % 60)[0] + " h"
|
||||
},
|
||||
|
||||
generateNonWorkingHours(date) {
|
||||
@@ -144,6 +149,26 @@ export default {
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
},
|
||||
|
||||
completeTask(id) {
|
||||
this.timelineData.tasks.filter(task => {
|
||||
if (task.id == id) {
|
||||
task.completed = true
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
reopenTask(id) {
|
||||
this.timelineData.tasks.filter(task => {
|
||||
if (task.id == id) {
|
||||
task.completed = false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
deleteTask(id) {
|
||||
this.timelineData.tasks.splice(this.timelineData.tasks.findIndex(item => item.id === id), 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user