diff options
author | zoulingli128 <zll_1208@126.com> | 2022-09-08 15:32:27 +0800 |
---|---|---|
committer | zoulingli128 <zll_1208@126.com> | 2022-09-08 15:32:27 +0800 |
commit | 7bdeb7cc89a8d60e4c3199f1922a6bf73a9d83c1 (patch) | |
tree | bfa45c3c2e02f3f07d760065654d5c3af7ae52c2 /usecaseui-portal/src/app/views/intent-management/intent-management.component.ts | |
parent | a6d5ef22e8874a33fbee58ec6813be4299b04d67 (diff) |
Intent analysis frontend
Issue-ID: USECASEUI-711
Signed-off-by: zoulingli128 <zll_1208@126.com>
Change-Id: I8f8636f6b47c5ba25e6f342c484fd8ffb5ed1d6d
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.ts | 60 |
1 files changed, 60 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 new file mode 100644 index 00000000..acd37ec9 --- /dev/null +++ b/usecaseui-portal/src/app/views/intent-management/intent-management.component.ts @@ -0,0 +1,60 @@ +import { Component, OnInit } from '@angular/core'; +import { IntentManagementService } from '../../core/services/intentManagement.service' + +@Component({ + selector: 'app-intent-management', + templateUrl: './intent-management.component.html', + styleUrls: ['./intent-management.component.less'] +}) +export class IntentManagementComponent implements OnInit { + + constructor(private myhttp: IntentManagementService) { } + + ngOnInit() { + this.getIntentManagementData() + } + + listOfData: any[] = []; + intentModuleShow: boolean = false; + editIntentTableList: Object={}; + currentIndex: number=-1; + + getIntentManagementData():void{ + this.myhttp.getIntentManagementData() + .subscribe( + (data) => { + this.listOfData=data + }, + (err) => { + console.error(err); + } + ) + } + inputIntentModuleShow(): void { + this.intentModuleShow = true; + } + inputIntentModuleClose($event: any): void { + this.intentModuleShow = false; + this.editIntentTableList={} + if ($event.cancel) { + return; + } + if(this.currentIndex>-1){ + this.listOfData[this.currentIndex]=$event.param + this.currentIndex=-1 + } + this.getIntentManagementData() + } + editIntentList(data,i): void { + this.editIntentTableList=JSON.parse(JSON.stringify(data)) + this.currentIndex=i + this.intentModuleShow = true + } + deleteIntentList(data): void{ + this.myhttp.deleteIntentManagementData(data.intentId).subscribe((data) => { + this.getIntentManagementData() + }, (err) => { + console.log(err); + }); + } +}
\ No newline at end of file |