mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[task overview] styl, drag &drop
This commit is contained in:
1 parent
cae9832d87
commit
0c394fb513
7 files changed
+13978
-193
No files matched your search
@@ -2,16 +2,16 @@
|
||||
<div>
|
||||
<A-task-filter @weekChange="getWeekData" />
|
||||
<W-loadable :content="timelineData" class="w-loadable" empty-message="Nepodarilo sa nacitat data!">
|
||||
<Z-timeline :calData="timelineData" :calConfig="config" />
|
||||
<Z-timeline :calData="timelineData" :calConfig="config" @eventMoved="onEventMoved" />
|
||||
</W-loadable>
|
||||
|
||||
<v-snackbar
|
||||
v-model="errorToast"
|
||||
:timeout="2000"
|
||||
color="white"
|
||||
color="red"
|
||||
:rounded="true"
|
||||
>
|
||||
Nepodarilo sa nacitat data!
|
||||
{{ errorToastMessage }}
|
||||
</v-snackbar>
|
||||
</div>
|
||||
</template>
|
||||
@@ -30,6 +30,7 @@ export default {
|
||||
return {
|
||||
timelineData: null,
|
||||
errorToast: false,
|
||||
errorToastMessage: "Nepodarilo sa nacitat data!",
|
||||
dataLoaded: false,
|
||||
config: {
|
||||
date: new Date(),
|
||||
@@ -48,7 +49,7 @@ export default {
|
||||
} catch(error) {
|
||||
this.timelineData = {}
|
||||
console.error(error)
|
||||
this.errorToast = true
|
||||
this.triggerToast("Nepodarilo sa nacitat data!")
|
||||
}
|
||||
},
|
||||
|
||||
@@ -57,6 +58,8 @@ export default {
|
||||
this.timelineData.dates.forEach(event => {
|
||||
event.start = new Date(event.starts_at)
|
||||
event.end = new Date(event.ends_at)
|
||||
event.name = this.timelineData.name
|
||||
event.surname = this.timelineData.surname
|
||||
delete event.starts_at
|
||||
delete event.ends_at
|
||||
})
|
||||
@@ -65,6 +68,25 @@ export default {
|
||||
this.config.startHour = Number(this.timelineData.work_hours_from.split(':')[0]) - 1
|
||||
this.config.endHour = Number(this.timelineData.work_hours_to.split(':')[0]) + 1
|
||||
},
|
||||
|
||||
triggerToast(message) {
|
||||
this.errorToastMessage = message
|
||||
this.errorToast = true
|
||||
},
|
||||
|
||||
async onEventMoved(event) {
|
||||
try {
|
||||
await this.$axios.post_auth_data(`v1/overview/tasks/${event.event.id}`, {start: event.event.start, end: event.event.end})
|
||||
} catch(error) {
|
||||
this.triggerToast("Nepodarilo sa presunut ulohu!")
|
||||
this.timelineData.dates.filter(e => {
|
||||
if (e.id == event.event.id) {
|
||||
e.start = new Date(event.originalEvent.start)
|
||||
e.end = new Date(event.originalEvent.end)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in new issue
Block a user