solve merge
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2024-06-18 14:12:24 +02:00
parent 746c8bd975
commit fbc2c892f3
1 changed files with 3 additions and 19 deletions

View File

@ -3,8 +3,7 @@ import { ref, onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
import EditPictureForm from 'components/EditPictureForm.vue';
import { useSession } from 'src/composables/useSession';
import VnImg from 'src/components/ui/VnImg.vue';
import axios from 'axios';
const $props = defineProps({
@ -27,19 +26,12 @@ const $props = defineProps({
});
const { t } = useI18n();
const { getTokenMultimedia } = useSession();
const image = ref(null);
const editPhotoFormDialog = ref(null);
const showEditPhotoForm = ref(false);
const warehouseName = ref(null);
const getItemAvatar = async () => {
const token = getTokenMultimedia();
const timeStamp = `timestamp=${Date.now()}`;
image.value = `/api/Images/catalog/200x200/${$props.entityId}/download?access_token=${token}&${timeStamp}`;
};
const toggleEditPictureForm = () => {
showEditPhotoForm.value = !showEditPhotoForm.value;
};
@ -62,28 +54,20 @@ const getWarehouseName = async (warehouseFk) => {
};
onMounted(async () => {
getItemAvatar();
getItemConfigs();
image.value.store.$subscribe((x, v) => {
handlePhotoUpdated(x.events.effect.newValue);
});
});
<<<<<<< Updated upstream
=======
const handlePhotoUpdated = (url = null) => {
image.value.reload(url);
};
>>>>>>> Stashed changes
</script>
<template>
<div class="relative-position">
<<<<<<< Updated upstream
<QImg :src="image" spinner-color="primary" style="min-height: 256px">
=======
<VnImg ref="image" :id="$props.entityId">
>>>>>>> Stashed changes
<template #error>
<div class="absolute-full picture text-center q-pa-md flex flex-center">
<div>
@ -96,7 +80,7 @@ const handlePhotoUpdated = (url = null) => {
</div>
</div>
</template>
</QImg>
</VnImg>
<QBtn
v-if="showEditButton"
color="primary"
@ -111,7 +95,7 @@ const handlePhotoUpdated = (url = null) => {
collection="catalog"
:id="entityId"
@close-form="toggleEditPictureForm()"
@on-photo-uploaded="getItemAvatar()"
@on-photo-uploaded="handlePhotoUpdated"
/>
</QDialog>
</QBtn>