From b8d38f15e40d91663064dcfdd905215ce8de9c79 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 5 Aug 2024 17:13:15 +0200 Subject: [PATCH] fix: refs #7283 use vnAvatar & add optional zoom --- src/components/NavBar.vue | 2 +- src/components/UserPanel.vue | 2 +- src/components/ui/CatalogItem.vue | 2 +- src/components/ui/VnAvatar.vue | 42 +++++++++---------- src/components/ui/VnImg.vue | 37 +++++++++++----- src/pages/Account/Card/AccountDescriptor.vue | 2 +- src/pages/Claim/Card/ClaimBasicData.vue | 20 ++++----- src/pages/Customer/Card/CustomerBasicData.vue | 15 +++---- src/pages/Item/Card/ItemDescriptorImage.vue | 7 +--- src/pages/Wagon/WagonCounter.vue | 7 +++- src/pages/Worker/Card/WorkerDescriptor.vue | 2 +- 11 files changed, 72 insertions(+), 66 deletions(-) diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index bb64d2f35..e80a293c6 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -77,7 +77,7 @@ const pinnedModulesRef = ref(); :worker-id="user.id" :title="user.name" size="lg" - :color="false" + color="transparent" /> {{ t('globals.userPanel') }} diff --git a/src/components/UserPanel.vue b/src/components/UserPanel.vue index a0ba6bb8e..690739d75 100644 --- a/src/components/UserPanel.vue +++ b/src/components/UserPanel.vue @@ -157,7 +157,7 @@ const isEmployee = computed(() => useRole().isEmployee()); :worker-id="user.id" :title="user.name" size="80px" - :color="false" + color="transparent" />
{{ user.nickname }} diff --git a/src/components/ui/CatalogItem.vue b/src/components/ui/CatalogItem.vue index 5c5d71018..ef722483b 100644 --- a/src/components/ui/CatalogItem.vue +++ b/src/components/ui/CatalogItem.vue @@ -31,7 +31,7 @@ const dialog = ref(null);
- +
-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 }, + color: { type: String, default: null }, }); 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));