Skip to content

Commit 4c1d500

Browse files
committed
feat: add multiple selections for employee search
1 parent a6f4a76 commit 4c1d500

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

roster/src/components/MonthViewTable.vue

+12-5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
:options="employeeSearchOptions"
1010
v-model="employeeSearch"
1111
placeholder="Search Employee"
12+
:multiple="true"
1213
/>
1314
</th>
1415

@@ -27,7 +28,10 @@
2728
<tr v-for="employee in employees.data" :key="employee.name">
2829
<!-- Employee Column -->
2930
<td
30-
v-if="!employeeSearch?.value || employeeSearch?.value === employee?.name"
31+
v-if="
32+
!employeeSearch?.length ||
33+
employeeSearch?.some((item) => item.value === employee?.name)
34+
"
3135
class="border-t px-2 py-3"
3236
>
3337
<div class="flex">
@@ -49,7 +53,10 @@
4953

5054
<!-- Events -->
5155
<td
52-
v-if="!employeeSearch?.value || employeeSearch?.value === employee?.name"
56+
v-if="
57+
!employeeSearch?.length ||
58+
employeeSearch?.some((item) => item.value === employee?.name)
59+
"
5360
v-for="(day, idx) in daysOfMonth"
5461
:key="idx"
5562
class="border-t p-1.5"
@@ -122,7 +129,7 @@
122129
: 'invisible'
123130
"
124131
@click="
125-
shiftAssignment = null;
132+
shiftAssignment = '';
126133
showShiftAssignmentDialog = true;
127134
"
128135
/>
@@ -194,8 +201,8 @@ const props = defineProps<{
194201
filters: { [K in FilterField]: string };
195202
}>();
196203
197-
const employeeSearch = ref({ value: "", label: "" });
198-
const shiftAssignment = ref();
204+
const employeeSearch = ref<{ value: string; label: string }[]>();
205+
const shiftAssignment = ref<string>();
199206
const showShiftAssignmentDialog = ref(false);
200207
const hoveredCell = ref({ employee: "", date: "", shift: "" });
201208

0 commit comments

Comments
 (0)