organization.vue 4.3 KB

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