organization.vue 4.2 KB

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