#7500 added VnImg in EntryDms #565

Merged
jon merged 13 commits from 7500_ChangeEntryDms into dev 2024-09-13 06:11:33 +00:00
2 changed files with 7 additions and 16 deletions
Showing only changes of commit 76a7f8a1b3 - Show all commits

View File

@ -102,12 +102,8 @@ const columns = computed(() => [
storage: 'dms',
collection: null,
size: null,
token: prop.token,
url:
'api/dms/' +
prop.row.file.split('.')[0] +
'/downloadFile?access_token=' +
token,
id: prop.row.file.split('.')[0],
token: token,
class: 'rounded',
}),
},

View File

@ -12,10 +12,12 @@ const $props = defineProps({
collection: {
type: String,
default: 'catalog',
required: false,
Outdated
Review

No hace falta poner required false si ya tienen un default

No hace falta poner required false si ya tienen un default
},
resolution: {
type: String,
default: '200x200',
required: false,
},
zoomResolution: {
type: String,
@ -29,27 +31,20 @@ const $props = defineProps({
type: Number,
required: true,
},
url: {
type: String,
required: false,
default: null,
},
});
const show = ref(false);
const token = useSession().getTokenMultimedia();
const timeStamp = ref(`timestamp=${Date.now()}`);
if ($props.url) return $props.url;
const isEmployee = useRole().isEmployee();
const _url = [$props.storage, $props.collection, $props.size, $props.id]
.filter((prop) => prop)
.join('/');
const getUrl = (zoom = false) => {
const curResolution = zoom
? $props.zoomResolution || $props.resolution
: $props.resolution;
if ($props.storage === 'dms')
return `/api/${$props.storage}/${$props.id}/downloadFile?access_token=${token}`;
return isEmployee
? `/api/${_url}/download?access_token=${token}&${timeStamp.value}`
? `/api/${$props.storage}/${$props.collection}/${curResolution}/${$props.id}/download?access_token=${token}&${timeStamp.value}`
: noImage;
};
const reload = () => {