This commit is contained in:
romankko2 committed 2023-01-24 23:01:52 +01:00
commit 26792a85a6
44 files changed
+1039 -43

No files matched your search

@@ -32,27 +32,30 @@ export default {
filteredEvents: []
}
},
async created() {
try {
const events = await this.$axios.get_auth_data('v1/overview/projects')
this.events = events.map((item) => ({
id: item.id,
title: `${item.project_code} - ${item.name}`,
title_html: `${item.project_code} - <b>${item.name}</b>`,
start: item.starts_at,
end: item.deadline,
is_finished: item.is_finished,
project_code: item.project_code,
backgroundColor: item.color,
borderColor: item.color
}))
this.filteredEvents = this.events.filter((item) => !item.is_finished)
} catch (error) {
this.$toast.error(error)
}
created() {
this._getData()
},
methods: {
// Kravarik: TODO prepojit filtrovanie na BE
async _getData() {
try {
const events = await this.$axios.get_auth_data('v1/overview/projects')
this.events = events.map((item) => ({
id: item.id,
title: `${item.project_code} - ${item.name}`,
title_html: `${item.project_code} - <b>${item.name}</b>`,
start: item.starts_at,
end: item.deadline,
is_finished: item.is_finished,
project_code: item.project_code,
backgroundColor: item.color,
borderColor: item.color
}))
this.filteredEvents = this.events.filter((item) => !item.is_finished)
} catch (error) {
this.$toast.error(error)
}
},
onFilterChanged(filterValues) {
this.filter = filterValues
this.filteredEvents = this.events.filter((item) => this.filter.showFinishedTasks || item.is_finished == false)