From 83810e924f6eb18bb7a0771da25c7649026bd255 Mon Sep 17 00:00:00 2001 From: zhen1234 Date: Thu, 13 Jun 2024 11:45:49 +0800 Subject: addexport Issue-ID: USECASEUI-837 Signed-off-by: zhen1234 Change-Id: Ib550bd47b32cddd08d99859aabfae2c8ec5f6264 --- .../intent-instance/intent-instance.component.html | 10 ++++ .../intent-instance/intent-instance.component.less | 9 +++- .../intent-instance/intent-instance.component.ts | 60 +++++++++++++++------- 3 files changed, 59 insertions(+), 20 deletions(-) (limited to 'usecaseui-portal') diff --git a/usecaseui-portal/src/app/views/services/intent-based-services/intent-instance/intent-instance.component.html b/usecaseui-portal/src/app/views/services/intent-based-services/intent-instance/intent-instance.component.html index ee71be03..4509730a 100644 --- a/usecaseui-portal/src/app/views/services/intent-based-services/intent-instance/intent-instance.component.html +++ b/usecaseui-portal/src/app/views/services/intent-based-services/intent-instance/intent-instance.component.html @@ -1,4 +1,14 @@
+
+ +
{ - const { code, message, data:{ totalRecords, list } } = response; + const { code, message, data: { totalRecords, list } } = response; if (code !== 200) { this.nzMessage.error(message); - return; + return; } - + this.total = totalRecords; this.listOfData = list; }, (err) => { @@ -65,7 +68,7 @@ export class IntentInstanceComponent implements OnInit { const { code, message, data } = response; if (code !== 200) { this.nzMessage.error(message); - return; + return; } this.nzMessage.success(data); this.resetParam2Query(); @@ -79,7 +82,7 @@ export class IntentInstanceComponent implements OnInit { const { code, message } = response; if (code !== 200) { this.nzMessage.error(message); - return; + return; } this.nzMessage.success('Delete IntentionInstance Success'); this.resetParam2Query(); @@ -87,7 +90,26 @@ export class IntentInstanceComponent implements OnInit { console.log(err); }); } - + params: Object = { + intentId: '', + startDate: '', + endData: '' + }; + exportData() { + this.http.post('/api/usecaseui-server/v1/intent/exportIntentContent', {}, { responseType: 'blob' }) + .subscribe((data) => { + const link = document.createElement('a'); + link.href = window.URL.createObjectURL(data); + link.setAttribute('download', 'excelData'); + link.click(); + }, (error) => { + console.error('export failed:', error); + Swal.fire({ + icon: 'error', + title: 'export failed', + }); + }); + } resetParam2Query() { this.pageIndex = 1; this.pageSize = 10; -- cgit 1.2.3-korg