organization.vue 4.2 KB

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