feat(heures) : sites en tags et désélectionnés par défaut dans le drawer d'export
- Affichage des sites sélectionnés en tags (display-tag) - Aucun site sélectionné à l'ouverture du drawer (prop initialSiteIds retirée) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
groupClass="w-full mt-2"
|
groupClass="w-full mt-2"
|
||||||
label="Sites"
|
label="Sites"
|
||||||
display-select-all
|
display-select-all
|
||||||
|
display-tag
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -49,7 +50,6 @@ const props = defineProps<{
|
|||||||
modelValue: boolean
|
modelValue: boolean
|
||||||
sites: Site[]
|
sites: Site[]
|
||||||
initialDate: string
|
initialDate: string
|
||||||
initialSiteIds: number[]
|
|
||||||
isLoading?: boolean
|
isLoading?: boolean
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ const drawerOpen = computed({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const selectedDate = ref(props.initialDate)
|
const selectedDate = ref(props.initialDate)
|
||||||
const selectedSites = ref<number[]>([...props.initialSiteIds])
|
const selectedSites = ref<number[]>([])
|
||||||
|
|
||||||
const siteOptions = computed(() =>
|
const siteOptions = computed(() =>
|
||||||
props.sites.map((site) => ({ label: site.name, value: site.id }))
|
props.sites.map((site) => ({ label: site.name, value: site.id }))
|
||||||
@@ -80,7 +80,7 @@ watch(
|
|||||||
(isOpen) => {
|
(isOpen) => {
|
||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
selectedDate.value = props.initialDate
|
selectedDate.value = props.initialDate
|
||||||
selectedSites.value = [...props.initialSiteIds]
|
selectedSites.value = []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
v-model="isExportDrawerOpen"
|
v-model="isExportDrawerOpen"
|
||||||
:sites="sites"
|
:sites="sites"
|
||||||
:initial-date="selectedDate"
|
:initial-date="selectedDate"
|
||||||
:initial-site-ids="selectedSiteIds"
|
|
||||||
:is-loading="isExporting"
|
:is-loading="isExporting"
|
||||||
@submit="handleExport"
|
@submit="handleExport"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user