mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[Modals] Refactoring
This commit is contained in:
1 parent
707526fb2d
commit
e1d9e6302f
18 files changed
+286
-459
No files matched your search
@@ -1,43 +0,0 @@
|
|||||||
<template>
|
|
||||||
<v-dialog v-model="showModal" max-width="650">
|
|
||||||
<v-card>
|
|
||||||
<div class="d-flex justify-space-between align-center">
|
|
||||||
<h1>Ste si istý, že chcete zmazať <b>{{ task.title }}</b>?</h1>
|
|
||||||
|
|
||||||
<v-icon
|
|
||||||
@click.stop="$emit('close-modal')"
|
|
||||||
icon="mdi-close"
|
|
||||||
size="large"
|
|
||||||
></v-icon>
|
|
||||||
</div>
|
|
||||||
<v-card-actions class="mt-10 d-flex justify-start align-center">
|
|
||||||
<v-btn class="z-btn" variant="flat" @click="$emit('delete-task', task.id)">ÁNO</v-btn>
|
|
||||||
<v-btn class="ml-7 cancel-btn" @click.stop="$emit('close-modal')">ZRUŠIŤ</v-btn>
|
|
||||||
</v-card-actions>
|
|
||||||
</v-card>
|
|
||||||
</v-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
emits: ['delete-task', 'close-modal'],
|
|
||||||
|
|
||||||
props: {
|
|
||||||
show: {
|
|
||||||
type: Boolean,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
|
|
||||||
task: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
showModal() {
|
|
||||||
return this.show
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
<template>
|
|
||||||
<v-dialog v-model="showModal" max-width="650">
|
|
||||||
<v-card>
|
|
||||||
<div class="d-flex justify-space-between align-center">
|
|
||||||
<h1>Ste si istý, že chcete zmazať tím <b>{{ team.name }}</b>?</h1>
|
|
||||||
<v-icon
|
|
||||||
@click.stop="$emit('close-modal')"
|
|
||||||
icon="mdi-close"
|
|
||||||
size="large"
|
|
||||||
></v-icon>
|
|
||||||
</div>
|
|
||||||
<v-card-actions class="mt-10 d-flex justify-start align-center">
|
|
||||||
<v-btn class="z-btn" variant="flat" @click="$emit('delete-team', team.id)">ÁNO</v-btn>
|
|
||||||
<v-btn class="ml-7 cancel-btn" @click.stop="$emit('close-modal')">ZRUŠIŤ</v-btn>
|
|
||||||
</v-card-actions>
|
|
||||||
</v-card>
|
|
||||||
</v-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
emits: ['delete-team', 'close-modal'],
|
|
||||||
|
|
||||||
props: {
|
|
||||||
show: {
|
|
||||||
type: Boolean,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
|
|
||||||
team: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
showModal() {
|
|
||||||
return this.show
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,220 +0,0 @@
|
|||||||
<template>
|
|
||||||
<v-dialog v-model="showModal" max-width="650" max-height="90%" height="700px">
|
|
||||||
<W-loadable :content="team" class="h-100">
|
|
||||||
<v-card v-if="employees" height="100%" class="d-flex flex-column">
|
|
||||||
<div class="d-flex justify-space-between align-center modal-header">
|
|
||||||
<h1>Editovať tím</h1>
|
|
||||||
<v-icon
|
|
||||||
@click.stop="$emit('close-modal')"
|
|
||||||
icon="mdi-close"
|
|
||||||
size="large"
|
|
||||||
></v-icon>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<v-card-actions class="d-flex flex-column modal-content">
|
|
||||||
<v-text-field
|
|
||||||
class="modal-input"
|
|
||||||
label="Názov tímu"
|
|
||||||
:class="{ error: v$.team.name.$errors.length }"
|
|
||||||
:hint="
|
|
||||||
v$.team.name.$errors
|
|
||||||
? errorUtils.parseErrors(v$.team.name.$errors)
|
|
||||||
: null
|
|
||||||
"
|
|
||||||
variant="solo"
|
|
||||||
v-model="team.name"
|
|
||||||
></v-text-field>
|
|
||||||
|
|
||||||
<div
|
|
||||||
class="employee-position w-100"
|
|
||||||
v-for="(employee, index) in team.employees"
|
|
||||||
:key="employee.id"
|
|
||||||
>
|
|
||||||
<v-text-field
|
|
||||||
class="modal-input"
|
|
||||||
disabled
|
|
||||||
label="Zamestanec"
|
|
||||||
variant="solo"
|
|
||||||
v-model="team.employees[index]._fullName"
|
|
||||||
>
|
|
||||||
</v-text-field>
|
|
||||||
<v-icon
|
|
||||||
class="remove-input"
|
|
||||||
@click="removeInput(index)"
|
|
||||||
icon="mdi-close"
|
|
||||||
size="small"
|
|
||||||
></v-icon>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<W-autocomplete
|
|
||||||
:options="employeesOptions"
|
|
||||||
class="modal-input"
|
|
||||||
@option-selected="employeeSelected"
|
|
||||||
/>
|
|
||||||
</v-card-actions>
|
|
||||||
|
|
||||||
<v-btn class="z-btn" @click="editTeam()">EDITOVAŤ</v-btn>
|
|
||||||
</v-card>
|
|
||||||
</W-loadable>
|
|
||||||
</v-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import WAutocomplete from './w-autocomplete.vue'
|
|
||||||
import useVuelidate from '@vuelidate/core'
|
|
||||||
import { required } from '@vuelidate/validators'
|
|
||||||
import errorUtils from '@/plugins/lib@auth/_utils/error.utils'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
emits: ['close-modal'],
|
|
||||||
|
|
||||||
components: {
|
|
||||||
WAutocomplete,
|
|
||||||
},
|
|
||||||
|
|
||||||
props: {
|
|
||||||
show: {
|
|
||||||
type: Boolean,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
teamId: {
|
|
||||||
type: Number,
|
|
||||||
required: false,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
team: null,
|
|
||||||
selectedEmployees: [],
|
|
||||||
employees: null,
|
|
||||||
v$: useVuelidate(),
|
|
||||||
errorUtils,
|
|
||||||
teams: null,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
validations() {
|
|
||||||
return {
|
|
||||||
team: {
|
|
||||||
name: { required },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
async created() {
|
|
||||||
try {
|
|
||||||
this.employees = await this.$axios.get_auth_data('v1/employees')
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.teamId) {
|
|
||||||
return (this.team = {
|
|
||||||
name: '',
|
|
||||||
employees: [],
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const team = await this.$axios.get_auth_data(`v1/teams/${this.teamId}`)
|
|
||||||
|
|
||||||
team.employees = team.employees.map((employee) => {
|
|
||||||
employee._fullName = `${employee.name} ${employee.surname}`
|
|
||||||
|
|
||||||
return employee
|
|
||||||
})
|
|
||||||
|
|
||||||
this.team = team
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
removeInput(index) {
|
|
||||||
this.team.employees.splice(index, 1)
|
|
||||||
},
|
|
||||||
|
|
||||||
async _loadTeams() {
|
|
||||||
try {
|
|
||||||
this.teams = await this.$axios.get_auth_data('v1/teams')
|
|
||||||
} catch (error) {
|
|
||||||
this.teams = { error: error.data.error }
|
|
||||||
this.$toast.error(error.data.error)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
employeeSelected(selectedOption) {
|
|
||||||
const employee = this.employees.find((empl) => empl.id == selectedOption.key)
|
|
||||||
employee._fullName = `${employee.name} ${employee.surname}`
|
|
||||||
|
|
||||||
this.team.employees.push(employee)
|
|
||||||
},
|
|
||||||
|
|
||||||
async editTeam() {
|
|
||||||
if (!(await this.v$.$validate())) return console.log(this.v$)
|
|
||||||
|
|
||||||
try {
|
|
||||||
await this.$axios.post_auth('v1/teams')
|
|
||||||
// do close modal listeneru pridaj ze ak pride true refreshne teamy
|
|
||||||
this.$emit('close-modal', true)
|
|
||||||
this._loadTeams()
|
|
||||||
} catch (error) {
|
|
||||||
this.$toast.error(error.response.data.error)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
employeesOptions() {
|
|
||||||
const unselectedEmployees = this.employees.filter((employee) =>
|
|
||||||
this.team.employees.find((e) => e.id == employee.id) ? false : true
|
|
||||||
)
|
|
||||||
|
|
||||||
console.log(unselectedEmployees)
|
|
||||||
|
|
||||||
return unselectedEmployees.map((employee) => {
|
|
||||||
return {
|
|
||||||
key: employee.id,
|
|
||||||
value: `${employee.name} ${employee.surname}`,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
showModal() {
|
|
||||||
return this.show
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="sass" scoped>
|
|
||||||
.modal-input
|
|
||||||
width: 100%
|
|
||||||
flex: 0 0 auto
|
|
||||||
.modal-header
|
|
||||||
flex: 0 0 auto
|
|
||||||
|
|
||||||
.modal-content
|
|
||||||
flex: 1 1 100%
|
|
||||||
margin: 10px 0
|
|
||||||
overflow-y: scroll
|
|
||||||
|
|
||||||
.z-btn
|
|
||||||
height: 50px
|
|
||||||
width: 100%
|
|
||||||
flex: 0 0 auto
|
|
||||||
|
|
||||||
.remove-input
|
|
||||||
pointer-events: auto
|
|
||||||
opacity: 2
|
|
||||||
position: absolute
|
|
||||||
left: 92%
|
|
||||||
top: 25%
|
|
||||||
|
|
||||||
.employee-position
|
|
||||||
position: relative
|
|
||||||
</style>
|
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<v-list-item class="cursor-pointer hover-background" @click="createMasterTaskDialog = true">MASTER TASK</v-list-item>
|
<v-list-item class="cursor-pointer hover-background" @click="createMasterTaskDialog = true">MASTER TASK</v-list-item>
|
||||||
<v-list-item class="cursor-pointer hover-background">SUB TASK</v-list-item>
|
<v-list-item class="cursor-pointer hover-background">SUB TASK</v-list-item>
|
||||||
<v-list-item class="cursor-pointer hover-background" @click="createTeamDialog = true">TÍM</v-list-item>
|
<v-list-item class="cursor-pointer hover-background" @click="createTeamDialog = true">TÍM</v-list-item>
|
||||||
<v-list-item class="cursor-pointer hover-background" @click="createBlokerDialog = true">BLOKER</v-list-item>
|
<v-list-item class="cursor-pointer hover-background" @click="createBlockerDialog = true">BLOCKER</v-list-item>
|
||||||
</v-list>
|
</v-list>
|
||||||
</v-menu>
|
</v-menu>
|
||||||
|
|
||||||
@@ -50,29 +50,29 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<A-master-task-modal :visible="createMasterTaskDialog" @close="createMasterTaskDialog = false"/>
|
<Z-master-task-modal :visible="createMasterTaskDialog ? true : false" @close="createMasterTaskDialog = false"/>
|
||||||
<A-bloker-modal :visible="createBlokerDialog" @close="createBlokerDialog = false" />
|
<Z-blocker-modal :visible="createBlockerDialog ? true : false" @close="createBlockerDialog = false" />
|
||||||
<A-team-modal :visible="createTeamDialog" @close="createTeamDialog = false" />
|
<Z-team-modal :visible="createTeamDialog ? true : false" @close="createTeamDialog = false" />
|
||||||
</v-app-bar>
|
</v-app-bar>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ATeamModal from '@/plugins/app/_components/a-team-modal.vue'
|
import ZTeamModal from '@/plugins/tm@modal/team/z-team-modal.vue'
|
||||||
import ABlokerModal from '@/plugins/app/_components/a-bloker-modal.vue'
|
import ZBlockerModal from '@/plugins/tm@modal/blocker/z-blocker-modal.vue'
|
||||||
import AMasterTaskModal from '@/plugins/app/_components/a-master-task-modal.vue'
|
import ZMasterTaskModal from '@/plugins/tm@modal/master-task/z-master-task-modal.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
ATeamModal,
|
ZTeamModal,
|
||||||
ABlokerModal,
|
ZBlockerModal,
|
||||||
AMasterTaskModal
|
ZMasterTaskModal
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
user: null,
|
user: null,
|
||||||
createTeamDialog: false,
|
createTeamDialog: false,
|
||||||
createBlokerDialog: false,
|
createBlockerDialog: false,
|
||||||
createMasterTaskDialog: false
|
createMasterTaskDialog: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
File renamed without changes.
+3
-9
@@ -1,19 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<input
|
<input type="file" multiple name="file" id="fileInput" class="hidden-input" accept="*"
|
||||||
type="file"
|
@change="onChange" ref="fileUpload"
|
||||||
multiple
|
|
||||||
name="file"
|
|
||||||
id="fileInput"
|
|
||||||
class="hidden-input"
|
|
||||||
@change="onChange"
|
|
||||||
ref="fileUpload"
|
|
||||||
accept="*"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<v-btn class="upload-btn" @click="$refs.fileUpload.click()">
|
<v-btn class="upload-btn" @click="$refs.fileUpload.click()">
|
||||||
<v-icon class="mx-1" icon="mdi-cloud-upload-outline"></v-icon>NAHRAŤ
|
<v-icon class="mx-1" icon="mdi-cloud-upload-outline"></v-icon>NAHRAŤ
|
||||||
</v-btn>
|
</v-btn>
|
||||||
|
|
||||||
<div v-if="files.length">
|
<div v-if="files.length">
|
||||||
<div
|
<div
|
||||||
v-for="file in files"
|
v-for="file in files"
|
||||||
+79
-47
@@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-dialog v-model="show" max-width="650" max-height="90%" height="700px">
|
<v-dialog v-model="show" max-width="650" max-height="90%" height="700px">
|
||||||
<W-loadable :content="employees" class="h-100">
|
<W-loadable :content="allEmployees" class="h-100">
|
||||||
<v-card v-if="employees" height="100%" class="d-flex flex-column">
|
<v-card height="100%" class="d-flex flex-column">
|
||||||
<div class="d-flex justify-space-between align-center modal-header">
|
<div class="d-flex justify-space-between align-center modal-header">
|
||||||
<h1>Vytvoriť bloker</h1>
|
<h1>Vytvoriť blocker</h1>
|
||||||
<v-icon
|
<v-icon
|
||||||
@click.stop="show = false"
|
@click.stop="show = false"
|
||||||
icon="mdi-close"
|
icon="mdi-close"
|
||||||
@@ -15,12 +15,13 @@
|
|||||||
<v-text-field
|
<v-text-field
|
||||||
@focus="onInputFocus"
|
@focus="onInputFocus"
|
||||||
class="modal-input"
|
class="modal-input"
|
||||||
label="Názov blokeru"
|
label="Názov blocker"
|
||||||
|
v-model="blocker.name"
|
||||||
variant="solo"
|
variant="solo"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
<div
|
<div
|
||||||
class="employee-position w-100"
|
class="employee-position w-100"
|
||||||
v-for="(employee, index) in selectedEmployees"
|
v-for="(employee, index) in blocker.employees"
|
||||||
:key="employee.id"
|
:key="employee.id"
|
||||||
>
|
>
|
||||||
<v-text-field
|
<v-text-field
|
||||||
@@ -28,25 +29,25 @@
|
|||||||
disabled
|
disabled
|
||||||
label="Zamestanec"
|
label="Zamestanec"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
v-model="selectedEmployees[index]._fullName"
|
v-model="blocker.employees[index]._fullName"
|
||||||
>
|
>
|
||||||
</v-text-field>
|
</v-text-field>
|
||||||
<v-icon
|
<v-icon
|
||||||
class="remove-input"
|
class="remove-input"
|
||||||
@click.stop="removeInput(index)"
|
@click.stop="blocker.employees.splice(index, 1)"
|
||||||
icon="mdi-close"
|
icon="mdi-close"
|
||||||
size="small"
|
size="small"
|
||||||
></v-icon>
|
></v-icon>
|
||||||
</div>
|
</div>
|
||||||
<W-autocomplete
|
<Z-autocomplete
|
||||||
:options="employeesOptions"
|
:options="employeesOptions"
|
||||||
class="modal-input"
|
class="modal-input"
|
||||||
@option-selected="employeeSelected"
|
@option-selected="employeeSelected"
|
||||||
/>
|
/>
|
||||||
<Datepicker
|
<Datepicker
|
||||||
class="modal-input"
|
class="modal-input"
|
||||||
v-model="date"
|
v-model="blocker.date"
|
||||||
:format="dateFormat"
|
format="dd.MM.yyyy, HH:mm"
|
||||||
locale="sk"
|
locale="sk"
|
||||||
@focus="onDateFocus"
|
@focus="onDateFocus"
|
||||||
select-text="Vybrať"
|
select-text="Vybrať"
|
||||||
@@ -56,19 +57,19 @@
|
|||||||
/>
|
/>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
|
|
||||||
<v-btn class="z-btn" @click="createBloker()">VYTVORIŤ</v-btn>
|
<v-btn class="z-btn" @click="save()">VYTVORIŤ</v-btn>
|
||||||
</v-card>
|
</v-card>
|
||||||
</W-loadable>
|
</W-loadable>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import WAutocomplete from './w-autocomplete.vue'
|
import ZAutocomplete from '@/plugins/tm@_components/z-autocomplete.vue'
|
||||||
import Datepicker from '@vuepic/vue-datepicker'
|
import Datepicker from '@vuepic/vue-datepicker'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
WAutocomplete,
|
ZAutocomplete,
|
||||||
Datepicker,
|
Datepicker,
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -76,46 +77,82 @@ export default {
|
|||||||
visible: {
|
visible: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true
|
||||||
|
},
|
||||||
|
|
||||||
|
blockerId: {
|
||||||
|
type: Number || null,
|
||||||
|
required: false,
|
||||||
|
default: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
selectedEmployee: '',
|
allEmployees: null,
|
||||||
selectedEmployees: [],
|
blocker: {
|
||||||
employees: null,
|
name: '',
|
||||||
date: '',
|
data: null,
|
||||||
dateFormat: 'dd.MM.yyyy, HH:mm'
|
employees: []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async created() {
|
async created() {
|
||||||
|
if (this.blockerId)
|
||||||
|
await this._load()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.employees = await this.$axios.get_auth_data('v1/employees')
|
const allEmployees = await this.$axios.get_auth_data('v1/employees')
|
||||||
|
this.allEmployees = this._enrichEmployeesByFullName(allEmployees)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
this.$toast.error(error)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
removeInput(index) {
|
|
||||||
this.selectedEmployees.splice(index, 1)
|
|
||||||
},
|
|
||||||
|
|
||||||
employeeSelected(selectedOption) {
|
employeeSelected(selectedOption) {
|
||||||
const employee = this.employees.find((empl) => empl.id == selectedOption.key)
|
const employee = this.allEmployees.find((empl) => empl.id == selectedOption.key)
|
||||||
employee._fullName = `${employee.name} ${employee.surname}`
|
this.blocker.employees.push(employee)
|
||||||
|
|
||||||
this.selectedEmployees.push(employee)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async createBloker() {
|
async save() {
|
||||||
try {
|
try {
|
||||||
await this.$axios.post_auth('v1/blockers')
|
if (this.blocker.id)
|
||||||
|
await this._edit()
|
||||||
|
else
|
||||||
|
await this._create()
|
||||||
|
|
||||||
this.$router.push({ name: 'Dashboard - Tasks' })
|
this.$router.push({ name: 'Dashboard - Tasks' })
|
||||||
this.show = false
|
this.show = false
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$toast.error(error.response.data.error)
|
console.log(error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async _create() {
|
||||||
|
try {
|
||||||
|
await this.$axios.post_auth('v1/blockers', this.blocker)
|
||||||
|
} catch (error) {
|
||||||
|
this.$toast.error(error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async _edit() {
|
||||||
|
try {
|
||||||
|
await this.$axios.post_auth(`v1/blockers/${this.blocker.id}`, this.blocker)
|
||||||
|
} catch (error) {
|
||||||
|
this.$toast.error(error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async _load() {
|
||||||
|
try {
|
||||||
|
const blocker = await this.$axios.get_auth_data(`v1/blockers/${this.blockerId}`)
|
||||||
|
blocker.employees = this._enrichEmployeesByFullName(blocker.employees)
|
||||||
|
|
||||||
|
this.blocker = blocker
|
||||||
|
} catch (error) {
|
||||||
|
this.$toast.error(error)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -131,15 +168,22 @@ export default {
|
|||||||
$event.target.blur()
|
$event.target.blur()
|
||||||
this.preventInputFocus = false
|
this.preventInputFocus = false
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_enrichEmployeesByFullName(employees) {
|
||||||
|
return employees.map(employee => {
|
||||||
|
employee._fullName = `${employee.name} ${employee.surname}`
|
||||||
|
return employee
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
employeesOptions() {
|
employeesOptions() {
|
||||||
const selectedEmployeesIds = this.selectedEmployees.map(
|
const selectedEmployeesIds = this.blocker.employees.map(
|
||||||
(employee) => employee.id
|
(employee) => employee.id
|
||||||
)
|
)
|
||||||
const employees = this.employees.filter(
|
const employees = this.allEmployees.filter(
|
||||||
(employee) => !selectedEmployeesIds.includes(employee.id)
|
(employee) => !selectedEmployeesIds.includes(employee.id)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -158,21 +202,9 @@ export default {
|
|||||||
|
|
||||||
set(value) {
|
set(value) {
|
||||||
if (!value) this.$emit('close')
|
if (!value) this.$emit('close')
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
|
|
||||||
watch: {
|
|
||||||
selectedEmployee() {
|
|
||||||
const selectedEmployee = this.selectedEmployee.split(' ')
|
|
||||||
|
|
||||||
const employee = this.employees.find(
|
|
||||||
(e) => e.name == selectedEmployee[0] && e.surname == selectedEmployee[1]
|
|
||||||
)
|
|
||||||
|
|
||||||
this.selectedEmployees.push(JSON.parse(JSON.stringify(employee)))
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
Whitespace-only changes.
Whitespace-only changes.
+10
-6
@@ -17,22 +17,25 @@
|
|||||||
label="Kód projektu"
|
label="Kód projektu"
|
||||||
variant="solo"
|
variant="solo"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
|
|
||||||
<v-text-field
|
<v-text-field
|
||||||
@focus="onInputFocus"
|
@focus="onInputFocus"
|
||||||
class="modal-input"
|
class="modal-input"
|
||||||
label="Názov mastertasku"
|
label="Názov mastertasku"
|
||||||
variant="solo"
|
variant="solo"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
|
|
||||||
<Datepicker
|
<Datepicker
|
||||||
@focus="onDateFocus"
|
@focus="onDateFocus"
|
||||||
class="modal-input"
|
class="modal-input"
|
||||||
v-model="date"
|
v-model="date"
|
||||||
:format="dateFormat"
|
format="dd.MM.yyyy, HH:mm"
|
||||||
locale="sk"
|
locale="sk"
|
||||||
select-text="Vybrať"
|
select-text="Vybrať"
|
||||||
cancel-text="Zrušiť"
|
cancel-text="Zrušiť"
|
||||||
placeholder="Deadline"
|
placeholder="Deadline"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<v-text-field
|
<v-text-field
|
||||||
@focus="onInputFocus"
|
@focus="onInputFocus"
|
||||||
class="modal-input mt-5"
|
class="modal-input mt-5"
|
||||||
@@ -41,18 +44,20 @@
|
|||||||
type="number"
|
type="number"
|
||||||
placeholder="h"
|
placeholder="h"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
|
|
||||||
<v-select
|
<v-select
|
||||||
@focus="onInputFocus"
|
@focus="onInputFocus"
|
||||||
class="modal-input border-select"
|
class="modal-input border-select"
|
||||||
label="Tím"
|
label="Tím"
|
||||||
variant="solo"
|
variant="solo"
|
||||||
></v-select>
|
></v-select>
|
||||||
|
|
||||||
<v-textarea
|
<v-textarea
|
||||||
label="Popis"
|
label="Popis"
|
||||||
class="modal-input"
|
class="modal-input"
|
||||||
variant="solo"
|
variant="solo"
|
||||||
></v-textarea>
|
></v-textarea>
|
||||||
<A-files-upload @files-uploaded="filesUploaded"/>
|
<Z-files-upload @files-uploaded="filesUploaded"/>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
|
|
||||||
<v-btn class="z-btn" @click="createMasterTask()">VYTVORIŤ</v-btn>
|
<v-btn class="z-btn" @click="createMasterTask()">VYTVORIŤ</v-btn>
|
||||||
@@ -62,12 +67,12 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Datepicker from '@vuepic/vue-datepicker'
|
import Datepicker from '@vuepic/vue-datepicker'
|
||||||
import AFilesUpload from '@/plugins/app/_components/a-files-upload.vue'
|
import ZFilesUpload from '@/plugins/tm@_components/z-files-upload.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Datepicker,
|
Datepicker,
|
||||||
AFilesUpload
|
ZFilesUpload
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
@@ -80,7 +85,6 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
date: '',
|
date: '',
|
||||||
dateFormat: 'dd.MM.yyyy, HH:mm',
|
|
||||||
preventInputFocus: false
|
preventInputFocus: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -123,7 +127,7 @@ export default {
|
|||||||
|
|
||||||
set(value) {
|
set(value) {
|
||||||
if (!value) this.$emit('close')
|
if (!value) this.$emit('close')
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
<template>
|
||||||
|
<v-dialog v-model="show" max-width="650">
|
||||||
|
<v-card>
|
||||||
|
<div class="d-flex justify-space-between align-center">
|
||||||
|
<h1>Ste si istý, že chcete zmazať <b>{{ task.title }}</b>?</h1>
|
||||||
|
|
||||||
|
<v-icon
|
||||||
|
@click.stop="show = false"
|
||||||
|
icon="mdi-close"
|
||||||
|
size="large"
|
||||||
|
></v-icon>
|
||||||
|
</div>
|
||||||
|
<v-card-actions class="mt-10 d-flex justify-start align-center">
|
||||||
|
<v-btn class="z-btn" variant="flat" @click="deleteTask()">ÁNO</v-btn>
|
||||||
|
<v-btn class="ml-7 cancel-btn" @click.stop="show = false">ZRUŠIŤ</v-btn>
|
||||||
|
</v-card-actions>
|
||||||
|
</v-card>
|
||||||
|
</v-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
emits: ['close'],
|
||||||
|
|
||||||
|
props: {
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
|
||||||
|
task: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
async deleteTask() {
|
||||||
|
try {
|
||||||
|
await this.$axios.delete(`v1/teams/${this.task.id}`)
|
||||||
|
this.show = false
|
||||||
|
} catch (error) {
|
||||||
|
this.$toast.error(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
show: {
|
||||||
|
get() {
|
||||||
|
return this.visible
|
||||||
|
},
|
||||||
|
|
||||||
|
set(value) {
|
||||||
|
if (!value) this.$emit('close')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
<template>
|
||||||
|
<v-dialog v-model="show" max-width="650">
|
||||||
|
<v-card>
|
||||||
|
<div class="d-flex justify-space-between align-center">
|
||||||
|
<h1>Ste si istý, že chcete zmazať tím <b>{{ team.name }}</b>?</h1>
|
||||||
|
<v-icon
|
||||||
|
@click.stop="show = false"
|
||||||
|
icon="mdi-close"
|
||||||
|
size="large"
|
||||||
|
></v-icon>
|
||||||
|
</div>
|
||||||
|
<v-card-actions class="mt-10 d-flex justify-start align-center">
|
||||||
|
<v-btn class="z-btn" variant="flat" @click="deleteTeam()">ÁNO</v-btn>
|
||||||
|
<v-btn class="ml-7 cancel-btn" @click.stop="show = false">ZRUŠIŤ</v-btn>
|
||||||
|
</v-card-actions>
|
||||||
|
</v-card>
|
||||||
|
</v-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
emits: ['delete-team', 'close'],
|
||||||
|
|
||||||
|
props: {
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
|
||||||
|
team: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
async deleteTeam() {
|
||||||
|
try {
|
||||||
|
await this.$axios.delete(`v1/teams/${this.team.id}`)
|
||||||
|
this.show = false
|
||||||
|
} catch (error) {
|
||||||
|
this.$toast.error(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
show: {
|
||||||
|
get() {
|
||||||
|
return this.visible
|
||||||
|
},
|
||||||
|
|
||||||
|
set(value) {
|
||||||
|
if (!value) this.$emit('close')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
+52
-36
@@ -40,13 +40,13 @@
|
|||||||
</v-text-field>
|
</v-text-field>
|
||||||
<v-icon
|
<v-icon
|
||||||
class="remove-input"
|
class="remove-input"
|
||||||
@click.stop="removeInput(index)"
|
@click.stop="team.employees.splice(index, 1)"
|
||||||
icon="mdi-close"
|
icon="mdi-close"
|
||||||
size="small"
|
size="small"
|
||||||
></v-icon>
|
></v-icon>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<W-autocomplete
|
<Z-autocomplete
|
||||||
:options="employeesOptions"
|
:options="employeesOptions"
|
||||||
:validations="v$.team.employees"
|
:validations="v$.team.employees"
|
||||||
class="modal-input"
|
class="modal-input"
|
||||||
@@ -54,23 +54,23 @@
|
|||||||
/>
|
/>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
|
|
||||||
<v-btn class="z-btn" @click="createTeam()">VYTVORIŤ</v-btn>
|
<v-btn class="z-btn" @click="save()">VYTVORIŤ</v-btn>
|
||||||
</v-card>
|
</v-card>
|
||||||
</W-loadable>
|
</W-loadable>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import WAutocomplete from './w-autocomplete.vue'
|
import ZAutocomplete from '@/plugins/tm@_components/z-autocomplete.vue'
|
||||||
import useVuelidate from '@vuelidate/core'
|
import useVuelidate from '@vuelidate/core'
|
||||||
import { required, minLength } from '@vuelidate/validators'
|
import { required } from '@vuelidate/validators'
|
||||||
import errorUtils from '@/plugins/lib@auth/_utils/error.utils'
|
import errorUtils from '@/plugins/lib@auth/_utils/error.utils'
|
||||||
|
|
||||||
const atLeastOne = (value) => value.length
|
const atLeastOne = (value) => value.length
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
WAutocomplete,
|
ZAutocomplete,
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
@@ -108,30 +108,59 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async created() {
|
async created() {
|
||||||
|
if (this.teamId)
|
||||||
|
await this._load()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const allEmployees = await this.$axios.get_auth_data('v1/employees')
|
const allEmployees = await this.$axios.get_auth_data('v1/employees')
|
||||||
this.allEmployees = this._enrichEmployeesByFullName(allEmployees)
|
this.allEmployees = this._enrichEmployeesByFullName(allEmployees)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
this.$toast.error(error)
|
||||||
}
|
|
||||||
|
|
||||||
if (this.teamId) {
|
|
||||||
try {
|
|
||||||
const team = await this.$axios.get_auth_data(`v1/teams/${this.teamId}`)
|
|
||||||
team.employees = this._enrichEmployeesByFullName(this.team.employees)
|
|
||||||
|
|
||||||
this.team = team
|
|
||||||
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
removeInput(index) {
|
async save() {
|
||||||
this.team.employees.splice(index, 1)
|
if (!(await this.v$.$validate())) return console.log(this.v$)
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (this.team.id)
|
||||||
|
await this._edit()
|
||||||
|
else
|
||||||
|
await this._create()
|
||||||
|
|
||||||
|
this.$router.push({ name: 'Overview - Teams' })
|
||||||
|
this.show = false
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async _create() {
|
||||||
|
try {
|
||||||
|
await this.$axios.post_auth('v1/teams', this.team)
|
||||||
|
} catch (error) {
|
||||||
|
this.$toast.error(error.response.data.error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async _edit() {
|
||||||
|
try {
|
||||||
|
await this.$axios.post_auth(`v1/teams/${this.team.id}`, this.team)
|
||||||
|
} catch (error) {
|
||||||
|
this.$toast.error(error.response.data.error)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async _load() {
|
||||||
|
try {
|
||||||
|
const team = await this.$axios.get_auth_data(`v1/teams/${this.teamId}`)
|
||||||
|
team.employees = this._enrichEmployeesByFullName(team.employees)
|
||||||
|
|
||||||
|
this.team = team
|
||||||
|
} catch (error) {
|
||||||
|
this.$toast.error(error)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
employeeSelected(selectedOption) {
|
employeeSelected(selectedOption) {
|
||||||
@@ -139,19 +168,6 @@ export default {
|
|||||||
this.team.employees.push(employee)
|
this.team.employees.push(employee)
|
||||||
},
|
},
|
||||||
|
|
||||||
async createTeam() {
|
|
||||||
console.log(this.team)
|
|
||||||
if (!(await this.v$.$validate())) return console.log(this.v$)
|
|
||||||
|
|
||||||
try {
|
|
||||||
await this.$axios.post_auth('v1/teams')
|
|
||||||
this.$router.push({ name: 'Overview - Teams' })
|
|
||||||
this.show = false
|
|
||||||
} catch (error) {
|
|
||||||
this.$toast.error(error.response.data.error)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_enrichEmployeesByFullName(employees) {
|
_enrichEmployeesByFullName(employees) {
|
||||||
return employees.map(employee => {
|
return employees.map(employee => {
|
||||||
employee._fullName = `${employee.name} ${employee.surname}`
|
employee._fullName = `${employee.name} ${employee.surname}`
|
||||||
@@ -184,7 +200,7 @@ export default {
|
|||||||
|
|
||||||
set(value) {
|
set(value) {
|
||||||
if (!value) this.$emit('close')
|
if (!value) this.$emit('close')
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<img class="pencil-icon" :src="require('@/plugins/tm@overview/_img/pencil-icon.svg')" alt="pencil-icon" />
|
<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 = { task }" />
|
<img class="trash-icon" :src="require('@/plugins/tm@overview/_img/trash-icon.svg')" alt="trash-icon" @click.stop="showDeleteModal = { task }" />
|
||||||
|
|
||||||
<A-delete-task-modal v-if="showDeleteModal" :show="showDeleteModal" :task="showDeleteModal.task" @delete-task="deleteTask(showDeleteModal.task.id)" @close-modal="(showDeleteModal = null)" />
|
<Z-delete-task-modal v-if="showDeleteModal" :visible="showDeleteModal ? true : false" :task="showDeleteModal.task" @close="showDeleteModal = null" />
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -30,11 +30,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ADeleteTaskModal from '@/plugins/app/_components/a-delete-task-modal.vue'
|
import ZDeleteTaskModal from '@/plugins/tm@modal/task/z-delete-task-modal.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
ADeleteTaskModal
|
ZDeleteTaskModal
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
@@ -48,17 +48,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
showDeleteModal: null
|
showDeleteModal: null
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
async deleteTask(id) {
|
|
||||||
try {
|
|
||||||
await this.$axios.delete(`v1/teams/${id}`)
|
|
||||||
this.showDeleteModal = false
|
|
||||||
} catch (error) {
|
|
||||||
this.$toast.error(error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<img class="pencil-icon" :src="require('@/plugins/tm@overview/_img/pencil-icon.svg')" alt="pencil-icon">
|
<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 = { task }">
|
<img class="trash-icon" :src="require('@/plugins/tm@overview/_img/trash-icon.svg')" alt="trash-icon" @click.stop="showDeleteModal = { task }">
|
||||||
|
|
||||||
<A-delete-task-modal v-if="showDeleteModal" :show="showDeleteModal" :task="showDeleteModal.task" @delete-task="deleteTask(showDeleteModal.task.id)" @close-modal="(showDeleteModal = null)" />
|
<Z-delete-task-modal v-if="showDeleteModal" :visible="showDeleteModal ? true : false" :task="showDeleteModal.task" @close="showDeleteModal = null" />
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -28,11 +28,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ADeleteTaskModal from '@/plugins/app/_components/a-delete-task-modal.vue'
|
import ZDeleteTaskModal from '@/plugins/tm@modal/task/z-delete-task-modal.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
ADeleteTaskModal
|
ZDeleteTaskModal
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
@@ -46,17 +46,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
showDeleteModal: null
|
showDeleteModal: null
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
async deleteTask(id) {
|
|
||||||
try {
|
|
||||||
await this.$axios.delete(`v1/teams/${id}`)
|
|
||||||
this.showDeleteModal = false
|
|
||||||
} catch (error) {
|
|
||||||
this.$toast.error(error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -21,19 +21,19 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</v-table>
|
</v-table>
|
||||||
|
|
||||||
<A-team-form-modal v-if="editModal" :show="editModal" :teamId="editModal.team.id" @close-modal="(editModal = null)" />
|
<Z-team-modal v-if="editModal" :visible="editModal ? true : false" :teamId="editModal.team.id" @close="(editModal = null)" />
|
||||||
<A-delete-team-modal v-if="deleteModal" :show="deleteModal" :team="deleteModal.team" @delete-team="deleteTeam" @close-modal="(deleteModal = null)" />
|
<Z-delete-team-modal v-if="deleteModal" :visible="deleteModal ? true : false" :team="deleteModal.team" @close="(deleteModal = null)" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ADeleteTeamModal from '@/plugins/app/_components/a-delete-team-modal.vue'
|
import ZDeleteTeamModal from '@/plugins/tm@modal/team/z-delete-team-modal.vue'
|
||||||
import ATeamFormModal from '@/plugins/app/_components/a-team-form-modal.vue'
|
import ZTeamModal from '@/plugins/tm@modal/team/z-team-modal.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
ADeleteTeamModal,
|
ZDeleteTeamModal,
|
||||||
ATeamFormModal
|
ZTeamModal
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
@@ -48,17 +48,6 @@ export default {
|
|||||||
editModal: null,
|
editModal: null,
|
||||||
deleteModal: null
|
deleteModal: null
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
async deleteTeam(id) {
|
|
||||||
try {
|
|
||||||
await this.$axios.delete(`v1/teams/${id}`)
|
|
||||||
this.deleteModal = null
|
|
||||||
} catch (error) {
|
|
||||||
this.$toast.error(error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user