070a483fc1c06cb029611e70ea6ce5d2f690c035
[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   ngOnInit() {
22       this.getNsiDetail()
23   }
24     getNsiDetail() {
25         this.myhttp.getSlicingNsiDetail(this.nsiId).subscribe(res => {
26             const {result_header: {result_code}, result_body: {hosted_business_list,included_nssi_list} } = res;
27             if (+result_code === 200) {
28                 this.businessList = hosted_business_list;
29                 this.nssiList = included_nssi_list;
30             }
31         })
32     }
33     showBusinessDetail(data){
34         this.modalService.create({
35             nzContent:SlicingBusinessModelComponent,
36             nzTitle:"Detail",
37             nzWidth:"70%",
38             nzOkText: null,
39             nzCancelText: null,
40             nzComponentParams:{
41                 businessId:data.service_instance_id
42             }
43         });
44     }
45     showNssiDetail(data){
46         this.modalService.create({
47             nzContent:NssiModelComponent,
48             nzTitle:"Detail",
49             nzWidth:"70%",
50             nzOkText: null,
51             nzCancelText: null,
52             nzComponentParams:{
53                 nssiId:data.service_instance_id
54             }
55         });
56     }
57 }