This commit is contained in:
romankko2 committed 2023-09-01 17:25:18 +02:00
1 parent 622b6ea45b
commit 8972b538ea
3 files changed
+28 -9

No files matched your search

@@ -83,9 +83,14 @@
<small class="event-initials-date">{{ event.date?.toLocaleDateString('sk-SK') }}</small>
</div>
<div v-if="event.subtask?.deadline" class="d-flex align-center">
<div class="d-flex align-center">
<v-icon icon="mdi-skull-outline" size="small" />
<small class="ml-1" :class="`${tmUtils.isAfter(event.subtask?.deadline) ? 'text-black' : 'text-red-darken-4'}`">{{ tmUtils.formatDate(event.subtask?.deadline) }}</small>
<small v-if="event?.subtask.deadline" class="ml-1">{{ getDeadline(event?.subtask) }}</small>
<v-tooltip v-else text="Deadline z Mastertasku" location="bottom">
<template v-slot:activator="{ props }">
<small class="cursor-pointer ml-1" v-if="!event?.subtask?.deadline" v-bind="props">{{ getDeadline(event?.subtask) }}*</small>
</template>
</v-tooltip>
</div>
</div>
@@ -109,8 +114,10 @@
</template>
<script>
import { addDays } from 'date-fns'
import tmUtils from '@/plugins/tm@_utils/tm.utils'
import { addDays } from 'date-fns'
import tmUtils from '@/plugins/tm@_utils/tm.utils'
import { mapGetters } from 'vuex'
import moment from 'moment'
export default {
props: {
@@ -154,7 +161,18 @@ export default {
}
},
computed: {
...mapGetters('tm', ['mastertasks'])
},
methods: {
getDeadline(subtask) {
if(subtask.deadline) return moment(subtask.deadline).format('DD.MM.yyyy')
else if(!this.mastertasks) return ''
const masterTask = this.mastertasks.find((mt) => mt.id === subtask.master_task_id)
return moment(masterTask).format('DD.MM.yyyy') ? moment(masterTask.deadline).format('DD.MM.yyyy') : ''
},
weekChanged() {
const scrollContainer = this.$el.getElementsByClassName('vuecal__scrollable-body')[0]
scrollContainer.scrollLeft = 0
@@ -294,8 +312,8 @@ export default {
.colWidth
width: 120px
@media (min-width: 1476px)
width: 100% !important
// @media (min-width: 1476px)
// width: 100% !important
.vuecal
box-shadow: none !important
@@ -466,7 +484,7 @@ export default {
&.vuecal__event--focus
z-index: 100 !important
min-height: 250px !important
min-height: 350px !important
width: 100% !important
left: 0 !important
@@ -5,7 +5,8 @@ export default {
methods: {
handleKeyDown(event) {
if (event.keyCode === 27) this.closeModal()
// if (event.keyCode === 27) this.closeModal()
if (event.keyCode === 27) this.visible = false
}
},
}
@@ -39,7 +39,7 @@ export default {
async complete() {
try {
const tempMastertask = {...this.mastertask, is_finished: this.mastertask.is_finished ? 0 : 1, duration: this.mastertask.duration }
const tempMastertask = {...this.mastertask, is_finished: this.mastertask.is_finished ? 0 : 1 }
const { mastertask } = await this.$axios.put_auth(`v1/mastertasks/${tempMastertask.id}`, tempMastertask)
this.visible = false