From 313de98c913a3ac8d26caed03803c0c86376f2d1 Mon Sep 17 00:00:00 2001 From: romankko2 Date: Tue, 17 Jan 2023 17:46:26 +0100 Subject: [PATCH] computed za data --- .../app/_layout/app/_components/a-header.vue | 8 ++-- .../_components/a-project-calendar.vue | 4 +- .../tm@dashboard/projects/projects.vue | 2 +- .../tm@modal/blocker/z-blocker-modal.vue | 38 +++++++++---------- .../sub-task/z-add-time-task-modal.vue | 24 ++++++------ .../tm@modal/task/z-complete-task-modal.vue | 24 ++++++------ .../tm@modal/team/z-delete-team-modal.vue | 22 +++++------ .../_components/z-tasks-search.vue | 20 +++++----- 8 files changed, 71 insertions(+), 71 deletions(-) diff --git a/app/src/plugins/app/_layout/app/_components/a-header.vue b/app/src/plugins/app/_layout/app/_components/a-header.vue index ebc33df..f0872c8 100644 --- a/app/src/plugins/app/_layout/app/_components/a-header.vue +++ b/app/src/plugins/app/_layout/app/_components/a-header.vue @@ -72,16 +72,16 @@ export default { ZSubTaskModal }, - computed: { - ...mapGetters('auth', ['user']), - }, - data() { return { search: '' } }, + computed: { + ...mapGetters('auth', ['user']), + }, + methods: { async logOut() { try { diff --git a/app/src/plugins/tm@dashboard/projects/_components/a-project-calendar.vue b/app/src/plugins/tm@dashboard/projects/_components/a-project-calendar.vue index 9cdae62..2817816 100644 --- a/app/src/plugins/tm@dashboard/projects/_components/a-project-calendar.vue +++ b/app/src/plugins/tm@dashboard/projects/_components/a-project-calendar.vue @@ -5,8 +5,8 @@ diff --git a/app/src/plugins/tm@modal/sub-task/z-add-time-task-modal.vue b/app/src/plugins/tm@modal/sub-task/z-add-time-task-modal.vue index 16e8c81..5d64860 100644 --- a/app/src/plugins/tm@modal/sub-task/z-add-time-task-modal.vue +++ b/app/src/plugins/tm@modal/sub-task/z-add-time-task-modal.vue @@ -35,18 +35,6 @@ export default { } }, - methods: { - showModal() { - this.visible = true - }, - - close() { - this.visible = false - this.$emit('close', this.blocker) - this.blocker = null - }, - }, - computed: { show: { get() { @@ -57,6 +45,18 @@ export default { if (!value) this.$emit('close') } }, + }, + + methods: { + showModal() { + this.visible = true + }, + + close() { + this.visible = false + this.$emit('close', this.blocker) + this.blocker = null + }, } } diff --git a/app/src/plugins/tm@modal/task/z-complete-task-modal.vue b/app/src/plugins/tm@modal/task/z-complete-task-modal.vue index f6438d1..ec6c1b5 100644 --- a/app/src/plugins/tm@modal/task/z-complete-task-modal.vue +++ b/app/src/plugins/tm@modal/task/z-complete-task-modal.vue @@ -34,6 +34,18 @@ export default { } }, + computed: { + show: { + get() { + return this.visible + }, + + set(value) { + if (!value) this.$emit('close') + } + }, + }, + methods: { async complete() { try { @@ -49,18 +61,6 @@ export default { this.$toast.error(error) } } - }, - - computed: { - show: { - get() { - return this.visible - }, - - set(value) { - if (!value) this.$emit('close') - } - }, } } \ No newline at end of file diff --git a/app/src/plugins/tm@modal/team/z-delete-team-modal.vue b/app/src/plugins/tm@modal/team/z-delete-team-modal.vue index 25308b3..13607f6 100644 --- a/app/src/plugins/tm@modal/team/z-delete-team-modal.vue +++ b/app/src/plugins/tm@modal/team/z-delete-team-modal.vue @@ -33,17 +33,6 @@ export default { } }, - 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() { @@ -54,6 +43,17 @@ export default { if (!value) this.$emit('close') } }, + }, + + methods: { + async deleteTeam() { + try { + await this.$axios.delete(`v1/teams/${this.team.id}`) + this.show = false + } catch (error) { + this.$toast.error(error) + } + } } } \ No newline at end of file diff --git a/app/src/plugins/tm@overview/_components/z-tasks-search.vue b/app/src/plugins/tm@overview/_components/z-tasks-search.vue index 62082c2..fb8f08e 100644 --- a/app/src/plugins/tm@overview/_components/z-tasks-search.vue +++ b/app/src/plugins/tm@overview/_components/z-tasks-search.vue @@ -29,6 +29,16 @@ export default { } }, + computed: { + allEmployees() { + const employees = this.employees.map((employee) => { + return `${employee.name} ${employee.surname}` + }) + return employees + + } + }, + async created() { try { this.employees = await this.$axios.get_auth_data('v1/employees') @@ -41,16 +51,6 @@ export default { onInput() { this.$emit('queryChange', this.searchQuery) } - }, - - computed: { - allEmployees() { - const employees = this.employees.map((employee) => { - return `${employee.name} ${employee.surname}` - }) - return employees - - } } }