osl-base-extended 14.7.1 → 14.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -635,7 +635,7 @@ class Httpbase {
|
|
|
635
635
|
return this.handleError(error);
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
|
-
async download(methodName, fileName, params) {
|
|
638
|
+
async download(methodName, fileName, params, isDownload = true) {
|
|
639
639
|
try {
|
|
640
640
|
const res = await firstValueFrom(this.http
|
|
641
641
|
.get(this.getEndPoint(methodName), {
|
|
@@ -645,14 +645,16 @@ class Httpbase {
|
|
|
645
645
|
responseType: 'blob',
|
|
646
646
|
})
|
|
647
647
|
.pipe(timeout(60000)));
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
648
|
+
if (isDownload) {
|
|
649
|
+
const blob = res.body;
|
|
650
|
+
const url = URL.createObjectURL(blob);
|
|
651
|
+
const anchor = document.createElement('a');
|
|
652
|
+
anchor.href = url;
|
|
653
|
+
anchor.download = fileName;
|
|
654
|
+
anchor.click();
|
|
655
|
+
URL.revokeObjectURL(url);
|
|
656
|
+
}
|
|
657
|
+
return this.handleSuccess(res.status, res.body, res.headers);
|
|
656
658
|
}
|
|
657
659
|
catch (error) {
|
|
658
660
|
// responseType:'blob' causes Angular to wrap the error body as a Blob too,
|
|
@@ -4324,7 +4326,7 @@ class OslSetup {
|
|
|
4324
4326
|
async openAddDialog() {
|
|
4325
4327
|
this.dialogMode = 'add';
|
|
4326
4328
|
if (this.beforeDisplay) {
|
|
4327
|
-
this.dialogModel = await this.beforeDisplay(
|
|
4329
|
+
this.dialogModel = await this.beforeDisplay({});
|
|
4328
4330
|
}
|
|
4329
4331
|
else {
|
|
4330
4332
|
this.dialogModel = {};
|