mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[Teams] Autocomplete input component
This commit is contained in:
1 parent
29c0ea970b
commit
da9d338175
16 files changed
+290
-87
No files matched your search
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"Chyba": "",
|
|
||||||
"Zadali ste neplatný email.": ""
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,9 @@
|
|||||||
{
|
{
|
||||||
"Value is not a valid email address": "Zadali ste neplatný email.",
|
"Value is not a valid email address": "Zadali ste neplatný email",
|
||||||
"error": "chyba"
|
"error": "chyba",
|
||||||
|
"Value is required": "Pole je povinné",
|
||||||
|
"This field should be at least 8 characters long": "Pole musí obsahovať aspoň 8 znakov",
|
||||||
|
"This field should be at least 6 characters long": "Pole musí obsahovať aspoň 6 znakov",
|
||||||
|
"This maximum length allowed is 6": "Pole musí obsahovať 6 znakov",
|
||||||
|
"The value must be equal to the other value": "Heslá sa nezhodujú"
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
<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="create-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>
|
||||||
|
|
||||||
|
<style lang="sass" scoped>
|
||||||
|
.cancel-btn
|
||||||
|
border: thin solid rgba(var(--v-border-color), var(--v-border-opacity))
|
||||||
|
color: #7f39fb
|
||||||
|
|
||||||
|
.create-btn
|
||||||
|
background: #7f39fb
|
||||||
|
border-radius: 4px
|
||||||
|
color: #fff
|
||||||
|
</style>
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-dialog v-model="show" max-width="650">
|
<v-dialog v-model="showModal" max-width="650">
|
||||||
<v-card>
|
<v-card>
|
||||||
<div class="d-flex justify-space-between align-center">
|
<div class="d-flex justify-space-between align-center">
|
||||||
<h1>Ste si istý, že chcete zmazať tento tím?</h1>
|
<h1>Ste si istý, že chcete zmazať tím <b>{{ team.name }}</b>?</h1>
|
||||||
<v-icon
|
<v-icon
|
||||||
@click.stop="show = false"
|
@click.stop="$emit('close-modal')"
|
||||||
icon="mdi-close"
|
icon="mdi-close"
|
||||||
size="large"
|
size="large"
|
||||||
></v-icon>
|
></v-icon>
|
||||||
</div>
|
</div>
|
||||||
<v-card-actions class="mt-10 d-flex justify-start align-center">
|
<v-card-actions class="mt-10 d-flex justify-start align-center">
|
||||||
<v-btn class="create-btn" variant="flat" @click="deleteTeam()">ÁNO</v-btn>
|
<v-btn class="create-btn" variant="flat" @click="$emit('delete-team', team.id)">ÁNO</v-btn>
|
||||||
<v-btn class="ml-7 cancel-btn" @click.stop="show = false">ZRUŠIŤ</v-btn>
|
<v-btn class="ml-7 cancel-btn" @click.stop="$emit('close-modal')">ZRUŠIŤ</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
@@ -19,40 +19,24 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
props: [
|
emits: ['delete-team', 'close-modal'],
|
||||||
'visible'
|
|
||||||
],
|
|
||||||
|
|
||||||
data() {
|
props: {
|
||||||
return {
|
show: {
|
||||||
selectedEmployee: "",
|
type: Boolean,
|
||||||
selectedEmployees: [],
|
required: true
|
||||||
employees: null,
|
},
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
team: {
|
||||||
async deleteTeam(id) {
|
type: Object,
|
||||||
try{
|
required: true
|
||||||
await this.$axios.delete(`v1/teams/${id}`)
|
|
||||||
this.$router.push({ name: 'Overview - Teams' })
|
|
||||||
this.show = false
|
|
||||||
} catch (error) {
|
|
||||||
this.$toast.error(error.response.data.error)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
show: {
|
showModal() {
|
||||||
get() {
|
return this.show
|
||||||
return this.visible;
|
}
|
||||||
},
|
|
||||||
|
|
||||||
set(value) {
|
|
||||||
if (!value) this.$emit('close')
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
disabled
|
disabled
|
||||||
label="Zamestanec"
|
label="Zamestanec"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
v-model="selectedEmployees[index].surname"
|
v-model="selectedEmployees[index]._fullName"
|
||||||
>
|
>
|
||||||
</v-text-field>
|
</v-text-field>
|
||||||
<v-icon
|
<v-icon
|
||||||
@@ -40,13 +40,15 @@
|
|||||||
<v-icon icon="mdi-plus" size="large"></v-icon>PRIDAŤ
|
<v-icon icon="mdi-plus" size="large"></v-icon>PRIDAŤ
|
||||||
ZAMESTNANCA</v-btn
|
ZAMESTNANCA</v-btn
|
||||||
> -->
|
> -->
|
||||||
<v-autocomplete
|
<!-- <v-autocomplete
|
||||||
class="modal-input"
|
class="modal-input"
|
||||||
label="Vyhladat"
|
label="Vyhladat"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
:items="employeesOptions"
|
:items="employeesOptions"
|
||||||
v-model="selectedEmployee"
|
v-model="selectedEmployee"
|
||||||
></v-autocomplete>
|
></v-autocomplete> -->
|
||||||
|
|
||||||
|
<W-autocomplete :options="employeesOptions" class="modal-input" @option-selected="employeeSelected" />
|
||||||
|
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
|
|
||||||
@@ -57,7 +59,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import WAutocomplete from './w-autocomplete.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
WAutocomplete
|
||||||
|
},
|
||||||
|
|
||||||
props: [
|
props: [
|
||||||
'visible'
|
'visible'
|
||||||
],
|
],
|
||||||
@@ -83,6 +91,13 @@ export default {
|
|||||||
this.selectedEmployees.splice(index, 1)
|
this.selectedEmployees.splice(index, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
employeeSelected(selectedOption) {
|
||||||
|
const employee = this.employees.find(empl => empl.id == selectedOption.key)
|
||||||
|
employee._fullName = `${employee.name} ${employee.surname}`
|
||||||
|
|
||||||
|
this.selectedEmployees.push(employee)
|
||||||
|
},
|
||||||
|
|
||||||
async createTeam() {
|
async createTeam() {
|
||||||
try{
|
try{
|
||||||
await this.$axios.post_auth('v1/teams')
|
await this.$axios.post_auth('v1/teams')
|
||||||
@@ -103,9 +118,12 @@ export default {
|
|||||||
(employee) => !selectedEmployeesIds.includes(employee.id)
|
(employee) => !selectedEmployeesIds.includes(employee.id)
|
||||||
);
|
);
|
||||||
|
|
||||||
return employees.map(
|
return employees.map(employee => {
|
||||||
(employee) => `${employee.name} ${employee.surname}`
|
return {
|
||||||
);
|
key: employee.id,
|
||||||
|
value: `${employee.name} ${employee.surname}`
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
show: {
|
show: {
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
<template>
|
||||||
|
<div class="wrapper">
|
||||||
|
<v-text-field
|
||||||
|
label="Vyhľadať zamestnanca"
|
||||||
|
variant="outlined"
|
||||||
|
v-model="search"
|
||||||
|
@keydown.enter="optionSelected()"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div class="suggestion">
|
||||||
|
<span class="hidden-part">{{ suggestion._suggestionHiddenPart }}</span>
|
||||||
|
<span>{{ suggestion._suggestionShownPart }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
emits: ['option-selected'],
|
||||||
|
|
||||||
|
props: {
|
||||||
|
options: {
|
||||||
|
type: Array,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
search: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
suggestion() {
|
||||||
|
const normalizedSearch = this._normalize(this.search)
|
||||||
|
|
||||||
|
if (!normalizedSearch.length || !this.options.length)
|
||||||
|
return ''
|
||||||
|
|
||||||
|
const filteredOptions = this.options.filter(option => {
|
||||||
|
const normalizedValue = this._normalize(option.value)
|
||||||
|
|
||||||
|
return normalizedSearch == normalizedValue.slice(0, normalizedSearch.length)
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!filteredOptions[0])
|
||||||
|
return ''
|
||||||
|
|
||||||
|
const suggestion = {
|
||||||
|
...filteredOptions[0],
|
||||||
|
_suggestionHiddenPart: filteredOptions[0].value.slice(0, normalizedSearch.length),
|
||||||
|
_suggestionShownPart: filteredOptions[0].value.slice(normalizedSearch.length, filteredOptions[0].value.length)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return suggestion
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
optionSelected() {
|
||||||
|
this.$emit('option-selected', this.suggestion)
|
||||||
|
this.search = ''
|
||||||
|
},
|
||||||
|
|
||||||
|
_normalize(value) {
|
||||||
|
return value
|
||||||
|
.trim()
|
||||||
|
.toLowerCase()
|
||||||
|
.normalize("NFD")
|
||||||
|
.replace(/[\u0300-\u036f]/g, "")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="sass" scoped>
|
||||||
|
.wrapper
|
||||||
|
position: relative
|
||||||
|
|
||||||
|
.suggestion
|
||||||
|
position: absolute
|
||||||
|
top: 15.5px
|
||||||
|
left: 15.5px
|
||||||
|
opacity: 0.5
|
||||||
|
letter-spacing: 0.009375em
|
||||||
|
|
||||||
|
.hidden-part
|
||||||
|
opacity: 0
|
||||||
|
</style>
|
||||||
@@ -38,15 +38,8 @@ const options: Options = {
|
|||||||
ionic: {
|
ionic: {
|
||||||
disabled: false
|
disabled: false
|
||||||
},
|
},
|
||||||
toast: {
|
|
||||||
disabled: true
|
|
||||||
},
|
|
||||||
i18n: {
|
i18n: {
|
||||||
disabled: true,
|
|
||||||
languages: [
|
languages: [
|
||||||
{
|
|
||||||
title: 'English', flag: 'en', value: 'en'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "Slovenský", flag: "sk", value: "sk"
|
title: "Slovenský", flag: "sk", value: "sk"
|
||||||
}
|
}
|
||||||
@@ -57,6 +50,7 @@ const options: Options = {
|
|||||||
routes: {
|
routes: {
|
||||||
'GET v1/auth/info': true,
|
'GET v1/auth/info': true,
|
||||||
'POST v1/auth/forgot': true,
|
'POST v1/auth/forgot': true,
|
||||||
|
'POST v1/auth/reset': true,
|
||||||
'POST v1/auth/info': true,
|
'POST v1/auth/info': true,
|
||||||
'POST v1/auth/invalidate': true,
|
'POST v1/auth/invalidate': true,
|
||||||
'POST v1/auth/login': true,
|
'POST v1/auth/login': true,
|
||||||
@@ -89,17 +83,19 @@ const options: Options = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
createApp(App)
|
const app = createApp(App)
|
||||||
.use(router)
|
.use(router)
|
||||||
.use(store)
|
.use(store)
|
||||||
.use(w, options)
|
.use(w, options)
|
||||||
.use(IonicVue)
|
.use(IonicVue)
|
||||||
.use(vuetify)
|
.use(vuetify)
|
||||||
.use(wToast)
|
// .use(wToast)
|
||||||
.use(i18n, options)
|
|
||||||
.use(VueCal)
|
.use(VueCal)
|
||||||
.use(loader, {
|
.use(loader, {
|
||||||
color: '#6200EE'
|
color: '#6200EE'
|
||||||
})
|
})
|
||||||
.use(vueCal)
|
.use(vueCal)
|
||||||
.mount('#app')
|
.mount('#app')
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
|
export const $t = app.$i18n.t
|
||||||
@@ -61,12 +61,12 @@ const routes: Array<RouteRecordRaw> = [
|
|||||||
{
|
{
|
||||||
path: '/app/overview/unscheduled',
|
path: '/app/overview/unscheduled',
|
||||||
name: 'Overview - Unscheduled tasks',
|
name: 'Overview - Unscheduled tasks',
|
||||||
component: () => import('@/plugins/tm@overview/tasks-ongoing/tasks-ongoing.vue')
|
component: () => import('@/plugins/tm@overview/tasks-unscheduled/tasks-unscheduled.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/app/overview/ongoing',
|
path: '/app/overview/ongoing',
|
||||||
name: 'Overview - Ongoing tasks',
|
name: 'Overview - Ongoing tasks',
|
||||||
component: () => import('@/plugins/tm@overview/tasks-unscheduled/tasks-unscheduled.vue')
|
component: () => import('@/plugins/tm@overview/tasks-ongoing/tasks-ongoing.vue')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/app/overview/teams',
|
path: '/app/overview/teams',
|
||||||
|
|||||||
@@ -19,3 +19,6 @@ th
|
|||||||
|
|
||||||
.v-card
|
.v-card
|
||||||
padding: 35px !important
|
padding: 35px !important
|
||||||
|
|
||||||
|
.cursor-pointer:hover
|
||||||
|
cursor: pointer
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap')
|
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap')
|
||||||
|
|
||||||
|
@import './vuetify/v-dialog'
|
||||||
|
|
||||||
@import './global'
|
@import './global'
|
||||||
@import '@/plugins/lib@auth/_theme/auth.theme'
|
@import '@/plugins/lib@auth/_theme/auth.theme'
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
.v-dialog
|
||||||
|
h1
|
||||||
|
font-size: 22px
|
||||||
|
font-weight: 300
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
|
import { $t } from '@/plugins/app/_config/main'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
parseErrors(errors) {
|
parseErrors(errors) {
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
return Object.values(errors).map(error => error?.$message).join(', ')
|
return Object.values(errors).map(error => $t(error?.$message)).join('. ')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -46,8 +46,8 @@ export default {
|
|||||||
if (!(await this.v$.$validate())) return console.log(this.v$)
|
if (!(await this.v$.$validate())) return console.log(this.v$)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.$axios.post_data('v1/auth/forgot', this.form)
|
await this.$axios.post_data('v1/auth/reset', this.form)
|
||||||
this.$router.push({ name: 'Reset password' })
|
this.$router.push({ name: 'Login' })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$toast.error(error.data.error)
|
this.$toast.error(error.data.error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,9 @@
|
|||||||
<td class="task-action">
|
<td class="task-action">
|
||||||
<div class="d-flex justify-start">
|
<div class="d-flex justify-start">
|
||||||
<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" />
|
<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>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -28,12 +30,35 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import ADeleteTaskModal from '@/plugins/app/_components/a-delete-task-modal.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
ADeleteTaskModal
|
||||||
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
tasks: {
|
tasks: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
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>
|
</script>
|
||||||
|
|||||||
@@ -17,7 +17,9 @@
|
|||||||
<td class="task-action">
|
<td class="task-action">
|
||||||
<div class="d-flex justify-start">
|
<div class="d-flex justify-start">
|
||||||
<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">
|
<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>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -26,12 +28,35 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import ADeleteTaskModal from '@/plugins/app/_components/a-delete-task-modal.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
ADeleteTaskModal
|
||||||
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
tasks: {
|
tasks: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true
|
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>
|
</script>
|
||||||
|
|||||||
@@ -12,22 +12,10 @@
|
|||||||
<td>{{ team.name }}</td>
|
<td>{{ team.name }}</td>
|
||||||
<td class="task-action">
|
<td class="task-action">
|
||||||
<div class="d-flex justify-start">
|
<div class="d-flex justify-start">
|
||||||
<img
|
<img class="pencil-icon" :src="require('@/plugins/tm@overview/_img/pencil-icon.svg')" alt="pencil-icon" />
|
||||||
class="pencil-icon"
|
<img class="trash-icon" :src="require('@/plugins/tm@overview/_img/trash-icon.svg')" alt="trash-icon" @click.stop="showDeleteModal = true" />
|
||||||
:src="
|
|
||||||
require('@/plugins/tm@overview/_img/pencil-icon.svg')
|
<A-delete-team-modal :show="showDeleteModal" :team="team" @delete-team="deleteTeam" @close-modal="showDeleteModal = false" />
|
||||||
"
|
|
||||||
alt="pencil-icon"
|
|
||||||
/>
|
|
||||||
<img
|
|
||||||
class="trash-icon"
|
|
||||||
:src="
|
|
||||||
require('@/plugins/tm@overview/_img/trash-icon.svg')
|
|
||||||
"
|
|
||||||
alt="trash-icon"
|
|
||||||
@click.stop="dialog=true"
|
|
||||||
/>
|
|
||||||
<A-delete-team-modal :visible="dialog" @close="dialog=false" />
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -36,24 +24,35 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ADeleteTeamModal from '../../../app/_components/a-delete-team-modal.vue'
|
import ADeleteTeamModal from '@/plugins/app/_components/a-delete-team-modal.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
ADeleteTeamModal
|
ADeleteTeamModal
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dialog: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
teams: {
|
teams: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true
|
||||||
},
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showDeleteModal: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
async deleteTeam(id) {
|
||||||
|
try {
|
||||||
|
await this.$axios.delete(`v1/teams/${id}`)
|
||||||
|
this.showDeleteModal = false
|
||||||
|
} catch (error) {
|
||||||
|
this.$toast.error(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in new issue
Block a user