569a018f5db0ed68e974c751be6c0fd1f3961b24
[usecase-ui.git] /
1 import {Component, Input, OnInit} from '@angular/core';
2 import {NzModalService} from "ng-zorro-antd";
3 import {SlicingTaskServices} from '.././../../../../../core/services/slicingTaskServices';
4 import { SlicingBusinessModelComponent } from '../../slicing-business-management/slicing-business-model/slicing-business-model.component';
5 import { NssiModelComponent } from '../../nssi-management/nssi-model/nssi-model.component';
6 @Component({
7   selector: 'app-nsi-model',
8   templateUrl: './nsi-model.component.html',
9   styleUrls: ['./nsi-model.component.less']
10 })
11 export class NsiModelComponent implements OnInit {
12
13     constructor(
14         private myhttp: SlicingTaskServices,
15         private modalService: NzModalService
16     ) {
17     }
18     @Input() nsiId;
19     businessList: any[];
20     nssiList: any[];
21     isSpinning: boolean = true;
22   ngOnInit() {
23       this.getNsiDetail()
24   }
25     getNsiDetail() {
26         this.myhttp.getSlicingNsiDetail(this.nsiId).subscribe(res => {
27             this.isSpinning = false;
28             const {result_header: {result_code}, result_body: {hosted_business_list,included_nssi_list} } = res;
29             if (+result_code === 200) {
30                 this.businessList = hosted_business_list;
31                 this.nssiList = included_nssi_list;
32             }
33         })
34     }
35     showBusinessDetail(data){
36         this.modalService.create({
37             nzContent:SlicingBusinessModelComponent,
38             nzTitle:"Detail",
39             nzWidth:"70%",
40             nzOkText: null,
41             nzCancelText: null,
42             nzComponentParams:{
43                 businessId:data.service_instance_id
44             }
45         });
46     }
47     showNssiDetail(data){
48         this.modalService.create({
49             nzContent:NssiModelComponent,
50             nzTitle:"Detail",
51             nzWidth:"70%",
52             nzOkText: null,
53             nzCancelText: null,
54             nzComponentParams:{
55                 nssiId:data.service_instance_id
56             }
57         });
58     }
59 }