f48deea6279f80948daea6a933e6d77df9302dde
[usecase-ui.git] /
1 import { Component, OnInit, Input } from '@angular/core';
2 import { NzModalService, NzMessageService } from "ng-zorro-antd";
3 import { SlicingTaskServices } from '.././../../../../../core/services/slicingTaskServices';
4 import { NsiModelComponent } from "../../nsi-management/nsi-model/nsi-model.component";
5
6 @Component({
7     selector: 'app-slicing-business-model',
8     templateUrl: './slicing-business-model.component.html',
9     styleUrls: ['./slicing-business-model.component.less']
10 })
11 export class SlicingBusinessModelComponent implements OnInit {
12
13     constructor(
14         private myhttp: SlicingTaskServices,
15         private modalService: NzModalService,
16         private message: NzMessageService
17     ) {
18     }
19
20     @Input() businessId;
21     @Input() outerData;
22     businessRequirement: any[];
23     NSTinfo: any[] = [];
24     nsiInfo: any[] = [];
25     taskModel: boolean = false;
26     isSpinning: boolean = true;
27     status: string = "";
28     businessDetailInfo : any = {}
29     rantext: string = "RAN Network Edge IP address";
30
31     isshowran: boolean = false;
32     ngOnInit() {
33         this.status = this.outerData.orchestration_status
34         console.log('status',this.status)
35         this.getDetail()
36     }
37     detailFn(flag,form){
38       this.rantext  = form =='ran'? "RAN Network Edge IP address" : "Core Network Edge IP address";
39       this.isshowran = !this.isshowran
40     }
41     getDetail() {
42         this.myhttp.getSlicingBusinessDetail(this.businessId).then(res => {
43             this.isSpinning = false;
44             const { business_demand_info, business_demand_info: { coverage_area_ta_list }, nst_info, nsi_info ,connection_link: { tn_bh_slice_task_info }} = res.result_body;
45             console.log(JSON.stringify(tn_bh_slice_task_info),11111)
46             // tn_bh_slice_task_info  = {"suggestNssiId":null,"suggestNSSIName":null,"progress":null,"status":null,"statusDescription":null,"scriptName":null,"enableNSSISelection":null,"sliceProfile":null,"lantency":null,"max_bandWidth":null,"link_type":null}
47            
48             this.businessDetailInfo = {
49                 "suggestNssiId": '',
50                 "suggestNSSIName": '11111',
51                 "progress": 'active',
52                 "status": 'active',
53                 "statusDescription": 'p2p/mp2p',
54                 "scriptName": '10.1.1.1',
55                 "enableNSSISelection": '11',
56                 "sliceProfile": '10.1.1.1',
57                 "lantency": '10.2.3.4.5',
58                 "max_bandWidth": '1111',
59                 "link_type": '333'
60               }
61             // this.businessDetailInfo = {
62             //     "anVersion":"10.2.3.4.5",
63             //       "vLanText":"11111",
64             //       "tnVersion":"10.0.1.1.1",
65             //       "mbps":"11111",
66             //       "msText":"11111",
67             //       "linkType":"p2p/mp2p",
68             //       "tnEndVersion":"10.1.1.1",
69             //       "cnVlan":"11",
70             //       "cnVersion":"1.1.2.3",
71             //       "orchestration_status":"active"
72             //   }
73             business_demand_info.area = coverage_area_ta_list.map(item => {
74                 item = item.split(';').join('-');
75                 return item
76             });
77             // area : Front-end analog data
78             let area = ["Haidian District;Beijing;Beijing", "Xicheng District;Beijing;Beijing", "Changping District;Beijing;Beijing"].map(item => {
79                 item = item.split(';').join(' - ');
80                 return item
81             });
82             this.businessRequirement = [{ ...business_demand_info, area }];
83             this.NSTinfo = [nst_info];
84             console.log('ngs',this.NSTinfo)
85             if (nsi_info.nsi_id !== null) {
86                 this.nsiInfo = [nsi_info];
87             }
88         })
89     }
90     showdetail(data) {
91         const nsiModal = this.modalService.create({
92             nzTitle: "Detail",
93             nzContent: NsiModelComponent,
94             nzWidth: "70%",
95             nzOkText: null,
96             nzCancelText: null,
97             nzComponentParams: {
98                 nsiId: data.nsi_id
99             }
100         });
101     }
102 }