2026-03-18 12:49:28 +01:00
|
|
|
<result-list>
|
2026-03-18 13:21:19 +01:00
|
|
|
<div class="results">
|
2026-03-21 13:47:09 +01:00
|
|
|
|
2026-03-18 13:21:19 +01:00
|
|
|
<div class="message" if={ props.results.length === 0 && props.hasSearched && !props.loading }>
|
2026-03-18 12:49:28 +01:00
|
|
|
Aucun résultat trouvé
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-03-18 13:21:19 +01:00
|
|
|
<div class="message" if={ props.loading }>
|
2026-03-18 12:49:28 +01:00
|
|
|
Chargement...
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-03-21 13:47:09 +01:00
|
|
|
<div each={ (formation, index) in props.results } key={ formation.id } class="card">
|
|
|
|
|
<h3>{ formation.nom }</h3>
|
|
|
|
|
<p><b>Établissement :</b> { formation.etablissement }</p>
|
|
|
|
|
<p><b>Ville :</b> { formation.ville } ({ formation.departement })</p>
|
|
|
|
|
<p><b>Filière :</b> { formation.filiere }</p>
|
|
|
|
|
<p><b>Taux d'accès :</b> { formation.tauxAcces }%</p>
|
2026-03-18 13:54:33 +01:00
|
|
|
|
2026-03-21 13:47:09 +01:00
|
|
|
<button onclick={ afficherDetail.bind(this, index) }>Voir détail</button>
|
|
|
|
|
<button onclick={ ajouterALaSelection.bind(this, index) }>Ajouter à la sélection</button>
|
|
|
|
|
<button onclick={ localiserSurCarte.bind(this, formation) } if={ formation.latitude != null }>Localiser</button>
|
2026-03-18 12:49:28 +01:00
|
|
|
</div>
|
2026-03-21 13:47:09 +01:00
|
|
|
|
2026-03-18 12:49:28 +01:00
|
|
|
</div>
|
2026-03-20 01:51:08 +01:00
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
2026-03-21 13:47:09 +01:00
|
|
|
|
|
|
|
|
// Déclencher l'affichage du détail d'une formation
|
|
|
|
|
afficherDetail(index) {
|
2026-03-30 16:33:11 +02:00
|
|
|
this.props.ondetail(index);
|
2026-03-21 13:47:09 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// Ajouter une formation à la sélection
|
|
|
|
|
ajouterALaSelection(index) {
|
2026-03-30 16:33:11 +02:00
|
|
|
this.props.onselect(index);
|
2026-03-21 13:47:09 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// Centrer la carte sur la formation
|
|
|
|
|
localiserSurCarte(formation) {
|
2026-03-20 01:51:08 +01:00
|
|
|
if (window.mapFocus) {
|
2026-03-30 16:33:11 +02:00
|
|
|
window.mapFocus(formation.id);
|
2026-03-20 01:51:08 +01:00
|
|
|
}
|
|
|
|
|
}
|
2026-03-21 13:47:09 +01:00
|
|
|
|
2026-03-30 16:33:11 +02:00
|
|
|
};
|
2026-03-20 01:51:08 +01:00
|
|
|
</script>
|
2026-03-21 13:47:09 +01:00
|
|
|
|
2026-03-20 01:51:08 +01:00
|
|
|
</result-list>
|