computed za data

This commit is contained in:
romankko2 committed 2023-01-17 17:46:26 +01:00
1 parent 8a4a919a29
commit 313de98c91
8 files changed
+71 -71

No files matched your search

@@ -72,16 +72,16 @@ export default {
ZSubTaskModal
},
computed: {
...mapGetters('auth', ['user']),
},
data() {
return {
search: ''
}
},
computed: {
...mapGetters('auth', ['user']),
},
methods: {
async logOut() {
try {
@@ -5,8 +5,8 @@
</div>
</template>
<script>
import VFullCalendar from '@fullcalendar/vue3'
import dayGridPlugin from '@fullcalendar/daygrid'
import VFullCalendar from '@fullcalendar/vue3'
import dayGridPlugin from '@fullcalendar/daygrid'
import ZMasterTaskModal from '@/plugins/tm@modal/master-task/z-master-task-modal.vue'
export default {
@@ -7,7 +7,7 @@
<script>
import AProjectCalendar from './_components/a-project-calendar.vue'
import AProjectFilter from './_components/a-project-filter.vue'
import AProjectFilter from './_components/a-project-filter.vue'
export default {
components: {
@@ -15,7 +15,7 @@
<v-text-field
@focus="onInputFocus"
class="modal-input"
label="Názov blocker"
label="Názov blockeru"
:class="{ error: v$.blocker.name.$errors.length }"
:hint="
v$.blocker.name.$errors
@@ -100,6 +100,24 @@ export default {
}
},
computed: {
employeesOptions() {
const selectedEmployeesIds = this.blocker.employees.map(
(employee) => employee.id
)
const employees = this.allEmployees.filter(
(employee) => !selectedEmployeesIds.includes(employee.id)
)
return employees.map((employee) => {
return {
key: employee.id,
value: `${employee.name} ${employee.surname}`,
}
})
}
},
validations() {
return {
blocker: {
@@ -210,24 +228,6 @@ export default {
return employee
})
}
},
computed: {
employeesOptions() {
const selectedEmployeesIds = this.blocker.employees.map(
(employee) => employee.id
)
const employees = this.allEmployees.filter(
(employee) => !selectedEmployeesIds.includes(employee.id)
)
return employees.map((employee) => {
return {
key: employee.id,
value: `${employee.name} ${employee.surname}`,
}
})
}
}
}
</script>
@@ -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
},
}
}
</script>
@@ -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')
}
},
}
}
</script>
@@ -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)
}
}
}
}
</script>
@@ -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
}
}
}
</script>