a1511b18499cc7466a0f7404face67881c725d24
[usecase-ui.git] /
1 import { Component, OnInit } from '@angular/core';
2 import {BUSINESS_STATUS} from '../../../../../../../constants/constants';
3 import { NzModalService } from 'ng-zorro-antd';
4 import {SlicingTaskServices} from "../../../../../../core/services/slicingTaskServices";
5 @Component({
6   selector: 'app-nsi-table',
7   templateUrl: './nsi-table.component.html',
8   styleUrls: ['./nsi-table.component.less']
9 })
10 export class NsiTableComponent implements OnInit {
11
12     constructor(
13         private myhttp: SlicingTaskServices,
14         private modalService: NzModalService
15     ) {
16     }
17
18   ngOnInit() {
19       this.getNsiList()
20   }
21     selectedValue:string = BUSINESS_STATUS[0];
22     listOfData: any[] = [];
23     pageIndex: number = 1;
24     pageSize: number = 10;
25     total: number = 100;
26     loading = false;
27     isSelect: boolean = false;
28     statusOptions: any[] = BUSINESS_STATUS;
29
30     getNsiList (): void{
31         this.loading = true;
32         this.isSelect = false;
33         let paramsObj = {
34             pageNo: this.pageIndex,
35             pageSize: this.pageSize
36         };
37         if(this.selectedValue !== BUSINESS_STATUS[0]){
38             paramsObj["instanceStatus"] = this.selectedValue;
39             this.isSelect = true;
40         }
41         this.myhttp.getSlicingNsiList(paramsObj,this.isSelect).subscribe (res => {
42             const { result_header: { result_code }, result_body: { nsi_service_instances } } = res;
43             if (+result_code === 200) {
44                 this.total = nsi_service_instances.length;
45                 this.loading = false;
46                 this.listOfData = nsi_service_instances;
47             }
48         })
49     }
50     getListOfProcessingStatus(){
51         this.pageIndex = 1;
52         this.pageSize = 10;
53         this.getNsiList();
54     }
55     searchData(reset: boolean = false) {
56         this.getNsiList();
57     }
58     showdetail(data){
59
60     }
61 }