|
@@ -112,6 +112,7 @@
|
|
|
|
|
|
|
|
<client-only>
|
|
<client-only>
|
|
|
<UiMapLeaflet
|
|
<UiMapLeaflet
|
|
|
|
|
+ :readonly="!newPlace && !editPlace"
|
|
|
v-model:latitude="entity.latitude"
|
|
v-model:latitude="entity.latitude"
|
|
|
v-model:longitude="entity.longitude"
|
|
v-model:longitude="entity.longitude"
|
|
|
:streetAddress="entity.streetAddress"
|
|
:streetAddress="entity.streetAddress"
|
|
@@ -151,6 +152,27 @@
|
|
|
</v-col>
|
|
</v-col>
|
|
|
</v-row>
|
|
</v-row>
|
|
|
</LayoutCommonSection>
|
|
</LayoutCommonSection>
|
|
|
|
|
+
|
|
|
|
|
+ <LazyLayoutDialog :show="showAlert" theme="warning">
|
|
|
|
|
+ <template #dialogType>{{ $t('important') }}</template>
|
|
|
|
|
+ <template #dialogTitle>{{ $t('place_change_everywhere') }}</template>
|
|
|
|
|
+ <template #dialogText>
|
|
|
|
|
+ <v-card-text class="text">
|
|
|
|
|
+ <p>
|
|
|
|
|
+ Si vous modifiez les informations de ce lieu et que ce lieu est lié à d'autre événements,
|
|
|
|
|
+ alors les changements seront répercutés dans tous vos événements liés.
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </v-card-text>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #dialogBtn>
|
|
|
|
|
+ <v-btn class="mr-4 submitBtn theme-neutral-strong" @click="closeDialog">
|
|
|
|
|
+ {{ $t('cancel') }}
|
|
|
|
|
+ </v-btn>
|
|
|
|
|
+ <v-btn class="mr-4 submitBtn theme-warning" @click="onEditPlaceConfirm">
|
|
|
|
|
+ {{ $t('i_understand') }}
|
|
|
|
|
+ </v-btn>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </LazyLayoutDialog>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
@@ -180,10 +202,47 @@ const onUpdateDateTimeEnd = (entity, dateTime) =>{
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const showAlert: Ref<boolean> = ref(false)
|
|
|
const newPlace: Ref<boolean> = ref(false)
|
|
const newPlace: Ref<boolean> = ref(false)
|
|
|
const editPlace: Ref<boolean> = ref(false)
|
|
const editPlace: Ref<boolean> = ref(false)
|
|
|
const onAddPlaceClick = function(entity: Event){
|
|
const onAddPlaceClick = function(entity: Event){
|
|
|
newPlace.value = true
|
|
newPlace.value = true
|
|
|
|
|
+ entity.place = null
|
|
|
|
|
+ resetPlace(entity)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const onEditPlaceClick = function(){
|
|
|
|
|
+ showAlert.value = true
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const closeDialog = function(){
|
|
|
|
|
+ showAlert.value = false
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const onEditPlaceConfirm = function(){
|
|
|
|
|
+ showAlert.value = false
|
|
|
|
|
+ editPlace.value = true
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const getPlace = async (entity: Event)=>{
|
|
|
|
|
+ if(entity.place){
|
|
|
|
|
+ const placeInstance = await em.fetch(Place, entity.place as number)
|
|
|
|
|
+ entity.placeName = placeInstance.name
|
|
|
|
|
+ entity.streetAddress = placeInstance.streetAddress
|
|
|
|
|
+ entity.streetAddressSecond = placeInstance.streetAddressSecond
|
|
|
|
|
+ entity.streetAddressThird = placeInstance.streetAddressThird
|
|
|
|
|
+ entity.addressCity = placeInstance.addressCity
|
|
|
|
|
+ entity.postalCode = placeInstance.postalCode
|
|
|
|
|
+ entity.addressCountry = placeInstance.addressCountry
|
|
|
|
|
+ entity.latitude = placeInstance.latitude
|
|
|
|
|
+ entity.longitude = placeInstance.longitude
|
|
|
|
|
+ editPlace.value = false
|
|
|
|
|
+ }else{
|
|
|
|
|
+ resetPlace(entity)
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const resetPlace = (entity: Event)=>{
|
|
|
entity.placeName = null
|
|
entity.placeName = null
|
|
|
entity.streetAddress = null
|
|
entity.streetAddress = null
|
|
|
entity.streetAddressSecond = null
|
|
entity.streetAddressSecond = null
|
|
@@ -193,25 +252,16 @@ const onAddPlaceClick = function(entity: Event){
|
|
|
entity.addressCountry = null
|
|
entity.addressCountry = null
|
|
|
entity.latitude = null
|
|
entity.latitude = null
|
|
|
entity.longitude = null
|
|
entity.longitude = null
|
|
|
- entity.place = null
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-const onEditPlaceClick = function(){
|
|
|
|
|
- editPlace.value = true
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const getPlace = async (entity: Event)=>{
|
|
|
|
|
- const placeInstance = await em.fetch(Place, entity.place as number)
|
|
|
|
|
- entity.placeName = placeInstance.name
|
|
|
|
|
- entity.streetAddress = placeInstance.streetAddress
|
|
|
|
|
- entity.streetAddressSecond = placeInstance.streetAddressSecond
|
|
|
|
|
- entity.streetAddressThird = placeInstance.streetAddressThird
|
|
|
|
|
- entity.addressCity = placeInstance.addressCity
|
|
|
|
|
- entity.postalCode = placeInstance.postalCode
|
|
|
|
|
- entity.addressCountry = placeInstance.addressCountry
|
|
|
|
|
- entity.latitude = placeInstance.latitude
|
|
|
|
|
- entity.longitude = placeInstance.longitude
|
|
|
|
|
-}
|
|
|
|
|
|
|
+// Nettoyer les données lors du démontage du composant
|
|
|
|
|
+onBeforeUnmount(() => {
|
|
|
|
|
+ // Nettoyer les références du store si nécessaire
|
|
|
|
|
+ if (process.client) {
|
|
|
|
|
+ clearNuxtData('/^' + Place.entity + '_/')
|
|
|
|
|
+ useRepo(Place).flush()
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|