forked from verdnatura/salix-front
add image to the worker descriptor
This commit is contained in:
parent
f5f47f4994
commit
cd5bd180af
|
@ -2,6 +2,7 @@
|
||||||
import { onMounted, computed, ref } from 'vue';
|
import { onMounted, computed, ref } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useSession } from 'src/composables/useSession';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
|
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
|
||||||
|
|
||||||
|
@ -18,8 +19,8 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
const { getToken } = useSession();
|
||||||
|
|
||||||
const entityId = computed(() => {
|
const entityId = computed(() => {
|
||||||
return $props.id || route.params.id;
|
return $props.id || route.params.id;
|
||||||
|
@ -67,13 +68,14 @@ function sipExtension() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWorkerAvatar() {
|
function getWorkerAvatar() {
|
||||||
return `/api/Images/user/160x160/${worker.value.user.id}/download`;
|
const token = getToken();
|
||||||
|
return `/api/Images/user/160x160/${worker.value.user.id}/download?access_token=${token}`;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<card-descriptor v-if="worker" module="Worker" :data="worker" :description="worker.user.nickname">
|
<card-descriptor v-if="worker" module="Worker" :data="worker" :description="worker.user.nickname">
|
||||||
<template #body>
|
<template #body>
|
||||||
<q-img :src="getWorkerAvatar()" class="q-mb-md" style="width: 100px; height: 100px" />
|
<q-img :src="getWorkerAvatar()" class="q-mb-md" />
|
||||||
<q-list>
|
<q-list>
|
||||||
<q-item>
|
<q-item>
|
||||||
<q-item-section side>
|
<q-item-section side>
|
||||||
|
|
Loading…
Reference in New Issue