#7283 finish item card sections #588
|
@ -77,7 +77,7 @@ const pinnedModulesRef = ref();
|
|||
:worker-id="user.id"
|
||||
:title="user.name"
|
||||
size="lg"
|
||||
:color="false"
|
||||
color="transparent"
|
||||
/>
|
||||
<QTooltip bottom>
|
||||
{{ t('globals.userPanel') }}
|
||||
|
|
|
@ -157,7 +157,7 @@ const isEmployee = computed(() => useRole().isEmployee());
|
|||
:worker-id="user.id"
|
||||
:title="user.name"
|
||||
size="80px"
|
||||
|
||||
:color="false"
|
||||
color="transparent"
|
||||
/>
|
||||
<div class="text-subtitle1 q-mt-md">
|
||||
<strong>{{ user.nickname }}</strong>
|
||||
|
|
|
@ -31,7 +31,7 @@ const dialog = ref(null);
|
|||
<div class="container order-catalog-item overflow-hidden">
|
||||
<QCard class="card shadow-6">
|
||||
<div class="img-wrapper">
|
||||
<VnImg :id="item.id" zoom-size="lg" class="image" />
|
||||
<VnImg :id="item.id" class="image" />
|
||||
jorgep
commented
Ese lg no hacía nada. Ese lg no hacía nada.
|
||||
<div v-if="item.hex && isCatalog" class="item-color-container">
|
||||
<div
|
||||
class="item-color"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useSession } from 'src/composables/useSession';
|
||||
import { useColor } from 'src/composables/useColor';
|
||||
|
@ -7,39 +7,39 @@ import { useColor } from 'src/composables/useColor';
|
|||
const $props = defineProps({
|
||||
workerId: { type: Number, required: true },
|
||||
description: { type: String, default: null },
|
||||
size: { type: String, default: null },
|
||||
title: { type: String, default: null },
|
||||
color: { type: Boolean, default: true },
|
||||
title: { type: [String, Boolean], default: null },
|
||||
jorgep marked this conversation as resolved
Outdated
jorgep
commented
No siempre se quiere poner un title, ej. cuando hay un desplegable. No siempre se quiere poner un title, ej. cuando hay un desplegable.
jgallego
commented
se puede directamente no definir la propiedad? así no es necesario el boolean? se puede directamente no definir la propiedad? así no es necesario el boolean?
|
||||
color: { type: String, default: null },
|
||||
jorgep
commented
Habilita Habilita
|
||||
});
|
||||
const { getTokenMultimedia } = useSession();
|
||||
const token = getTokenMultimedia();
|
||||
const { t } = useI18n();
|
||||
|
||||
const title = computed(() => $props.title ?? t('globals.system'));
|
||||
const src = computed(
|
||||
() => `/api/Images/user/160x160/${$props.workerId}/download?access_token=${token}`
|
||||
);
|
||||
const title = computed(() =>
|
||||
$props.title !== false ? $props.title || t('globals.system') : false
|
||||
);
|
||||
const showLetter = ref(false);
|
||||
|
||||
watch(src, () => (showLetter.value = false));
|
||||
</script>
|
||||
<template>
|
||||
<div class="avatar-picture column items-center">
|
||||
<div class="column items-center">
|
||||
<QAvatar
|
||||
:style="{
|
||||
backgroundColor: color ? useColor(title) : 'transparent',
|
||||
backgroundColor: color ? color : useColor(title),
|
||||
}"
|
||||
:size="$props.size"
|
||||
:title="title"
|
||||
v-bind="$attrs"
|
||||
:title="title !== false ? title : undefined"
|
||||
>
|
||||
<template v-if="showLetter">{{ title.charAt(0) }}</template>
|
||||
<QImg
|
||||
v-else
|
||||
:src="`/api/Images/user/160x160/${$props.workerId}/download?access_token=${token}`"
|
||||
spinner-color="white"
|
||||
@error="showLetter = true"
|
||||
/>
|
||||
<template v-if="showLetter && title !== false">
|
||||
{{ title.charAt(0) }}
|
||||
</template>
|
||||
<QImg v-else :src="src" spinner-color="white" @error="showLetter = true" />
|
||||
</QAvatar>
|
||||
<div class="description">
|
||||
<slot name="description" v-if="$props.description">
|
||||
<p>
|
||||
{{ $props.description }}
|
||||
</p>
|
||||
<slot name="description" v-if="description">
|
||||
<p v-text="description" />
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -13,13 +13,17 @@ const $props = defineProps({
|
|||
type: String,
|
||||
default: 'catalog',
|
||||
},
|
||||
size: {
|
||||
resolution: {
|
||||
jorgep
commented
Realmente no se le estaba indicando el tamaño, solo la resolución Realmente no se le estaba indicando el tamaño, solo la resolución
|
||||
type: String,
|
||||
default: '200x200',
|
||||
},
|
||||
zoomSize: {
|
||||
zoomResolution: {
|
||||
type: String,
|
||||
default: '520x520',
|
||||
default: null,
|
||||
},
|
||||
zoom: {
|
||||
jorgep
commented
No siempre se quiere hacer zoom, ej. contador de carros. No siempre se quiere hacer zoom, ej. contador de carros.
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
id: {
|
||||
type: Number,
|
||||
|
@ -29,13 +33,14 @@ const $props = defineProps({
|
|||
const show = ref(false);
|
||||
const token = useSession().getTokenMultimedia();
|
||||
const timeStamp = ref(`timestamp=${Date.now()}`);
|
||||
|
||||
const isEmployee = useRole().isEmployee();
|
||||
|
||||
const getUrl = (zoom = false) => {
|
||||
const size = zoom ? $props.zoomSize : $props.size;
|
||||
const curResolution = zoom
|
||||
? $props.zoomResolution || $props.resolution
|
||||
: $props.resolution;
|
||||
return isEmployee
|
||||
? `/api/${$props.storage}/${$props.collection}/${size}/${$props.id}/download?access_token=${token}&${timeStamp.value}`
|
||||
? `/api/${$props.storage}/${$props.collection}/${curResolution}/${$props.id}/download?access_token=${token}&${timeStamp.value}`
|
||||
: noImage;
|
||||
};
|
||||
const reload = () => {
|
||||
|
@ -47,21 +52,31 @@ defineExpose({
|
|||
</script>
|
||||
<template>
|
||||
<QImg
|
||||
:class="{ zoomIn: $props.zoomSize }"
|
||||
:class="{ zoomIn: zoom }"
|
||||
:src="getUrl()"
|
||||
v-bind="$attrs"
|
||||
@click="show = !show"
|
||||
@click.stop="show = $props.zoom ? true : false"
|
||||
spinner-color="primary"
|
||||
/>
|
||||
<QDialog v-model="show" v-if="$props.zoomSize">
|
||||
<QImg :src="getUrl(true)" size="full" v-bind="$attrs" spinner-color="primary" />
|
||||
<QDialog v-if="$props.zoom" v-model="show">
|
||||
<QImg
|
||||
:src="getUrl(true)"
|
||||
v-bind="$attrs"
|
||||
spinner-color="primary"
|
||||
class="img_zoom"
|
||||
/>
|
||||
</QDialog>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.q-img {
|
||||
&.zoomIn {
|
||||
cursor: zoom-in;
|
||||
}
|
||||
}
|
||||
.rounded {
|
||||
border-radius: 50%;
|
||||
}
|
||||
.img_zoom {
|
||||
border-radius: 0%;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -54,7 +54,7 @@ const hasAccount = ref(false);
|
|||
</template>
|
||||
<template #before>
|
||||
<!-- falla id :id="entityId.value" collection="user" size="160x160" -->
|
||||
<VnImg :id="entityId" collection="user" size="160x160" class="photo">
|
||||
<VnImg :id="entityId" collection="user" resolution="160x160" class="photo">
|
||||
<template #error>
|
||||
<div
|
||||
class="absolute-full picture text-center q-pa-md flex flex-center"
|
||||
|
|
|
@ -10,13 +10,10 @@ import VnInput from 'src/components/common/VnInput.vue';
|
|||
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||
|
||||
import axios from 'axios';
|
||||
// import { useSession } from 'src/composables/useSession';
|
||||
import VnImg from 'src/components/ui/VnImg.vue';
|
||||
import VnAvatar from 'src/components/ui/VnAvatar.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
// const { getTokenMultimedia } = useSession();
|
||||
// const token = getTokenMultimedia();
|
||||
|
||||
const claimStates = ref([]);
|
||||
const claimStatesCopy = ref([]);
|
||||
|
@ -94,15 +91,12 @@ const statesFilter = {
|
|||
:rules="validate('claim.claimStateFk')"
|
||||
>
|
||||
<template #before>
|
||||
<QAvatar color="orange">
|
||||
<VnImg
|
||||
v-if="data.workerFk"
|
||||
:size="'160x160'"
|
||||
:id="data.workerFk"
|
||||
collection="user"
|
||||
spinner-color="white"
|
||||
/>
|
||||
</QAvatar>
|
||||
<VnAvatar
|
||||
:worker-id="data.workerFk"
|
||||
size="160x160"
|
||||
:title="false"
|
||||
color="orange"
|
||||
/>
|
||||
</template>
|
||||
</VnSelect>
|
||||
<QSelect
|
||||
|
|
|
@ -7,8 +7,8 @@ import FetchData from 'components/FetchData.vue';
|
|||
import FormModel from 'components/FormModel.vue';
|
||||
import VnRow from 'components/ui/VnRow.vue';
|
||||
import VnInput from 'src/components/common/VnInput.vue';
|
||||
import VnImg from 'src/components/ui/VnImg.vue';
|
||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||
import VnAvatar from 'src/components/ui/VnAvatar.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const { t } = useI18n();
|
||||
|
@ -97,14 +97,11 @@ const contactChannels = ref([]);
|
|||
:use-like="false"
|
||||
>
|
||||
<template #prepend>
|
||||
<QAvatar color="orange">
|
||||
<VnImg
|
||||
v-if="data.salesPersonFk"
|
||||
:id="data.salesPersonFk"
|
||||
collection="user"
|
||||
spinner-color="white"
|
||||
/>
|
||||
</QAvatar>
|
||||
<VnAvatar
|
||||
:worker-id="data.salesPersonFk"
|
||||
color="orange"
|
||||
jorgep marked this conversation as resolved
Outdated
jgallego
commented
los colores estan en quasar.variables.scss los colores estan en quasar.variables.scss
usa las variables, de paso puedes reemplazar los orange que encuentres
|
||||
:title="false"
|
||||
/>
|
||||
</template>
|
||||
</VnSelect>
|
||||
<QSelect
|
||||
|
|
|
@ -64,12 +64,7 @@ const handlePhotoUpdated = (evt = false) => {
|
|||
|
||||
<template>
|
||||
<div class="relative-position">
|
||||
<VnImg
|
||||
ref="image"
|
||||
:id="$props.entityId"
|
||||
@refresh="handlePhotoUpdated(true)"
|
||||
zoom-size="1600x900"
|
||||
>
|
||||
<VnImg ref="image" :id="$props.entityId" zoom-resolution="1600x900">
|
||||
<template #error>
|
||||
<div class="absolute-full picture text-center q-pa-md flex flex-center">
|
||||
<div>
|
||||
|
|
|
@ -64,7 +64,12 @@ function confirm() {
|
|||
<QList class="row q-mx-auto q-mt-xl">
|
||||
<QItem v-for="(props, name) in counters" :key="name" class="col-6">
|
||||
<QItemSection>
|
||||
<VnImg :id="props.id" width="130px" @click="handleEvent(name, 'add')" />
|
||||
<VnImg
|
||||
jorgep
commented
si haces click para sumar 1 también te hace zoom. No tenía sentido. si haces click para sumar 1 también te hace zoom. No tenía sentido.
|
||||
:id="props.id"
|
||||
width="130px"
|
||||
@click="handleEvent(name, 'add')"
|
||||
:zoom="false"
|
||||
/>
|
||||
<p class="title">{{ props.title }}</p>
|
||||
</QItemSection>
|
||||
<QItemSection class="q-ma-none">
|
||||
|
|
|
@ -147,7 +147,7 @@ const refetch = async () => await cardDescriptorRef.value.getData();
|
|||
<VnImg
|
||||
:id="parseInt(entityId)"
|
||||
collection="user"
|
||||
size="520x520"
|
||||
resolution="520x520"
|
||||
class="photo"
|
||||
>
|
||||
<template #error>
|
||||
|
|
Loading…
Reference in New Issue
en otros sitios se usa size="md" posible usar los genericos.
Pregunta: no he encontrado donde esta en nuestro caso md a cuantos px equivale, donde se está?
No lo tenemos definido, es nativo de quasar. He probado a poner xl pero se queda muy pequeño. Creo un tamaño personalizado para q-avatar[size="xxxl"] que sea 80px?
si