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 22:35:52 +02: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 22:35:52 +02: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 22:35:52 +02: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 22:35:52 +02: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 22:35:52 +02: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 22:35:52 +02: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
|
|
|
|
2021-10-03 15:54:24 +02:00
|
|
|
<transition name="modal">
|
|
|
|
<task-detail-view-modal v-if="showTaskDetail" />
|
|
|
|
</transition>
|
2021-01-24 13:00:21 +00:00
|
|
|
</card>
|
2019-04-29 21:41:39 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-09-05 22:35:52 +02: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
|
|
|
|
2021-10-03 15:54:24 +02:00
|
|
|
import TaskDetailViewModal, { useShowModal } from '@/views/tasks/TaskDetailViewModal.vue'
|
|
|
|
|
2020-09-05 22:35:52 +02:00
|
|
|
export default {
|
|
|
|
name: 'Gantt',
|
|
|
|
components: {
|
|
|
|
Fancycheckbox,
|
|
|
|
flatPickr,
|
|
|
|
GanttChart,
|
2021-10-03 15:54:24 +02:00
|
|
|
TaskDetailViewModal,
|
|
|
|
},
|
|
|
|
setup() {
|
|
|
|
return {
|
|
|
|
showTaskDetail: useShowModal(),
|
|
|
|
}
|
2020-09-05 22:35:52 +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.
|
|
|
|
saveListView(this.$route.params.listId, this.$route.name)
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
showTaskswithoutDates: false,
|
|
|
|
dayWidth: 35,
|
2021-09-08 11:59:38 +02:00
|
|
|
dateFrom: new Date((new Date()).setDate((new Date()).getDate() - 15)),
|
|
|
|
dateTo: new Date((new Date()).setDate((new Date()).getDate() + 30)),
|
2020-09-05 22:35:52 +02:00
|
|
|
}
|
|
|
|
},
|
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 22:35:52 +02:00
|
|
|
}
|
2021-10-18 14:20:23 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.gantt-chart-container {
|
|
|
|
padding-bottom: 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.gantt-options {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
@media screen and (max-width: $tablet) {
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
.range-picker {
|
|
|
|
display: flex;
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
width: 50%;
|
|
|
|
|
|
|
|
@media screen and (max-width: $tablet) {
|
|
|
|
flex-direction: column;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.field {
|
|
|
|
margin-bottom: 0;
|
|
|
|
width: 33%;
|
|
|
|
|
|
|
|
&:not(:last-child) {
|
|
|
|
padding-right: .5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media screen and (max-width: $tablet) {
|
|
|
|
width: 100%;
|
|
|
|
max-width: 100%;
|
|
|
|
margin-top: .5rem;
|
|
|
|
padding-right: 0 !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
&, .input {
|
|
|
|
font-size: .8rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.select, .select select {
|
|
|
|
height: auto;
|
|
|
|
width: 100%;
|
|
|
|
font-size: .8rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.label {
|
|
|
|
font-size: .9rem;
|
|
|
|
padding-left: .4rem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// vue-draggable overwrites
|
|
|
|
.vdr.active::before {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
</style>
|