Missions.vue 3.5 KB

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