mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +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
@@ -1,29 +1,58 @@
|
||||
<template>
|
||||
<W-loadable :content="ongoingTasks">
|
||||
<A-ongoing-table :tasks="ongoingTasks" />
|
||||
</W-loadable>
|
||||
<div>
|
||||
|
||||
<Z-tasks-search @queryChange="filterOngoingTasks" />
|
||||
|
||||
<W-loadable :content="ongoingTasks">
|
||||
<A-ongoing-table :tasks="filteredOngoingTasks" />
|
||||
<h6
|
||||
v-if="filteredOngoingTasks && !filteredOngoingTasks.length"
|
||||
class="px-4"
|
||||
>
|
||||
Aktuálnemu hľadaniu nevyhovujú žiadne prebiehajúce úlohy
|
||||
</h6>
|
||||
</W-loadable>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AOngoingTable from './_components/a-ongoing-table.vue'
|
||||
import ZTasksSearch from '@/plugins/tm@overview/_components/z-tasks-search.vue'
|
||||
import AOngoingTable from './_components/a-ongoing-table.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ZTasksSearch,
|
||||
AOngoingTable
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
ongoingTasks: null
|
||||
ongoingTasks: null,
|
||||
filteredOngoingTasks: []
|
||||
}
|
||||
},
|
||||
|
||||
async created() {
|
||||
try {
|
||||
this.ongoingTasks = await this.$axios.get_auth_data('v1/overview/ongoing-tasks')
|
||||
this.filterOngoingTasks()
|
||||
} catch (error) {
|
||||
this.ongoingTasks = {error: error.data.error}
|
||||
this.$toast.error(error.data.error)
|
||||
this.ongoingTasks = error
|
||||
this.$toast.error(error)
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
filterOngoingTasks(searchQuery) {
|
||||
if(!searchQuery) return this.filteredOngoingTasks = this.ongoingTasks
|
||||
this.filteredOngoingTasks = this.ongoingTasks.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