general_parameters.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <NuxtLayout name="parameters">
  3. <LayoutContainer>
  4. <UiLoadingPanel v-if="pending" />
  5. <UiForm
  6. v-else
  7. :model="Parameters"
  8. :entity="parameters"
  9. >
  10. <v-row>
  11. <v-col cols="6">
  12. <UiInputDatePicker
  13. v-if="organizationProfile.isSchool"
  14. v-model="parameters.financialDate"
  15. field="financialDate"
  16. label="start_date_of_financial_season"
  17. class="my-2"
  18. />
  19. <UiInputDatePicker
  20. v-if="organizationProfile.isSchool"
  21. v-model="parameters.startCourseDate"
  22. field="startCourseDate"
  23. label="start_date_of_courses"
  24. class="my-2"
  25. />
  26. <UiInputCheckbox
  27. v-model="parameters.showAdherentList"
  28. field="showAdherentList"
  29. label="show_adherents_list_and_their_coordinates"
  30. />
  31. <UiInputAutocompleteWithEnum
  32. v-model="parameters.timezone"
  33. enum-name="timezone"
  34. field="timezone"
  35. />
  36. </v-col>
  37. <v-col cols="6">
  38. <UiInputDatePicker
  39. v-if="organizationProfile.isSchool"
  40. v-model="parameters.musicalDate"
  41. field="musicalDate"
  42. label="start_date_of_activity_season"
  43. class="my-2"
  44. />
  45. <UiInputDatePicker
  46. v-if="organizationProfile.isSchool"
  47. v-model="parameters.endCourseDate"
  48. field="endCourseDate"
  49. label="end_date_of_courses"
  50. class="my-2"
  51. />
  52. <UiInputCheckbox
  53. v-if="organizationProfile.isSchool && organizationProfile.isAssociation"
  54. v-model="parameters.studentsAreAdherents"
  55. field="studentsAreAdherents"
  56. label="students_are_also_association_members"
  57. />
  58. <!-- TODO: reprendre l'UiInput -->
  59. <UiInputImage
  60. v-model="parameters['qrCode_id']"
  61. field="qrCode_id"
  62. label="licenceQrCode"
  63. />
  64. </v-col>
  65. </v-row>
  66. </UiForm>
  67. </LayoutContainer>
  68. </NuxtLayout>
  69. </template>
  70. <script setup lang="ts">
  71. import Parameters from "~/models/Organization/Parameters";
  72. import {useEntityFetch} from "~/composables/data/useEntityFetch";
  73. import {useOrganizationProfileStore} from "~/stores/organizationProfile";
  74. import {AsyncData} from "#app";
  75. /**
  76. * Disable the default layout, the page will use the layout defined with <NuxtLayout />
  77. * @see https://nuxt.com/docs/guide/directory-structure/layouts#overriding-a-layout-on-a-per-page-basis
  78. */
  79. definePageMeta({
  80. layout: false,
  81. });
  82. const { fetch } = useEntityFetch()
  83. const organizationProfile = useOrganizationProfileStore()
  84. if (organizationProfile.parametersId === null) {
  85. throw new Error('Missing organization parameters id')
  86. }
  87. const { data: parameters, pending } = fetch(Parameters, organizationProfile.parametersId) as AsyncData<Parameters, Parameters | true>
  88. </script>