organization.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <UiForm v-if="organization" v-model="organization">
  3. <LayoutCommonSection>
  4. <v-row>
  5. <v-col cols="12">
  6. <h4 class="mb-8">{{ $t('general_informations') }}</h4>
  7. <UiInputText v-model="organization.name" field="name" :rules="getAsserts('name')" />
  8. <UiInputTextArea v-model="organization.description" field="description" />
  9. <UiInputImage
  10. v-model="organization.logo"
  11. field="logo"
  12. :width="120"
  13. :cropping-enabled="true"
  14. />
  15. </v-col>
  16. </v-row>
  17. </LayoutCommonSection>
  18. <LayoutCommonSection>
  19. <v-row>
  20. <v-col cols="12">
  21. <h4 class="mb-8">{{ $t('coordinate') }}</h4>
  22. <UiInputText v-model="organization.email" field="email" :rules="getAsserts('email')" />
  23. <UiInputPhone v-model="organization.tel" field="tel"/>
  24. </v-col>
  25. </v-row>
  26. </LayoutCommonSection>
  27. <LayoutCommonSection>
  28. <v-row>
  29. <v-col cols="12">
  30. <h4 class="mb-8">{{ $t('postal_address') }}</h4>
  31. <UiInputText v-model="organization.streetAddress" field="streetAddress" />
  32. <UiInputText v-model="organization.streetAddressSecond" field="streetAddressSecond" />
  33. <UiInputText v-model="organization.streetAddressThird" field="streetAddressThird" />
  34. <UiInputText v-model="organization.postalCode" field="postalCode" />
  35. <UiInputText v-model="organization.addressCity" field="addressCity" />
  36. <UiInputAutocompleteApiResources
  37. v-model="organization.addressCountry"
  38. field="addressCountry"
  39. :model="Country"
  40. listValue="id"
  41. listLabel="name"
  42. />
  43. <client-only>
  44. <UiMapLeaflet
  45. v-model:latitude="organization.latitude"
  46. v-model:longitude="organization.longitude"
  47. :streetAddress="organization.streetAddress"
  48. :streetAddressSecond="organization.streetAddressSecond"
  49. :streetAddressThird="organization.streetAddressThird"
  50. :postalCode="organization.postalCode"
  51. :addressCity="organization.addressCity"
  52. :addressCountryId="organization.addressCountry"
  53. :searchButton="true"
  54. ></UiMapLeaflet>
  55. </client-only>
  56. </v-col>
  57. </v-row>
  58. </LayoutCommonSection>
  59. <LayoutCommonSection>
  60. <v-row>
  61. <v-col cols="12">
  62. <h4 class="mb-8">{{ $t('communication_params') }}</h4>
  63. <UiInputText v-model="organization.facebook" field="facebook" />
  64. <UiInputText v-model="organization.twitter" field="twitter" />
  65. <UiInputText v-model="organization.youtube" field="youtube" />
  66. <UiInputText v-model="organization.instagram" field="instagram" />
  67. <UiInputCheckbox
  68. v-model="organization.portailVisibility"
  69. field="portailVisibility"
  70. />
  71. </v-col>
  72. </v-row>
  73. </LayoutCommonSection>
  74. </UiForm>
  75. </template>
  76. <script setup lang="ts">
  77. import {useEntityFetch} from "~/composables/data/useEntityFetch";
  78. import type {AsyncData} from "#app";
  79. import Organization from "~/models/Freemium/Organization";
  80. import {getAssertUtils} from "~/services/asserts/getAssertUtils";
  81. import Country from "~/models/Core/Country";
  82. import {useAp2iRequestService} from "~/composables/data/useAp2iRequestService";
  83. definePageMeta({
  84. name: 'freemium_organization_page',
  85. })
  86. const {apiRequestService, pending} = useAp2iRequestService()
  87. const { fetch } = useEntityFetch()
  88. const { data: organization } = fetch(
  89. Organization
  90. ) as AsyncData<Organization | null, Error | null>
  91. const getAsserts = (key) => getAssertUtils(Organization.getAsserts(), key)
  92. </script>