This commit is contained in:
nasir@endelospay.com 2024-06-11 00:09:44 +05:00
parent 8666ea2033
commit 9699b230d5
2 changed files with 17 additions and 4 deletions

View File

@ -37,6 +37,16 @@ const downloadFile = (fileUrl) => {
link.click(); link.click();
document.body.removeChild(link); document.body.removeChild(link);
}; };
const downloadImage = async (imageUrl) => {
try {
const response = await fetch(imageUrl)
const blob = await response.blob()
const fileName = imageUrl.split('/').pop()
saveAs(blob, fileName)
} catch (error) {
console.error('Error downloading image:', error) }
}
</script> </script>
<template> <template>
@ -64,9 +74,12 @@ const downloadFile = (fileUrl) => {
<span class="app-timeline-title" v-if="p_note.note_type=='Notes'"> <span class="app-timeline-title" v-if="p_note.note_type=='Notes'">
{{p_note.note}} {{p_note.note}}
</span> </span>
<span class="app-timeline-title" v-if="p_note.note_type=='file'">
<img :src="p_note.note"/> <span class="app-timeline-title" v-if="p_note.note_type == 'file'">
</span> <img :src="p_note.note" @click="downloadImage(p_note.note)" />
<button @click="downloadImage(p_note.note)">Download Image</button>
</span>
<span class="app-timeline-meta">{{ formatDateDate(p_note.created_at) }}</span> <span class="app-timeline-meta">{{ formatDateDate(p_note.created_at) }}</span>
<!-- <span></span> --> <!-- <span></span> -->

View File

@ -160,7 +160,7 @@ const resolveUserRoleVariant = role => {
<span class="font-weight-medium"> <span class="font-weight-medium">
Availability: Availability:
</span> </span>
<span class="text-body-1">{{ props.userData.telemed.availability_from }}</span> <span class="text-body-1">{{ props.userData.telemed.availability_to }}</span> <span class="text-body-1">{{ props.userData.telemed.availability_from }}</span> to<span class="text-body-1">{{ props.userData.telemed.availability_to }}</span>
</VListItemTitle> </VListItemTitle>
</VListItem> </VListItem>