diff options
author | 2024-11-29 17:32:22 +0800 | |
---|---|---|
committer | 2024-11-29 17:32:27 +0800 | |
commit | e5de10348e38a4cac9f70da856ab7c6941bfc347 (patch) | |
tree | 4aa7bc3808b54653f4a8f068a1903094b38d574b /usecaseui-portal/src/app/views/maas/build/application-management.component.ts | |
parent | 35d38716bfb367497f563bc4081109f6053c43af (diff) |
add maas knowledge base, Knowledge Assistant, application and update link
Issue-ID: USECASEUI-844
Change-Id: I1dc2b4bc12f364d017b24b2752acfef63e27ad94
Signed-off-by: kaixiliu <liukaixi@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/views/maas/build/application-management.component.ts')
-rw-r--r-- | usecaseui-portal/src/app/views/maas/build/application-management.component.ts | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/usecaseui-portal/src/app/views/maas/build/application-management.component.ts b/usecaseui-portal/src/app/views/maas/build/application-management.component.ts new file mode 100644 index 00000000..bc684cc9 --- /dev/null +++ b/usecaseui-portal/src/app/views/maas/build/application-management.component.ts @@ -0,0 +1,90 @@ +import { Component, OnInit } from '@angular/core'; +import { IntentManagementService } from '../../../core/services/intentManagement.service' +import {NzMessageService} from "ng-zorro-antd"; +import { Router } from '@angular/router'; + +@Component({ + selector: 'app-application-management', + templateUrl: './application-management.component.html', + styleUrls: ['./application-management.component.less'] +}) +export class ApplicationManagementComponent implements OnInit { + + constructor( + private myhttp: IntentManagementService, + private message: NzMessageService, + private router: Router + ) { } + + ngOnInit() { + this.getAllApplicationData() + } + + listOfData: any[] = []; + + intentModuleShow: boolean = false; + applicationShow: boolean = false; + editIntentTableList: Object={}; + currentIndex: number=-1; + getAllApplicationData():void{ + this.myhttp.getAllApplication() + .subscribe( + (data) => { + this.listOfData=data.result_body + }, + (err) => { + this.message.error('Failed to obtain application data'); + } + ) + } + + inputIntentModuleShow(): void { + this.intentModuleShow = true; + } + inputIntentModuleClose($event: any): void { + this.intentModuleShow = false; + + if ($event.cancel) { + return; + } + this.getAllApplicationData() + } + editIntentList(): void { + this.intentModuleShow = true + } + deleteIntentList(data): void{ + this.myhttp.deleteApplicationById(data.applicationId).subscribe((data) => { + this.getAllApplicationData() + if(data.result_header.result_code===200){ + this.message.success('Deleted successfully'); + }else{ + this.message.error(data.result_header.result_message); + } + }, (err) => { + this.message.error('Deletion failed'); + }); + } + + navigateToDetail(data):void { + this.router.navigate(['maas/use'], { queryParams: { id: data.applicationId, name: data.applicationName } }); + } + + applicationDetailClose(): void { + this.applicationShow = false; + } + + applicationDetail: Object={}; + displayApplicationDetails(data): void { + this.applicationShow = true; + this.myhttp.getApplicationById(data.applicationId) + .subscribe( + (data) => { + this.applicationDetail=data.result_body; + console.log(data.result_body); + }, + (err) => { + this.message.error('Failed to obtain knowledge base data'); + } + ) + } +}
\ No newline at end of file |