Files
jandl-taskmanager-app/app/src/plugins/tm@overview/tasks-ongoing/_components/a-ongoing-table.vue
T
2023-04-13 23:49:31 +02:00

73 lines
1.8 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">Naplánované</th>
<th class="text-left">Zostávajúce</th>
<th class="text-left">Akcia</th>
</tr>
</thead>
<tbody>
<tr class="cursor-pointer" v-for="subtask in subtasks" :key="subtask.id" @click.stop="editTask(subtask, false)">
<td>{{ subtask.project_code }}</td>
<td>{{ subtask.master_task?.name || subtask.master_task }}</td>
<td>{{ subtask.duration }} h</td>
<td>{{ subtask.duration - subtask.spent_time }} h</td>
<td class="task-action">
<div class="d-flex justify-start">
<img class="pencil-icon" :src="require('@/plugins/app/_img/icons/eye.svg')" alt="pencil-icon" @click.stop="editTask(subtask, false)">
<!-- <img class="pencil-icon" :src="require('@/plugins/app/_img/icons/pencil.svg')" alt="pencil-icon" @click.stop="editTask(subtask, true)" /> -->
<img class="trash-icon" :src="require('@/plugins/app/_img/icons/bin.svg')" alt="trash-icon" @click.stop="deleteTask(subtask)" />
</div>
</td>
</tr>
</tbody>
</v-table>
</template>
<script>
export default {
props: {
subtasks: {
type: Array,
required: true
}
},
methods: {
editTask(subtask, editMode = false) {
this.$events.emit('show-subtask-modal', {subtask, editMode})
},
deleteTask(subtask) {
this.$events.emit('show-delete-task-modal', {subtask})
}
}
}
</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: 496px)
.task-action
div
display: flex
flex-direction: column
.pencil-icon, .trash-icon
border-radius: 50%
margin: 6px
padding: 6px
tbody
tr:hover
background: rgba(0,0,0,.1)
</style>