This commit is contained in:
iriska-gri committed 2024-07-08 16:56:34 +03:00
1 parent 41ec40fedb
commit ce57f376d6
1 file changed
+19 -11
@@ -17,7 +17,7 @@
<template v-slot:selection="{ item }"> <template v-slot:selection="{ item }">
<v-chip> <v-chip>
<span> {{ item.title }}</span> <span> {{ item.title }}</span>
<!-- не тут -->
<v-icon <v-icon
v-if="item.value != accountStore.user.is_idEmployee" v-if="item.value != accountStore.user.is_idEmployee"
icon="mdi-close-circle" icon="mdi-close-circle"
@@ -30,6 +30,7 @@
<!-- <!--
посчитать количество что я тут один и добавить условие --> посчитать количество что я тут один и добавить условие -->
<template v-slot:prepend-item> <template v-slot:prepend-item>
<!-- не тут -->
<v-list-item <v-list-item
@click="selectedStaff = staffed" @click="selectedStaff = staffed"
:disabled="disable()" :disabled="disable()"
@@ -58,6 +59,7 @@
:disabled="disable()" :disabled="disable()"
> >
<template v-slot:prepend> <template v-slot:prepend>
<!-- не тут -->
<v-checkbox-btn <v-checkbox-btn
@click.stop="selectedStaff = item.raw" @click.stop="selectedStaff = item.raw"
:color="'indigo-darken-4'" :color="'indigo-darken-4'"
@@ -72,7 +74,7 @@
</template> </template>
</v-list-item> </v-list-item>
</template> </template>
<!-- не тут -->
<v-list-item <v-list-item
v-for="x in item.raw.employees.filter((e) => v-for="x in item.raw.employees.filter((e) =>
e.title.toLowerCase().includes(filtered.toLowerCase()) e.title.toLowerCase().includes(filtered.toLowerCase())
@@ -83,13 +85,16 @@
@click.stop="selectedStaff = x" @click.stop="selectedStaff = x"
density="compact" density="compact"
> >
<template v-slot:prepend> <!--
@click.stop="selectedStaff = x"
<template v-slot:prepend>
<v-checkbox-btn <v-checkbox-btn
color="indigo-darken-4" color="indigo-darken-4"
:model-value="x[okey]" :model-value="x[okey]"
:disabled="x.id == accountStore.user.is_idEmployee" :disabled="x.id == accountStore.user.is_idEmployee"
></v-checkbox-btn> ></v-checkbox-btn>
</template> </template> -->
<span class="text-body-2"> {{ x.title }} </span> <span class="text-body-2"> {{ x.title }} </span>
</v-list-item> </v-list-item>
</v-list-group> </v-list-group>
@@ -141,17 +146,20 @@ export default {
}, },
}); });
const selectedStaff = computed({ const selectedStaff = computed({
get() { get() {
let selected = []; let selected = [];
props.staff.forEach((e) => { props.staff.forEach((e) => {
if (e.employees.every((n) => n[props.okey] == true)) { console.log(e, 'да гдееееееее')
e[props.okey] = true; // if (e.employees.every((n) => n[props.okey] == true)) {
selected.push(e); // e[props.okey] = true;
} else { // selected.push(e);
e[props.okey] = false; // } else {
selected.push(...e.employees.filter((n) => n[props.okey] == true)); // e[props.okey] = false;
} // selected.push(...e.employees.filter((n) => n[props.okey] == true));
// }
}); });
return selected; return selected;
}, },