mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-22 06:49:35 +00:00
uprava modalov, [ongoing, unscheduled tasks] filter
This commit is contained in:
1 parent
278bdeabc7
commit
67afa56736
16 files changed
+647
-353
No files matched your search
@@ -13,7 +13,7 @@
|
||||
<tr v-for="task in tasks" :key="task.id">
|
||||
<td>{{ task.project_code }}</td>
|
||||
<td>{{ task.title }}</td>
|
||||
<td>{{ task.duration / 1000 / 60 / 60 }} h</td>
|
||||
<td>{{ (task.duration / 1000 / 60 / 60).toFixed(2) }} h</td>
|
||||
<td class="task-action">
|
||||
<div class="d-flex justify-start">
|
||||
<img class="pencil-icon" :src="require('@/plugins/tm@overview/_img/pencil-icon.svg')" alt="pencil-icon" :style="{opacity: 0.3}">
|
||||
|
||||
@@ -1,29 +1,59 @@
|
||||
<template>
|
||||
<W-loadable :content="unscheduledTasks">
|
||||
<A-unscheduled-table :tasks="unscheduledTasks" />
|
||||
</W-loadable>
|
||||
<div>
|
||||
|
||||
<Z-tasks-search @queryChange="filterUnscheduledTasks" />
|
||||
|
||||
<W-loadable :content="unscheduledTasks">
|
||||
<A-unscheduled-table :tasks="filteredUnscheduledTasks" />
|
||||
<h6
|
||||
v-if="filteredUnscheduledTasks && !filteredUnscheduledTasks.length"
|
||||
class="px-4"
|
||||
>
|
||||
Aktuálnemu hľadaniu nevyhovujú žiadne nenaplánované úlohy
|
||||
</h6>
|
||||
</W-loadable>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AUnscheduledTable from './_components/a-unscheduled-table.vue'
|
||||
import ZTasksSearch from '@/plugins/tm@overview/_components/z-tasks-search.vue'
|
||||
import AUnscheduledTable from './_components/a-unscheduled-table.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ZTasksSearch,
|
||||
AUnscheduledTable
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
unscheduledTasks: null
|
||||
unscheduledTasks: null,
|
||||
filteredUnscheduledTasks: []
|
||||
}
|
||||
},
|
||||
|
||||
async created() {
|
||||
try {
|
||||
this.unscheduledTasks = await this.$axios.get_auth_data('v1/overview/unscheduled-tasks')
|
||||
this.filterUnscheduledTasks()
|
||||
console.log(this.unscheduledTasks)
|
||||
} catch (error) {
|
||||
this.unscheduledTasks = {error: error.data.error}
|
||||
this.$toast.error(error.data.error)
|
||||
this.unscheduledTasks = error
|
||||
this.$toast.error(error)
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
filterUnscheduledTasks(searchQuery) {
|
||||
if(!searchQuery) return this.filteredUnscheduledTasks = this.unscheduledTasks
|
||||
this.filteredUnscheduledTasks = this.unscheduledTasks.filter((task) => {
|
||||
return this.filterParams(searchQuery, task.title) || this.filterParams(searchQuery, task.project_code)
|
||||
})
|
||||
},
|
||||
|
||||
filterParams(searchQuery, row) {
|
||||
return row.toLowerCase().includes(searchQuery.toLowerCase())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user