#6896 end orders migration #400

Merged
jon merged 17 commits from 6896-EndOrderMigration into dev 2024-06-20 12:31:45 +00:00
4 changed files with 42 additions and 32 deletions
Showing only changes of commit 3023280108 - Show all commits

View File

@ -3,4 +3,11 @@ import qFormMixin from './qformMixin';
export default boot(({ app }) => {
jon marked this conversation as resolved
Review

eliminar
Ya no sirve

eliminar Ya no sirve
app.mixin(qFormMixin);
app.config.globalProperties.$emitEvent = function (eventName, payload) {
app._instance?.emit(eventName, payload);
};
app.config.globalProperties.$onEvent = function (eventName, callback) {
app._instance?.on(eventName, callback);
};
});

View File

@ -1,5 +1,5 @@
<script setup>
import { ref, computed } from 'vue';
import { ref, computed, onMounted } from 'vue';
import { useSession } from 'src/composables/useSession';
jon marked this conversation as resolved
Review

Lo ideal de este componente seria montar la url en este componente pasandole la coleccion(user/Images, etc), el tamaño(200x200, 50x50, etc), el id.
Así podemos reemplazar QImg y la propiedad src por VnImg y las props de antes

Lo ideal de este componente seria montar la url en este componente pasandole la coleccion(user/Images, etc), el tamaño(200x200, 50x50, etc), el id. Así podemos reemplazar QImg y la propiedad src por VnImg y las props de antes
const $props = defineProps({
jon marked this conversation as resolved
Review

Esta prop no se usa para nada, no?

Esta prop no se usa para nada, no?
@ -23,42 +23,38 @@ const $props = defineProps({
});
const show = ref(false);
const token = useSession().getTokenMultimedia();
const timeStamp = `timestamp=${Date.now()}`;
const timeStamp = ref(`timestamp=${Date.now()}`);
const url = computed(
() =>
`/api/${$props.collection}/catalog/${$props.size}/${$props.id}/download?access_token=${token}&${timeStamp}`
`/api/${$props.collection}/catalog/${$props.size}/${$props.id}/download?access_token=${token}&${timeStamp.value}`
);
const emits = defineEmits(['refresh']);
const reload = (emit = false) => {
timeStamp.value = `timestamp=${Date.now()}`;
};
defineExpose({
reload,
});
onMounted(() => {});
</script>
<template>
<QImg
:src="url"
class="img"
v-bind="$attrs"
@click="show = !show"
spinner-color="primary"
:ratio="1"
/>
<QImg :src="url" v-bind="$attrs" @click="show = !show" spinner-color="primary" />
<QDialog v-model="show" v-if="$props.zoomSize">
<QImg
:src="url"
class="img_zoom"
v-bind="$attrs"
spinner-color="primary"
:ratio="1"
style="border-radius: 0%"
/>
<QImg :src="url" class="img_zoom" v-bind="$attrs" spinner-color="primary" />
</QDialog>
jsegarra marked this conversation as resolved
Review

La acción es de zoom, así que pondría zoom-in

La acción es de zoom, así que pondría zoom-in
</template>
<style lang="scss" scoped>
.img {
.q-img {
jon marked this conversation as resolved Outdated

Aquí es donde modificando el valor, consigues mas o menos zoom

Aquí es donde modificando el valor, consigues mas o menos zoom

Te diria de mirarte la propiedad v-bind ya que puedes vincular propiedades al apartado de style

Te diria de mirarte la propiedad v-bind ya que puedes vincular propiedades al apartado de style
Te paso un ejemplo https://play.vuejs.org/#eNp9ks1u2zAQhF9lyx6UBInVoD25ioHWCNAWRVvUBXrhhaHWMmOKJPjj2BD07llScRIgQXTS7oyW36w4sC/OzXYJ2Zw1QXrlIgSMyS24Ub2zPsIAHtcwwtrbHiqyVtxwI60JEfrQwVXWT6pvqLWF/9br9l11ejRIq60/Wt5/KE91+hnqGpZFanEtko6wEzohN009QdDxVETsnRYRqQJoNpcgtQjhirM7L5xDz9liGArEODb15nLyKeMSDbzobYuazIWBM6hJbupnM5sQDxohSOuwpXr2MBaGPOdGyG3nbTLtRZkwp5E3yrQnpcoZzuCnMtuHjJQQPRqJEC3EDb74HparFThPZ/l4ILuQUe1QH+Cs5mYs0TPOgp2zSEhmrbrZbbCG/kzhyUF6pzT63y4q2i5n84k0a4K2f/ej9KJPeH7syw3K7Sv927DPPc7+eAzod8jZoxaF7zBO8vXqF+7p/VGkrSZN7jfEvxisTplxsn2lHRD2M1+h/V7ulzLdv3C9j2jCMVQGzc6x+DmjO7d8I/oT7sfZp/Id7ZON92vW9Yo=
cursor: zoom-in;
}
.rounded {
border-radius: 50%;
}
.img_zoom {
width: 72%;
width: 100%;
height: auto;
border-radius: 0%;
}
</style>

View File

@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n';
import EditPictureForm from 'components/EditPictureForm.vue';
import VnImg from 'src/components/ui/VnImg.vue';
import { useSession } from 'src/composables/useSession';
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,14 +54,17 @@ const getWarehouseName = async (warehouseFk) => {
};
onMounted(async () => {
getItemAvatar();
getItemConfigs();
});
const handlePhotoUpdated = (evt = false) => {
image.value.reload(evt);
};
</script>
<template>
<div class="relative-position">
<VnImg :id="$props.entityId">
<VnImg ref="image" :id="$props.entityId" @refresh="handlePhotoUpdated(true)">
<template #error>
<div class="absolute-full picture text-center q-pa-md flex flex-center">
<div>
@ -97,7 +92,7 @@ onMounted(async () => {
collection="catalog"
:id="entityId"
@close-form="toggleEditPictureForm()"
@on-photo-uploaded="getItemAvatar()"
@on-photo-uploaded="handlePhotoUpdated"
/>
</QDialog>
</QBtn>

View File

@ -0,0 +1,12 @@
import { defineStore } from 'pinia';
jon marked this conversation as resolved Outdated

Eliminar fichero ya que no se está usando

Eliminar fichero ya que no se está usando
export const useImagesStore = defineStore('imagesStore', {
state: () => ({
images: {},
}),
actions: {
async pushImage(url, data) {
this.images[url] = data;
},
},
});