0
0
Fork 0

downloadFile

This commit is contained in:
Javier Segarra 2024-05-22 15:42:14 +02:00
parent 81e5bfd93c
commit 6ff5c73a78
2 changed files with 18 additions and 7 deletions

View File

@ -4,8 +4,15 @@ import { getUrl } from './getUrl';
const { getTokenMultimedia } = useSession();
const token = getTokenMultimedia();
export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) {
let appUrl = await getUrl('', 'lilium');
export async function downloadFile(
id,
model = 'dms',
urlPath = '/downloadFile',
url,
route = '',
app = 'lilium'
) {
let appUrl = await getUrl(route, app);
appUrl = appUrl.replace('/#/', '');
window.open(url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`);
}

View File

@ -18,8 +18,7 @@ const { t } = useI18n();
const { notify } = useNotify();
const paginate = ref();
const downloadDocuware = ref(true);
const sendToTablet = ref(true);
const isDocuware = ref(false);
const dialog = ref();
const route = useRoute();
const { openConfirmationModal } = useVnConfirm();
@ -72,6 +71,11 @@ const handleDownloadDocuware = async (deviceProductionFk) => {};
@on-fetch="(data) => (deviceProductions = data)"
auto-load
/>
<FetchData
:url="`docuwares/checkFile`"
@on-fetch="(data) => (deviceProductions = data)"
auto-load
/>
<VnPaginate
ref="paginate"
data-key="WorkerPda"
@ -145,7 +149,7 @@ const handleDownloadDocuware = async (deviceProductionFk) => {};
</QTooltip>
</QIcon>
<QIcon
v-if="downloadDocuware"
v-if="isDocuware"
name="cloud_download"
size="sm"
class="cursor-pointer"
@ -157,7 +161,7 @@ const handleDownloadDocuware = async (deviceProductionFk) => {};
</QTooltip>
</QIcon>
<QIcon
v-if="downloadDocuware"
v-if="isDocuware"
name="refresh"
size="sm"
class="cursor-pointer"
@ -169,7 +173,7 @@ const handleDownloadDocuware = async (deviceProductionFk) => {};
</QTooltip>
</QIcon>
<QIcon
v-if="sendToTablet"
v-if="!isDocuware"
name="vn:client"
size="sm"
class="cursor-pointer"