|
1 | 1 | <template> |
2 | | - <DataTable :value="tasks" ref="dt" stripedRows :loading="loading" data-key="observation.uuid"> |
3 | | - <!-- <template #header> |
| 2 | + <div class="flex-1 h-full overflow-hidden flex border border-surface rounded-2xl"> |
| 3 | + <DataTable :value="tasks" ref="dt" stripedRows :loading="loading" data-key="observation.uuid" :pt="{ |
| 4 | + root: { |
| 5 | + class: 'w-full flex-1 overflow-x-auto' |
| 6 | + }, |
| 7 | + }"> |
| 8 | + <!-- <template #header> |
4 | 9 | <div style="text-align:left"> |
5 | 10 | <MultiSelect id="column_select" :modelValue="selectedColumns" :options="columns" optionLabel="header" |
6 | 11 | @update:modelValue="onSelectColumn" display="chip" :maxSelectedLabels="0" filter selectedItemsLabel="Columns" |
7 | 12 | placeholder="Columns" /> |
8 | 13 | </div> |
9 | 14 | </template> --> |
10 | | - <Column field="observation.uuid" header="UUID"> |
11 | | - <template #body="slotProps"> |
12 | | - <RouterLink :to="{ name: 'identification_task', params: { observationUuid: slotProps.data.observation.uuid } }" |
13 | | - custom v-slot="{ href }"> |
14 | | - <a :href="href" target="_blank" class="flex items-center gap-2"> |
15 | | - <span class="hover:underline">{{ slotProps.data.observation.uuid }}</span> |
16 | | - <i class="pi pi-external-link" style="font-size: 0.8rem" /> |
17 | | - </a> |
18 | | - </RouterLink> |
19 | | - </template> |
20 | | - </Column> |
21 | | - <Column header="Status"> |
22 | | - <template #body="slotProps"> |
23 | | - <IdentificationTaskStatusTag :status="slotProps.data.status" /> |
24 | | - </template> |
25 | | - </Column> |
26 | | - <Column header="Image"> |
27 | | - <template #body="slotProps"> |
28 | | - <Image :src="`${slotProps.data.public_photo.url}`" preview |
29 | | - imageClass="aspect-square object-cover rounded w-16" /> |
30 | | - </template> |
31 | | - </Column> |
32 | | - <Column header="Taxon"> |
33 | | - <template #body="slotProps"> |
34 | | - <IdentificationTaskResultTag v-if="slotProps.data.result" :result="slotProps.data.result" /> |
35 | | - </template> |
36 | | - </Column> |
37 | | - <Column header="Country"> |
38 | | - <template #body="slotProps"> |
39 | | - <CountryTag v-if="slotProps.data.observation.location.country" |
40 | | - :country="slotProps.data.observation.location.country" /> |
41 | | - </template> |
42 | | - </Column> |
43 | | - <Column header="Assignations"> |
44 | | - <template #body="slotProps"> |
45 | | - <AvatarGroup> |
46 | | - <UserAvatar v-for="assignment, index in slotProps.data.assignments" :key="index" :user="assignment.user" |
47 | | - v-tooltip.top="assignment.annotation_id === null ? `${assignment.user.full_name || assignment.user.username} (Pending)` : assignment.user.full_name || assignment.user.username" |
48 | | - :class="assignment.annotation_id ? '' : 'border-(--p-tag-warn-color)! bg-(--p-tag-warn-background)! text-(--p-tag-warn-color)!'" /> |
49 | | - </AvatarGroup> |
50 | | - </template> |
51 | | - </Column> |
52 | | - <Column field="is_flagged" header="Is flagged" dataType="boolean" style="min-width: 6rem"> |
53 | | - <template #body="slotProps"> |
54 | | - <i class="pi" |
55 | | - :class="{ 'pi-check-circle text-green-500': slotProps.data.is_flagged, 'pi-times-circle text-red-400': !slotProps.data.is_flagged }" /> |
56 | | - </template> |
57 | | - </Column> |
58 | | - <Column field="is_safe" header="Is Safe" dataType="boolean" style="min-width: 6rem"> |
59 | | - <template #body="slotProps"> |
60 | | - <i v-if='slotProps.data.is_safe' class="pi pi-shield text-green-500" /> |
61 | | - </template> |
62 | | - </Column> |
63 | | - <!-- <Column v-for="(col, index) of selectedColumns" :field="col.field" :header="col.header" |
| 15 | + <Column field="observation.uuid" header="UUID"> |
| 16 | + <template #body="slotProps"> |
| 17 | + <RouterLink |
| 18 | + :to="{ name: 'identification_task', params: { observationUuid: slotProps.data.observation.uuid } }" custom |
| 19 | + v-slot="{ href }"> |
| 20 | + <a :href="href" target="_blank" class="flex items-center gap-2"> |
| 21 | + <span class="hover:underline">{{ slotProps.data.observation.uuid }}</span> |
| 22 | + <i class="pi pi-external-link" style="font-size: 0.8rem" /> |
| 23 | + </a> |
| 24 | + </RouterLink> |
| 25 | + </template> |
| 26 | + </Column> |
| 27 | + <Column field="observation.short_id" header="Short ID" /> |
| 28 | + <Column header="Status"> |
| 29 | + <template #body="slotProps"> |
| 30 | + <IdentificationTaskStatusTag :status="slotProps.data.status" /> |
| 31 | + </template> |
| 32 | + </Column> |
| 33 | + <Column header="Image"> |
| 34 | + <template #body="slotProps"> |
| 35 | + <Image :src="`${slotProps.data.public_photo.url}`" preview |
| 36 | + imageClass="aspect-square object-cover rounded w-16" /> |
| 37 | + </template> |
| 38 | + </Column> |
| 39 | + <Column header="Taxon"> |
| 40 | + <template #body="slotProps"> |
| 41 | + <IdentificationTaskResultTag v-if="slotProps.data.result" :result="slotProps.data.result" /> |
| 42 | + </template> |
| 43 | + </Column> |
| 44 | + <Column header="Country"> |
| 45 | + <template #body="slotProps"> |
| 46 | + <CountryTag v-if="slotProps.data.observation.location.country" |
| 47 | + :country="slotProps.data.observation.location.country" /> |
| 48 | + </template> |
| 49 | + </Column> |
| 50 | + <Column header="Assignations"> |
| 51 | + <template #body="slotProps"> |
| 52 | + <AvatarGroup> |
| 53 | + <UserAvatar v-for="assignment, index in slotProps.data.assignments" :key="index" :user="assignment.user" |
| 54 | + v-tooltip.top="assignment.annotation_id === null ? `${assignment.user.full_name || assignment.user.username} (Pending)` : assignment.user.full_name || assignment.user.username" |
| 55 | + :class="assignment.annotation_id ? '' : 'border-(--p-tag-warn-color)! bg-(--p-tag-warn-background)! text-(--p-tag-warn-color)!'" /> |
| 56 | + </AvatarGroup> |
| 57 | + </template> |
| 58 | + </Column> |
| 59 | + <Column field="is_flagged" header="Is flagged" dataType="boolean" style="min-width: 6rem"> |
| 60 | + <template #body="slotProps"> |
| 61 | + <i class="pi" |
| 62 | + :class="{ 'pi-check-circle text-green-500': slotProps.data.is_flagged, 'pi-times-circle text-red-400': !slotProps.data.is_flagged }" /> |
| 63 | + </template> |
| 64 | + </Column> |
| 65 | + <Column field="is_safe" header="Is Safe" dataType="boolean" style="min-width: 6rem"> |
| 66 | + <template #body="slotProps"> |
| 67 | + <i v-if='slotProps.data.is_safe' class="pi pi-shield text-green-500" /> |
| 68 | + </template> |
| 69 | + </Column> |
| 70 | + <!-- <Column v-for="(col, index) of selectedColumns" :field="col.field" :header="col.header" |
64 | 71 | :key="col.field + '_' + index"> |
65 | 72 | </Column> --> |
66 | 73 |
|
67 | | - <Column header="Created at"> |
68 | | - <template #body="slotProps"> |
69 | | - {{ formatLocalDateTime(slotProps.data.created_at) }} |
70 | | - </template> |
71 | | - </Column> |
72 | | - <Column header="Last updated"> |
73 | | - <template #body="slotProps"> |
74 | | - {{ formatLocalDateTime(slotProps.data.updated_at) }} |
75 | | - </template> |
76 | | - </Column> |
77 | | - </DataTable> |
| 74 | + <Column header="Created at"> |
| 75 | + <template #body="slotProps"> |
| 76 | + {{ formatLocalDateTime(slotProps.data.created_at) }} |
| 77 | + </template> |
| 78 | + </Column> |
| 79 | + <Column header="Last updated"> |
| 80 | + <template #body="slotProps"> |
| 81 | + {{ formatLocalDateTime(slotProps.data.updated_at) }} |
| 82 | + </template> |
| 83 | + </Column> |
| 84 | + </DataTable> |
| 85 | + </div> |
78 | 86 | </template> |
79 | 87 |
|
80 | 88 |
|
|
0 commit comments