summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views/intent-management/intent-management.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'usecaseui-portal/src/app/views/intent-management/intent-management.component.ts')
-rw-r--r--usecaseui-portal/src/app/views/intent-management/intent-management.component.ts53
1 files changed, 53 insertions, 0 deletions
diff --git a/usecaseui-portal/src/app/views/intent-management/intent-management.component.ts b/usecaseui-portal/src/app/views/intent-management/intent-management.component.ts
index 758aad06..e7dbc7fd 100644
--- a/usecaseui-portal/src/app/views/intent-management/intent-management.component.ts
+++ b/usecaseui-portal/src/app/views/intent-management/intent-management.component.ts
@@ -17,9 +17,20 @@ export class IntentManagementComponent implements OnInit {
ngOnInit() {
this.getIntentManagementData()
}
+ ngOnDestroy(){
+ window.clearInterval(this.timer)
+ }
listOfData: any[] = [];
+ reportData: any[] = [];
+ intentInfo: Object={
+ intentId:'',
+ intentName:'',
+ reportTime: ''
+ };
+ timer: any;
intentModuleShow: boolean = false;
+ intentReportDetailShow: boolean = false;
editIntentTableList: Object={};
currentIndex: number=-1;
@@ -28,12 +39,28 @@ export class IntentManagementComponent implements OnInit {
.subscribe(
(data) => {
this.listOfData=data.result_body
+ this.getIntentReportData(this.listOfData)
+ this.timer=setInterval(function(){
+ this.getIntentReportData(this.listOfData)
+ },5000)
},
(err) => {
this.message.error('Failed to obtain intent data');
}
)
}
+ getIntentReportData(data): void{
+ data.forEach(item => {
+ this.myhttp.getIntentReportData(item.intentId).subscribe(
+ (data) => {
+ item.intentStatus=data.result_body.fulfillmentInfos[0].fulfillmentStatus
+ },
+ (err) => {
+ this.message.error('Failed to obtain Report data');
+ }
+ )
+ });
+ }
inputIntentModuleShow(): void {
this.intentModuleShow = true;
}
@@ -45,6 +72,32 @@ export class IntentManagementComponent implements OnInit {
}
this.getIntentManagementData()
}
+ intentReportModuleClose($event: any): void {
+ this.intentReportDetailShow = false
+ if ($event.cancel) {
+ return;
+ }
+ }
+ viewReport(data,i): void{
+ this.reportData=[]
+ this.intentInfo={
+ intentId:'',
+ intentName:'',
+ reportTime: ''
+ };
+ this.intentInfo['intentId']=data['intentId']
+ this.intentInfo['intentName']=data['intentName']
+ this.myhttp.getIntentReportData(data.intentId).subscribe(
+ (data) => {
+ this.reportData=data.result_body.fulfillmentInfos
+ this.intentInfo['reportTime']=data.result_body.reportTime
+ this.intentReportDetailShow = true
+ },
+ (err) => {
+ this.message.error('Failed to obtain Report data');
+ }
+ )
+ }
editIntentList(data,i): void {
this.editIntentTableList=JSON.parse(JSON.stringify(data))
this.currentIndex=i