organization.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <UiFormEdition :model="Organization" class="inner-container">
  3. <template #default="{ entity: organization }">
  4. <div v-if="organization">
  5. <LayoutCommonSection>
  6. <v-row>
  7. <v-col cols="12">
  8. <h4 class="mb-8">{{ $t('general_informations') }}</h4>
  9. <UiInputText
  10. v-model="organization.name"
  11. field="name"
  12. :rules="getAsserts('name')"
  13. />
  14. <UiInputTextArea
  15. v-model="organization.description"
  16. field="description"
  17. />
  18. <UiInputImage
  19. v-model="organization.logo"
  20. field="logo"
  21. label="organization_logo"
  22. :width="120"
  23. :cropping-enabled="true"
  24. />
  25. </v-col>
  26. </v-row>
  27. </LayoutCommonSection>
  28. <LayoutCommonSection>
  29. <v-row>
  30. <v-col cols="12">
  31. <h4 class="mb-8">{{ $t('coordinate') }}</h4>
  32. <UiInputText
  33. v-model="organization.email"
  34. field="email"
  35. :rules="getAsserts('email')"
  36. />
  37. <UiInputPhone v-model="organization.tel" field="tel" />
  38. </v-col>
  39. </v-row>
  40. </LayoutCommonSection>
  41. <LayoutCommonSection>
  42. <v-row>
  43. <v-col cols="12">
  44. <h4 class="mb-8">{{ $t('postal_address') }}</h4>
  45. <UiInputText
  46. v-model="organization.streetAddress"
  47. field="streetAddress"
  48. />
  49. <UiInputText
  50. v-model="organization.streetAddressSecond"
  51. field="streetAddressSecond"
  52. />
  53. <UiInputText
  54. v-model="organization.streetAddressThird"
  55. field="streetAddressThird"
  56. />
  57. <UiInputText
  58. v-model="organization.postalCode"
  59. field="postalCode"
  60. />
  61. <UiInputText
  62. v-model="organization.addressCity"
  63. field="addressCity"
  64. />
  65. <UiInputAutocompleteApiResources
  66. v-model="organization.addressCountry"
  67. field="addressCountry"
  68. :model="Country"
  69. list-value="id"
  70. list-label="name"
  71. />
  72. <client-only>
  73. <UiMapLeaflet
  74. v-model:latitude="organization.latitude"
  75. v-model:longitude="organization.longitude"
  76. :street-address="organization.streetAddress"
  77. :street-address-second="organization.streetAddressSecond"
  78. :street-address-third="organization.streetAddressThird"
  79. :postal-code="organization.postalCode"
  80. :address-city="organization.addressCity"
  81. :address-country-id="organization.addressCountry"
  82. :search-button="true"
  83. ></UiMapLeaflet>
  84. </client-only>
  85. </v-col>
  86. </v-row>
  87. </LayoutCommonSection>
  88. <LayoutCommonSection>
  89. <v-row>
  90. <v-col cols="12">
  91. <h4 class="mb-8">{{ $t('communication_params') }}</h4>
  92. <UiInputText v-model="organization.facebook" field="facebook" :rules="getAsserts('facebook')" />
  93. <UiInputText v-model="organization.twitter" field="twitter" :rules="getAsserts('twitter')" />
  94. <UiInputText v-model="organization.youtube" field="youtube" :rules="getAsserts('youtube')" />
  95. <UiInputText v-model="organization.instagram" field="instagram" :rules="getAsserts('instagram')" />
  96. <UiInputCheckbox
  97. v-model="organization.portailVisibility"
  98. field="portailVisibility"
  99. />
  100. </v-col>
  101. </v-row>
  102. </LayoutCommonSection>
  103. </div>
  104. </template>
  105. </UiFormEdition>
  106. </template>
  107. <script setup lang="ts">
  108. import Organization from '~/models/Freemium/Organization'
  109. import { getAssertUtils } from '~/services/asserts/getAssertUtils'
  110. import Country from '~/models/Core/Country'
  111. definePageMeta({
  112. name: 'freemium_organization_page',
  113. })
  114. onUnmounted(() => {
  115. useRepo(Organization).flush()
  116. useRepo(Country).flush()
  117. })
  118. const getAsserts = (key) => getAssertUtils(Organization.getAsserts(), key)
  119. </script>
  120. <style scoped lang="scss">
  121. .inner-container {
  122. max-width: 1200px;
  123. }
  124. </style>