Files
jandl-taskmanager-app/app/src/plugins/tm@overview/tasks-unscheduled/_components/a-unscheduled-table.vue
T
2023-02-22 16:44:20 +01:00

69 lines
1.6 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 class="cursor-pointer" v-for="task in tasks" :key="task.id" @click.stop="editTask(task, false)">
<td>{{ task.project_code }}</td>
<td>{{ task.master_task?.name || task.master_task }}</td>
<td>{{ task.spent_time }} h</td>
<td class="task-action">
<div class="d-flex justify-start">
<img class="pencil-icon mr-3" :src="require('@/plugins/app/_img/icons/eye.svg')" alt="pencil-icon" @click.stop="editTask(task, false)">
<img class="pencil-icon" :src="require('@/plugins/app/_img/icons/pencil.svg')" alt="pencil-icon" @click.stop="editTask(task, true)">
<img class="trash-icon" :src="require('@/plugins/app/_img/icons/bin.svg')" alt="trash-icon" @click.stop="deleteTask(task)">
</div>
</td>
</tr>
</tbody>
</v-table>
</template>
<script>
export default {
props: {
tasks: {
type: Array,
required: true
}
},
methods: {
editTask(task, editMode) {
this.$events.emit('show-task-modal', {task, editMode})
},
deleteTask(task) {
this.$events.emit('show-delete-task-modal', {task})
}
}
}
</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
tbody
tr:hover
background: rgba(0,0,0,.1)
</style>