mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[detail modals] download files, [projects overview] project filter
This commit is contained in:
1 parent
6e8f57d06d
commit
dca66d9a50
4 files changed
+26
-6
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row class="px-10 py-8 subheader">
|
<v-row class="px-10 py-8 subheader">
|
||||||
<v-select v-model="filter.selectedProject" class="subheader-input" :items="[null, projects]" label="Projekt" variant="outlined" :disabled="true" />
|
<v-select v-model="filter.selectedProject" class="subheader-input" :items="[null, ...projects]" item-title="name" item-value="id" label="Projekt" variant="outlined" />
|
||||||
|
|
||||||
<v-select v-model="filter.selectedTeam" class="subheader-input" :items="[null, ...teams]" label="Tím" variant="outlined" item-title="name" item-value="id" />
|
<v-select v-model="filter.selectedTeam" class="subheader-input" :items="[null, ...teams]" label="Tím" variant="outlined" item-title="name" item-value="id" />
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import AProjectCalendar from './_components/a-project-calendar.vue'
|
import AProjectCalendar from './_components/a-project-calendar.vue'
|
||||||
import AProjectFilter from './_components/a-project-filter.vue'
|
import AProjectFilter from './_components/a-project-filter.vue'
|
||||||
import moment from 'moment'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -19,8 +18,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// Kravarik: Toto je preco hardcodenute?
|
projects: null,
|
||||||
projects: ['Projekt1', 'Projekt2', 'Projekt3', 'Projekt4'],
|
|
||||||
masterTasks: null,
|
masterTasks: null,
|
||||||
teams: null,
|
teams: null,
|
||||||
employees: null,
|
employees: null,
|
||||||
@@ -43,6 +41,10 @@ export default {
|
|||||||
if (!this.filter.showFinishedTasks)
|
if (!this.filter.showFinishedTasks)
|
||||||
events = events.filter(event => !event.is_finished)
|
events = events.filter(event => !event.is_finished)
|
||||||
|
|
||||||
|
// filter by project_id
|
||||||
|
if(this.filter.selectedProject)
|
||||||
|
events = events.filter(event => event.project_id == this.filter.selectedProject)
|
||||||
|
|
||||||
// filter by team_id
|
// filter by team_id
|
||||||
if (this.filter.selectedTeam)
|
if (this.filter.selectedTeam)
|
||||||
events = events.filter(event => event.team_id == this.filter.selectedTeam)
|
events = events.filter(event => event.team_id == this.filter.selectedTeam)
|
||||||
@@ -90,6 +92,7 @@ export default {
|
|||||||
async _getData() {
|
async _getData() {
|
||||||
try {
|
try {
|
||||||
this.teams = await this.$axios.get_auth_data('v1/teams')
|
this.teams = await this.$axios.get_auth_data('v1/teams')
|
||||||
|
this.projects = await this.$axios.get_auth_data('v1/projects')
|
||||||
this.employees = await this.$axios.get_auth_data('v1/employees')
|
this.employees = await this.$axios.get_auth_data('v1/employees')
|
||||||
this.masterTasks = await this.$axios.get_auth_data('v1/mastertasks')
|
this.masterTasks = await this.$axios.get_auth_data('v1/mastertasks')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -269,7 +269,7 @@
|
|||||||
<div class="w-100 d-flex align-center">
|
<div class="w-100 d-flex align-center">
|
||||||
<div v-for="(file, index) in masterTask.files" :key="file.id" class="d-flex align-center flex-wrap" :class="[index === 0 ? 'ml-0': 'ml-2']">
|
<div v-for="(file, index) in masterTask.files" :key="file.id" class="d-flex align-center flex-wrap" :class="[index === 0 ? 'ml-0': 'ml-2']">
|
||||||
<v-chip class="mt-2">
|
<v-chip class="mt-2">
|
||||||
<p @click="downloadFile" class="cursor-pointer">{{ file.name }}</p>
|
<p @click="downloadFile(index)" class="cursor-pointer">{{ file.name }}</p>
|
||||||
<v-icon class="mx-1" icon="mdi-paperclip"></v-icon>
|
<v-icon class="mx-1" icon="mdi-paperclip"></v-icon>
|
||||||
</v-chip>
|
</v-chip>
|
||||||
</div>
|
</div>
|
||||||
@@ -395,6 +395,14 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async downloadFile(id) {
|
||||||
|
try {
|
||||||
|
const file = await this.$axios.get_auth_data(`v1/mastertasks/${this.masterTask.id}`, { responseType: 'arraybuffer' })
|
||||||
|
FileSaver.saveAs(file.files[id].path, file.files[id].name)
|
||||||
|
} catch(error) {
|
||||||
|
this.$toast.error(error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
async showModal(masterTask, editMode = false) {
|
async showModal(masterTask, editMode = false) {
|
||||||
this.v$.$reset()
|
this.v$.$reset()
|
||||||
|
|||||||
@@ -335,7 +335,7 @@
|
|||||||
:class="[index === 0 ? 'ml-0' : 'ml-2']"
|
:class="[index === 0 ? 'ml-0' : 'ml-2']"
|
||||||
>
|
>
|
||||||
<v-chip class="mt-2">
|
<v-chip class="mt-2">
|
||||||
<p @click="downloadFile" class="cursor-pointer">
|
<p @click="downloadFile(index)" class="cursor-pointer">
|
||||||
{{ file.name }}
|
{{ file.name }}
|
||||||
</p>
|
</p>
|
||||||
<v-icon
|
<v-icon
|
||||||
@@ -491,6 +491,15 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async downloadFile(id) {
|
||||||
|
try {
|
||||||
|
const file = await this.$axios.get_auth_data(`v1/subtasks/${this.task.id}`, { responseType: 'arraybuffer' })
|
||||||
|
FileSaver.saveAs(file.files[id].path, file.files[id].name)
|
||||||
|
} catch(error) {
|
||||||
|
this.$toast.error(error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
removeDate(index) {
|
removeDate(index) {
|
||||||
this.task.timeblocks.splice(index, 1)
|
this.task.timeblocks.splice(index, 1)
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user