Add filters to gantt chart
This commit is contained in:
parent
3b48907514
commit
1d66218d5b
2 changed files with 38 additions and 3 deletions
|
@ -1,5 +1,22 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="gantt-chart box">
|
<div class="gantt-chart box">
|
||||||
|
<div class="filter-container">
|
||||||
|
<div class="items">
|
||||||
|
<button @click="showTaskFilter = !showTaskFilter" class="button">
|
||||||
|
<span class="icon is-small">
|
||||||
|
<icon icon="filter"/>
|
||||||
|
</span>
|
||||||
|
Filters
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<transition name="fade">
|
||||||
|
<filters
|
||||||
|
@change="loadTasks"
|
||||||
|
v-if="showTaskFilter"
|
||||||
|
v-model="params"
|
||||||
|
/>
|
||||||
|
</transition>
|
||||||
|
</div>
|
||||||
<div class="dates">
|
<div class="dates">
|
||||||
<template v-for="(y, yk) in days">
|
<template v-for="(y, yk) in days">
|
||||||
<div :key="yk + 'year'" class="months">
|
<div :key="yk + 'year'" class="months">
|
||||||
|
@ -149,10 +166,12 @@ import PriorityLabel from './partials/priorityLabel'
|
||||||
import TaskCollectionService from '../../services/taskCollection'
|
import TaskCollectionService from '../../services/taskCollection'
|
||||||
import {mapState} from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
import Rights from '../../models/rights.json'
|
import Rights from '../../models/rights.json'
|
||||||
|
import Filters from '@/components/list/partials/filters'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'GanttChart',
|
name: 'GanttChart',
|
||||||
components: {
|
components: {
|
||||||
|
Filters,
|
||||||
PriorityLabel,
|
PriorityLabel,
|
||||||
EditTask,
|
EditTask,
|
||||||
VueDragResize,
|
VueDragResize,
|
||||||
|
@ -196,6 +215,16 @@ export default {
|
||||||
newTaskFieldActive: false,
|
newTaskFieldActive: false,
|
||||||
priorities: {},
|
priorities: {},
|
||||||
taskCollectionService: TaskCollectionService,
|
taskCollectionService: TaskCollectionService,
|
||||||
|
showTaskFilter: false,
|
||||||
|
|
||||||
|
params: {
|
||||||
|
sort_by: ['done', 'id'],
|
||||||
|
order_by: ['asc', 'desc'],
|
||||||
|
filter_by: ['done'],
|
||||||
|
filter_value: ['false'],
|
||||||
|
filter_comparator: ['equals'],
|
||||||
|
filter_concat: 'and',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -245,12 +274,14 @@ export default {
|
||||||
},
|
},
|
||||||
parseTasks() {
|
parseTasks() {
|
||||||
this.setDates()
|
this.setDates()
|
||||||
this.prepareTasks()
|
this.loadTasks()
|
||||||
},
|
},
|
||||||
prepareTasks() {
|
loadTasks() {
|
||||||
|
this.$set(this, 'theTasks', [])
|
||||||
|
this.$set(this, 'tasksWithoutDates', [])
|
||||||
|
|
||||||
const getAllTasks = (page = 1) => {
|
const getAllTasks = (page = 1) => {
|
||||||
return this.taskCollectionService.getAll({listId: this.listId}, {}, page)
|
return this.taskCollectionService.getAll({listId: this.listId}, this.params, page)
|
||||||
.then(tasks => {
|
.then(tasks => {
|
||||||
if (page < this.taskCollectionService.totalPages) {
|
if (page < this.taskCollectionService.totalPages) {
|
||||||
return getAllTasks(page + 1)
|
return getAllTasks(page + 1)
|
||||||
|
|
|
@ -196,6 +196,10 @@ $gantt-vertical-border-color: lighten($grey, 45);
|
||||||
font-size: .68em;
|
font-size: .68em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.filter-container {
|
||||||
|
margin-top: -133px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.gantt-options {
|
.gantt-options {
|
||||||
|
|
Loading…
Reference in a new issue