2019-04-29 21:41:39 +00:00
|
|
|
<template>
|
2020-05-31 19:17:10 +00:00
|
|
|
<div class="gantt-chart-container">
|
2019-04-29 21:41:39 +00:00
|
|
|
<div class="gantt-options">
|
2020-04-01 20:13:57 +00:00
|
|
|
<fancycheckbox v-model="showTaskswithoutDates" class="is-block">
|
|
|
|
Show tasks which don't have dates set
|
|
|
|
</fancycheckbox>
|
2019-04-29 21:41:39 +00:00
|
|
|
<div class="range-picker">
|
|
|
|
<div class="field">
|
|
|
|
<label class="label" for="dayWidth">Size</label>
|
|
|
|
<div class="control">
|
|
|
|
<div class="select">
|
|
|
|
<select id="dayWidth" v-model.number="dayWidth">
|
|
|
|
<option value="35">Default</option>
|
|
|
|
<option value="10">Month</option>
|
|
|
|
<option value="80">Day</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<label class="label" for="fromDate">From</label>
|
|
|
|
<div class="control">
|
|
|
|
<flat-pickr
|
|
|
|
class="input"
|
|
|
|
v-model="dateFrom"
|
|
|
|
:config="flatPickerConfig"
|
|
|
|
id="fromDate"
|
|
|
|
placeholder="From"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<label class="label" for="toDate">To</label>
|
|
|
|
<div class="control">
|
|
|
|
<flat-pickr
|
|
|
|
class="input"
|
|
|
|
v-model="dateTo"
|
|
|
|
:config="flatPickerConfig"
|
|
|
|
id="toDate"
|
|
|
|
placeholder="To"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<gantt-chart
|
2020-04-25 23:11:34 +00:00
|
|
|
:list-id="Number($route.params.listId)"
|
2019-04-29 21:41:39 +00:00
|
|
|
:show-taskswithout-dates="showTaskswithoutDates"
|
|
|
|
:date-from="dateFrom"
|
|
|
|
:date-to="dateTo"
|
|
|
|
:day-width="dayWidth"
|
|
|
|
/>
|
2020-04-25 23:11:34 +00:00
|
|
|
|
|
|
|
<!-- This router view is used to show the task popup while keeping the gantt chart itself -->
|
|
|
|
<transition name="modal">
|
|
|
|
<router-view/>
|
|
|
|
</transition>
|
|
|
|
|
2019-04-29 21:41:39 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-06-17 22:15:59 +02:00
|
|
|
import GanttChart from '../../../components/tasks/gantt-component'
|
2019-04-29 21:41:39 +00:00
|
|
|
import flatPickr from 'vue-flatpickr-component'
|
2020-06-17 22:15:59 +02:00
|
|
|
import Fancycheckbox from '../../../components/input/fancycheckbox'
|
2020-05-22 17:28:26 +02:00
|
|
|
import {saveListView} from '../../../helpers/saveListView'
|
2019-04-29 21:41:39 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'Gantt',
|
|
|
|
components: {
|
2020-04-01 20:13:57 +00:00
|
|
|
Fancycheckbox,
|
2019-04-29 21:41:39 +00:00
|
|
|
flatPickr,
|
|
|
|
GanttChart
|
|
|
|
},
|
2020-05-21 11:12:59 +02:00
|
|
|
created() {
|
|
|
|
// Save the current list view to local storage
|
|
|
|
// We use local storage and not vuex here to make it persistent across reloads.
|
2020-05-22 17:28:26 +02:00
|
|
|
saveListView(this.$route.params.listId, this.$route.name)
|
2020-05-21 11:12:59 +02:00
|
|
|
},
|
2019-04-29 21:41:39 +00:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
showTaskswithoutDates: false,
|
|
|
|
dayWidth: 35,
|
|
|
|
dateFrom: null,
|
|
|
|
dateTo: null,
|
|
|
|
flatPickerConfig:{
|
|
|
|
altFormat: 'j M Y',
|
|
|
|
altInput: true,
|
|
|
|
dateFormat: 'Y-m-d',
|
|
|
|
enableTime: false,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
beforeMount() {
|
|
|
|
this.dateFrom = new Date((new Date()).setDate((new Date()).getDate() - 15))
|
|
|
|
this.dateTo = new Date((new Date()).setDate((new Date()).getDate() + 30))
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|