alter document download to use dmslib and new terminateWithFileOutput funtion of FHCAPI_Controller, render download button as link

This commit is contained in:
Harald Bamberger
2025-05-28 16:38:26 +02:00
parent 4d3d06e1d6
commit 8bcf01d1bb
3 changed files with 41 additions and 33 deletions
@@ -101,13 +101,13 @@ export default {
container.className = "d-flex gap-2";
if(cell.getData().vorhanden){
let button = document.createElement('button');
let button = document.createElement('a');
button.className = 'btn btn-outline-secondary btn-action';
button.innerHTML = '<i class="fa fa-download"></i>';
button.title = this.$p.t('ui', 'downloadDok');
button.addEventListener('click', (event) =>
this.actionDownloadFile(cell.getData().akte_id)
);
button.href = this.actionDownloadFile(cell.getData().akte_id);
button.role = 'button';
button.target = '_blank';
container.append(button);
button = document.createElement('button');
@@ -205,11 +205,10 @@ export default {
},
methods: {
actionDownloadFile(akte_id){
window.open(
FHC_JS_DATA_STORAGE_OBJECT.app_root
+ FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/api/frontend/v1/stv/dokumente/download?akte_id=' + encodeURIComponent(akte_id),
'_blank'
);
return FHC_JS_DATA_STORAGE_OBJECT.app_root
+ FHC_JS_DATA_STORAGE_OBJECT.ci_router
+ '/api/frontend/v1/stv/dokumente/download?akte_id='
+ encodeURIComponent(akte_id);
},
actionUploadFile(dokument_kurzbz){
this.$refs.modalUpload.open(this.prestudent_id, dokument_kurzbz);
@@ -118,13 +118,13 @@ export default {
container.className = "d-flex gap-2";
if(cell.getData().akte_id){
let button = document.createElement('button');
let button = document.createElement('a');
button.className = 'btn btn-outline-secondary btn-action';
button.innerHTML = '<i class="fa fa-download"></i>';
button.title = this.$p.t('ui', 'downloadDok');
button.addEventListener('click', (event) =>
this.actionDownloadFile(cell.getData().akte_id)
);
button.href = this.actionDownloadFile(cell.getData().akte_id);
button.role = 'button';
button.target = '_blank';
container.append(button);
button = document.createElement('button');
@@ -213,11 +213,10 @@ export default {
},
methods: {
actionDownloadFile(akte_id){
window.open(
FHC_JS_DATA_STORAGE_OBJECT.app_root
+ FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/api/frontend/v1/stv/dokumente/download?akte_id=' + encodeURIComponent(akte_id),
'_blank'
);
return FHC_JS_DATA_STORAGE_OBJECT.app_root
+ FHC_JS_DATA_STORAGE_OBJECT.ci_router
+ '/api/frontend/v1/stv/dokumente/download?akte_id='
+ encodeURIComponent(akte_id);
},
actionUploadFile(dokument_kurzbz){
this.$refs.modalUpload.open(this.prestudent_id, dokument_kurzbz);