diff --git a/src/components/common/VnDmsList.vue b/src/components/common/VnDmsList.vue index 08c4e4aa4..c0e8ac43b 100644 --- a/src/components/common/VnDmsList.vue +++ b/src/components/common/VnDmsList.vue @@ -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', }), }, diff --git a/src/components/ui/VnImg.vue b/src/components/ui/VnImg.vue index 2e690ffe1..19ac8ce7f 100644 --- a/src/components/ui/VnImg.vue +++ b/src/components/ui/VnImg.vue @@ -12,10 +12,12 @@ const $props = defineProps({ collection: { type: String, default: 'catalog', + required: false, }, 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 = () => {