0bffccf5c2d61f2e00b3f34c296fb83e787554a5
[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     ngOnInit() {
29         console.log(this.businessId, "id",this.outerData);
30         const param = {
31             anVersion:'10.2.3.4.5',
32             vLanText:'111',
33             tnVersion:'10.0.1.1.1',
34             tnText:'TN EDGEText',
35             mbps:'333',
36             msText:'555',
37             linkType:'p2p/mp2p',
38             tnEndVersion:'10.1.1.1',
39             tnEndText:'TN EDGEText',
40             cnVlan:'66',
41             cnVersion:'1.1.2.3'
42         }
43         this.outerData = {...this.outerData,...param}
44         console.log('new',this.outerData)
45         this.status = this.outerData.orchestration_status
46         this.getDetail()
47     }
48
49     getDetail() {
50         this.myhttp.getSlicingBusinessDetail(this.businessId).then(res => {
51             this.isSpinning = false;
52             const { business_demand_info, business_demand_info: { coverage_area_ta_list }, nst_info, nsi_info } = res.result_body;
53             business_demand_info.area = coverage_area_ta_list.map(item => {
54                 item = item.split(';').join('-');
55                 return item
56             });
57             // area : Front-end analog data
58             let area = ["Haidian District;Beijing;Beijing", "Xicheng District;Beijing;Beijing", "Changping District;Beijing;Beijing"].map(item => {
59                 item = item.split(';').join(' - ');
60                 return item
61             });
62             this.businessRequirement = [{ ...business_demand_info, area }];
63             this.NSTinfo = [nst_info];
64             console.log('ngs',this.NSTinfo)
65             if (nsi_info.nsi_id !== null) {
66                 this.nsiInfo = [nsi_info];
67             }
68         })
69     }
70     showdetail(data) {
71         console.log(data, "data.nsi_id");
72         const nsiModal = this.modalService.create({
73             nzTitle: "Detail",
74             nzContent: NsiModelComponent,
75             nzWidth: "70%",
76             nzOkText: null,
77             nzCancelText: null,
78             nzComponentParams: {
79                 nsiId: data.nsi_id
80             }
81         });
82     }
83 }