diff options
author | 2021-09-15 09:57:09 +0800 | |
---|---|---|
committer | 2021-09-16 07:15:07 +0000 | |
commit | c437d5360c75c1af5417c3681235a0f8015a9a85 (patch) | |
tree | 69059fede467020a0b964f08ae56a999f85ffeb2 /usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.ts | |
parent | 9c8070280f88e0094acb83ee78251bb4f9690e2e (diff) |
feat: add intent based service
Signed-off-by: liuwh7 <liuwh7@asiainfo.com>
Change-Id: If63eb5e61f01751771ad090728f33214077edd6f
Issue-ID: USECASEUI-605
Diffstat (limited to 'usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.ts')
-rw-r--r-- | usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.ts | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.ts b/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.ts new file mode 100644 index 00000000..bf046545 --- /dev/null +++ b/usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.ts @@ -0,0 +1,132 @@ +import { Component, OnInit } from "@angular/core"; +import { Router } from "@angular/router"; +import { NzMessageService } from "ng-zorro-antd"; +import { intentBaseService } from "../../../../core/services/intentBase.service"; + +@Component({ + selector: 'app-cloud-leased-line', + templateUrl: './cloud-leased-line.component.html', + styleUrls: ['./cloud-leased-line.component.less'] +}) +export class CloudLeasedLineComponent implements OnInit { + + constructor( + private router:Router, + private myHttp: intentBaseService, + private nzMessage: NzMessageService + ) {} + + ngOnChanges() {} + + ngOnInit() { + this.pageIndex = 1; + this.pageSize = 10; + this.getCloudLeasedLineList(); + } + + ngOnDestroy() {} + + statusObj: any = { + 0: 'Incomplete', + 1: 'Completed', + 2: 'Deleted', + 3: 'Inactive' + } + // 列表数据源 + listOfData: any[] = []; + // 分页信息及总数 + pageIndex: number = 1; + pageSize: number = 10; + total: number = 0; + loading = false; + // 控制弹窗展示变量 + cloudLeasedLineShowFlag: boolean = false; + smartCloudLeasedLineShowFlag: boolean = false; + // 初始化查询数据源 + getCloudLeasedLineList(): void { + this.myHttp.getInstanceList({ + currentPage: this.pageIndex, + pageSize: this.pageSize + }).subscribe((response) => { + const { code, message, data } = response; + if (code !== 200) { + this.nzMessage.error(message); + return; + } + this.total = data.totalRecords; + this.listOfData = [...data.list]; + }, (err) => { + console.log(err); + }); + } + // 分页信息变更查询数据 + searchData(): void { + this.getCloudLeasedLineList(); + } + // 解析结果传递到create弹窗 + resolveResult: any; + // 弹窗加载 + cloudLeasedLineShow(): void { + this.cloudLeasedLineShowFlag = true; + } + // 弹窗关闭 + cloudLeasedLineClose(): void { + this.cloudLeasedLineShowFlag = false; + this.pageIndex = 1; + this.pageSize = 10; + this.getCloudLeasedLineList(); + } + // smart 弹窗加载 + smartCloudLeasedLineShow(): void { + this.smartCloudLeasedLineShowFlag = true; + } + // smart 弹窗关闭 + smartCloudLeasedLineClose(data): void { + this.smartCloudLeasedLineShowFlag = false; + if (data.cancel) { + return; + } + this.cloudLeasedLineShowFlag = true; + this.resolveResult = { + name: 'test', + instanceId: '123456', + accessPointOne: { + name: 'aaa', + bandwidth: '20' + }, + cloudPointName: 'aaa', + }; + } + // 跳转监控管理页面 + goMonitorService(): void { + this.router.navigateByUrl('/fcaps/monitor_service'); + } + + activeCloudLeasedLine(row): void { + this.myHttp.activeIntentInstance({ + instanceId: row.instanceId + }).subscribe((data) => { + console.log(data); + }, (err) => { + console.log(err); + }); + } + + inactiveCloudLeasedLine(row): void { + this.myHttp.invalidIntentInstance({ + instanceId: row.instanceId + }).subscribe((data) => { + console.log(data); + }, (err) => { + console.log(err); + }); + } + + deleteCloudLeasedLine(row): void { + this.myHttp.deleteIntentInstance(row.instanceId).subscribe((data) => { + console.log(data); + }, (err) => { + console.log(err); + }); + } +}
\ No newline at end of file |