Missions.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <LayoutContainer>
  3. <div
  4. v-for="(job, index) in jobs"
  5. :key="index"
  6. class="mission-container"
  7. >
  8. <!-- Première ligne -->
  9. <v-row class="announcement-title ml-6 mr-6">
  10. <div class="title-job">
  11. {{ job.title }} - {{ job.contractType }}
  12. </div>
  13. <v-btn class="btn-more" text> En savoir plus </v-btn>
  14. </v-row>
  15. <!-- Deuxième ligne -->
  16. <v-row class="announcement-location ml-6 mr-6">
  17. <v-icon class="icon-location">
  18. <i class="fas fa-map-marker"></i>
  19. </v-icon>
  20. <div class="location">
  21. {{ job.city }}
  22. </div>
  23. </v-row>
  24. </div>
  25. <v-row class="apply-row ml-6 mb-6">
  26. <v-col cols="12">
  27. <p class="apply-now">
  28. Nous sommes toujours à la recherche de nouveaux talents. N'hésitez pas à
  29. déposer votre candidature ci-dessous :
  30. </p>
  31. </v-col>
  32. </v-row>
  33. <v-row>
  34. <v-col cols="12">
  35. <v-btn class="btn-send"> Envoyer ma candidature </v-btn>
  36. </v-col>
  37. </v-row>
  38. </LayoutContainer>
  39. </template>
  40. <script setup lang="ts">
  41. import { ref } from "vue";
  42. import { useMaestroRequestService } from "~/composables/useMaestroRequestService";
  43. const { apiRequestService } = useMaestroRequestService();
  44. const query = computed(() => {
  45. const queryParams: { page: number; type?: string; [key: string]: number | string } = {
  46. page: page.value,
  47. type: 'ENTREPRISE'
  48. };
  49. return queryParams;
  50. });
  51. // Base URL for API requests
  52. const totalItems = ref(0);
  53. const config = useRuntimeConfig();
  54. const baseUrl = `${config.public.apiBaseUrl}/api/job-postings`;
  55. const page: Ref<number> = ref(1);
  56. const itemsPerPage: Ref<number> = ref(10);
  57. const { t } = useI18n();
  58. const {
  59. data: jobs = [],
  60. pending,
  61. refresh,
  62. } = useLazyAsyncData("files", async () => {
  63. const response = await apiRequestService.get(baseUrl, query.value);
  64. const collection = response["hydra:member"];
  65. // Obtenir la date actuelle
  66. const currentDate = new Date();
  67. const filteredJobs = collection.filter(item => {
  68. const endPublicationDate = new Date(item.endPublication);
  69. return item.type === 'ENTREPRISE' && endPublicationDate >= currentDate;
  70. });
  71. totalItems.value = filteredJobs.length;
  72. console.log(filteredJobs);
  73. return filteredJobs;
  74. });
  75. </script>
  76. <style scoped>
  77. .location{
  78. font-size: 1.3rem !important;
  79. color: #0e2d32;
  80. }
  81. .announcement-title {
  82. background: #0e2d32;
  83. color: white;
  84. display: flex;
  85. justify-content: space-between;
  86. padding: 10px;
  87. }
  88. .title-job {
  89. font-family: "Barlow";
  90. font-style: normal;
  91. font-weight: 600;
  92. font-size: 1.5rem;
  93. line-height: 39px;
  94. color: #ffffff;
  95. }
  96. .btn-more, .btn-send {
  97. background: #9edbdd;
  98. color: white;
  99. }
  100. .btn-send {
  101. display: flex;
  102. justify-content: center;
  103. align-items: center;
  104. width: 30%;
  105. margin-left: auto;
  106. margin-right: auto;
  107. font-weight: 700;
  108. }
  109. .announcement-location {
  110. background: #9edbdd;
  111. display: flex;
  112. align-items: center;
  113. padding: 10px;
  114. }
  115. .icon-location {
  116. font-size: 1rem !important;
  117. color: #0e2d32;
  118. }
  119. .location {
  120. margin-left: 10px;
  121. font-size: 2rem;
  122. }
  123. .apply-now {
  124. text-align: center;
  125. font-style: italic;
  126. font-weight: 300;
  127. font-size: 34px;
  128. line-height: 40px;
  129. color: #091d20;
  130. margin-bottom: 2rem;
  131. }
  132. .mission-container {
  133. margin-top: 5rem;
  134. margin-bottom: 5%;
  135. }
  136. </style>