2019-04-29 21:41:39 +00:00
|
|
|
<template>
|
2020-05-31 19:17:10 +00:00
|
|
|
<div class="gantt-chart-container">
|
2021-01-24 13:00:21 +00:00
|
|
|
<card :padding="false" class="has-overflow">
|
|
|
|
<div class="gantt-options p-4">
|
2020-09-05 20:35:52 +00:00
|
|
|
<fancycheckbox class="is-block" v-model="showTaskswithoutDates">
|
2021-06-23 23:24:57 +00:00
|
|
|
{{ $t('list.gantt.showTasksWithoutDates') }}
|
2020-04-01 20:13:57 +00:00
|
|
|
</fancycheckbox>
|
2019-04-29 21:41:39 +00:00
|
|
|
<div class="range-picker">
|
|
|
|
<div class="field">
|
2021-06-23 23:24:57 +00:00
|
|
|
<label class="label" for="dayWidth">{{ $t('list.gantt.size') }}</label>
|
2019-04-29 21:41:39 +00:00
|
|
|
<div class="control">
|
|
|
|
<div class="select">
|
|
|
|
<select id="dayWidth" v-model.number="dayWidth">
|
2021-06-23 23:24:57 +00:00
|
|
|
<option value="35">{{ $t('list.gantt.default') }}</option>
|
|
|
|
<option value="10">{{ $t('list.gantt.month') }}</option>
|
|
|
|
<option value="80">{{ $t('list.gantt.day') }}</option>
|
2019-04-29 21:41:39 +00:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
2021-06-23 23:24:57 +00:00
|
|
|
<label class="label" for="fromDate">{{ $t('list.gantt.from') }}</label>
|
2019-04-29 21:41:39 +00:00
|
|
|
<div class="control">
|
|
|
|
<flat-pickr
|
|
|
|
:config="flatPickerConfig"
|
2020-09-05 20:35:52 +00:00
|
|
|
class="input"
|
2019-04-29 21:41:39 +00:00
|
|
|
id="fromDate"
|
2021-06-23 23:24:57 +00:00
|
|
|
:placeholder="$t('list.gantt.from')"
|
2020-09-05 20:35:52 +00:00
|
|
|
v-model="dateFrom"
|
2019-04-29 21:41:39 +00:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
2021-06-23 23:24:57 +00:00
|
|
|
<label class="label" for="toDate">{{ $t('list.gantt.to') }}</label>
|
2019-04-29 21:41:39 +00:00
|
|
|
<div class="control">
|
|
|
|
<flat-pickr
|
|
|
|
:config="flatPickerConfig"
|
2020-09-05 20:35:52 +00:00
|
|
|
class="input"
|
2019-04-29 21:41:39 +00:00
|
|
|
id="toDate"
|
2021-06-23 23:24:57 +00:00
|
|
|
:placeholder="$t('list.gantt.to')"
|
2020-09-05 20:35:52 +00:00
|
|
|
v-model="dateTo"
|
2019-04-29 21:41:39 +00:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<gantt-chart
|
|
|
|
:date-from="dateFrom"
|
|
|
|
:date-to="dateTo"
|
|
|
|
:day-width="dayWidth"
|
2020-09-05 20:35:52 +00:00
|
|
|
:list-id="Number($route.params.listId)"
|
|
|
|
:show-taskswithout-dates="showTaskswithoutDates"
|
2019-04-29 21:41:39 +00:00
|
|
|
/>
|
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>
|
|
|
|
|
2021-01-24 13:00:21 +00:00
|
|
|
</card>
|
2019-04-29 21:41:39 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-09-05 20:35:52 +00:00
|
|
|
import GanttChart from '../../../components/tasks/gantt-component'
|
|
|
|
import flatPickr from 'vue-flatpickr-component'
|
|
|
|
import Fancycheckbox from '../../../components/input/fancycheckbox'
|
|
|
|
import {saveListView} from '@/helpers/saveListView'
|
2019-04-29 21:41:39 +00:00
|
|
|
|
2020-09-05 20:35:52 +00:00
|
|
|
export default {
|
|
|
|
name: 'Gantt',
|
|
|
|
components: {
|
|
|
|
Fancycheckbox,
|
|
|
|
flatPickr,
|
|
|
|
GanttChart,
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
// Save the current list view to local storage
|
|
|
|
// We use local storage and not vuex here to make it persistent across reloads.
|
|
|
|
saveListView(this.$route.params.listId, this.$route.name)
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
showTaskswithoutDates: false,
|
|
|
|
dayWidth: 35,
|
|
|
|
dateFrom: null,
|
|
|
|
dateTo: null,
|
|
|
|
}
|
|
|
|
},
|
2021-06-23 23:24:57 +00:00
|
|
|
computed: {
|
|
|
|
flatPickerConfig() {
|
|
|
|
return {
|
|
|
|
altFormat: this.$t('date.altFormatShort'),
|
|
|
|
altInput: true,
|
|
|
|
dateFormat: 'Y-m-d',
|
|
|
|
enableTime: false,
|
|
|
|
locale: {
|
|
|
|
firstDayOfWeek: this.$store.state.auth.settings.weekStart,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
2020-09-05 20:35:52 +00:00
|
|
|
beforeMount() {
|
|
|
|
this.dateFrom = new Date((new Date()).setDate((new Date()).getDate() - 15))
|
|
|
|
this.dateTo = new Date((new Date()).setDate((new Date()).getDate() + 30))
|
|
|
|
},
|
|
|
|
}
|
2019-04-29 21:41:39 +00:00
|
|
|
</script>
|