Files
jandl-taskmanager-app/app/src/plugins/tm@overview/tasks-unscheduled/_components/a-unscheduled-table.vue
T

78 lines
1.7 KiB
Vue

<template>
<v-table>
<thead>
<tr>
<th class="text-left">Kód projektu</th>
<th class="text-left">Názov</th>
<th class="text-left">Trvanie</th>
<th class="text-left">Akcia</th>
</tr>
</thead>
<tbody>
<tr v-for="task in tasks" :key="task.id">
<td>{{ task.project_code }}</td>
<td>{{ task.title }}</td>
<td>{{ task.duration / 1000 / 60 / 60 }} h</td>
<td class="task-action">
<div class="d-flex justify-start">
<img class="pencil-icon" :src="require('@/plugins/tm@overview/_img/pencil-icon.svg')" alt="pencil-icon">
<img class="trash-icon" :src="require('@/plugins/tm@overview/_img/trash-icon.svg')" alt="trash-icon" @click.stop="showDeleteModal = true">
<A-delete-task-modal :show="showDeleteModal" :task="task" @delete-task="deleteTask" @close-modal="showDeleteModal = false" />
</div>
</td>
</tr>
</tbody>
</v-table>
</template>
<script>
import ADeleteTaskModal from '@/plugins/app/_components/a-delete-task-modal.vue'
export default {
components: {
ADeleteTaskModal
},
props: {
tasks: {
type: Array,
required: true
}
},
data() {
return {
showDeleteModal: false
}
},
methods: {
async deleteTask(id) {
try {
await this.$axios.delete(`v1/teams/${id}`)
this.showDeleteModal = false
} catch (error) {
this.$toast.error(error)
}
}
}
}
</script>
<style lang="sass" scoped>
v-table, th, td
border: thin solid rgba(var(--v-border-color), var(--v-border-opacity))
@media screen and (max-width: 379px)
.task-action
div
display: flex
flex-direction: column
.pencil-icon, .trash-icon
border-radius: 50%
margin: 6px
padding: 6px
</style>