forked from verdnatura/salix-front
downloadFile
This commit is contained in:
parent
81e5bfd93c
commit
6ff5c73a78
|
@ -4,8 +4,15 @@ import { getUrl } from './getUrl';
|
||||||
const { getTokenMultimedia } = useSession();
|
const { getTokenMultimedia } = useSession();
|
||||||
const token = getTokenMultimedia();
|
const token = getTokenMultimedia();
|
||||||
|
|
||||||
export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) {
|
export async function downloadFile(
|
||||||
let appUrl = await getUrl('', 'lilium');
|
id,
|
||||||
|
model = 'dms',
|
||||||
|
urlPath = '/downloadFile',
|
||||||
|
url,
|
||||||
|
route = '',
|
||||||
|
app = 'lilium'
|
||||||
|
) {
|
||||||
|
let appUrl = await getUrl(route, app);
|
||||||
appUrl = appUrl.replace('/#/', '');
|
appUrl = appUrl.replace('/#/', '');
|
||||||
window.open(url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`);
|
window.open(url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,7 @@ const { t } = useI18n();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
|
||||||
const paginate = ref();
|
const paginate = ref();
|
||||||
const downloadDocuware = ref(true);
|
const isDocuware = ref(false);
|
||||||
const sendToTablet = ref(true);
|
|
||||||
const dialog = ref();
|
const dialog = ref();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { openConfirmationModal } = useVnConfirm();
|
const { openConfirmationModal } = useVnConfirm();
|
||||||
|
@ -72,6 +71,11 @@ const handleDownloadDocuware = async (deviceProductionFk) => {};
|
||||||
@on-fetch="(data) => (deviceProductions = data)"
|
@on-fetch="(data) => (deviceProductions = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
|
<FetchData
|
||||||
|
:url="`docuwares/checkFile`"
|
||||||
|
@on-fetch="(data) => (deviceProductions = data)"
|
||||||
|
auto-load
|
||||||
|
/>
|
||||||
<VnPaginate
|
<VnPaginate
|
||||||
ref="paginate"
|
ref="paginate"
|
||||||
data-key="WorkerPda"
|
data-key="WorkerPda"
|
||||||
|
@ -145,7 +149,7 @@ const handleDownloadDocuware = async (deviceProductionFk) => {};
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="downloadDocuware"
|
v-if="isDocuware"
|
||||||
name="cloud_download"
|
name="cloud_download"
|
||||||
size="sm"
|
size="sm"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
|
@ -157,7 +161,7 @@ const handleDownloadDocuware = async (deviceProductionFk) => {};
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="downloadDocuware"
|
v-if="isDocuware"
|
||||||
name="refresh"
|
name="refresh"
|
||||||
size="sm"
|
size="sm"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
|
@ -169,7 +173,7 @@ const handleDownloadDocuware = async (deviceProductionFk) => {};
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="sendToTablet"
|
v-if="!isDocuware"
|
||||||
name="vn:client"
|
name="vn:client"
|
||||||
size="sm"
|
size="sm"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
|
|
Loading…
Reference in New Issue