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