summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-model/slicing-business-model.component.ts
blob: f48deea6279f80948daea6a933e6d77df9302dde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import { Component, OnInit, Input } from '@angular/core';
import { NzModalService, NzMessageService } from "ng-zorro-antd";
import { SlicingTaskServices } from '.././../../../../../core/services/slicingTaskServices';
import { NsiModelComponent } from "../../nsi-management/nsi-model/nsi-model.component";

@Component({
    selector: 'app-slicing-business-model',
    templateUrl: './slicing-business-model.component.html',
    styleUrls: ['./slicing-business-model.component.less']
})
export class SlicingBusinessModelComponent implements OnInit {

    constructor(
        private myhttp: SlicingTaskServices,
        private modalService: NzModalService,
        private message: NzMessageService
    ) {
    }

    @Input() businessId;
    @Input() outerData;
    businessRequirement: any[];
    NSTinfo: any[] = [];
    nsiInfo: any[] = [];
    taskModel: boolean = false;
    isSpinning: boolean = true;
    status: string = "";
    businessDetailInfo : any = {}
    rantext: string = "RAN Network Edge IP address";

    isshowran: boolean = false;
    ngOnInit() {
        this.status = this.outerData.orchestration_status
        console.log('status',this.status)
        this.getDetail()
    }
    detailFn(flag,form){
      this.rantext  = form =='ran'? "RAN Network Edge IP address" : "Core Network Edge IP address";
      this.isshowran = !this.isshowran
    }
    getDetail() {
        this.myhttp.getSlicingBusinessDetail(this.businessId).then(res => {
            this.isSpinning = false;
            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;
            console.log(JSON.stringify(tn_bh_slice_task_info),11111)
            // 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}
           
            this.businessDetailInfo = {
                "suggestNssiId": '',
                "suggestNSSIName": '11111',
                "progress": 'active',
                "status": 'active',
                "statusDescription": 'p2p/mp2p',
                "scriptName": '10.1.1.1',
                "enableNSSISelection": '11',
                "sliceProfile": '10.1.1.1',
                "lantency": '10.2.3.4.5',
                "max_bandWidth": '1111',
                "link_type": '333'
              }
            // this.businessDetailInfo = {
            //     "anVersion":"10.2.3.4.5",
            //       "vLanText":"11111",
            //       "tnVersion":"10.0.1.1.1",
            //       "mbps":"11111",
            //       "msText":"11111",
            //       "linkType":"p2p/mp2p",
            //       "tnEndVersion":"10.1.1.1",
            //       "cnVlan":"11",
            //       "cnVersion":"1.1.2.3",
            //       "orchestration_status":"active"
            //   }
            business_demand_info.area = coverage_area_ta_list.map(item => {
                item = item.split(';').join('-');
                return item
            });
            // area : Front-end analog data
            let area = ["Haidian District;Beijing;Beijing", "Xicheng District;Beijing;Beijing", "Changping District;Beijing;Beijing"].map(item => {
                item = item.split(';').join(' - ');
                return item
            });
            this.businessRequirement = [{ ...business_demand_info, area }];
            this.NSTinfo = [nst_info];
            console.log('ngs',this.NSTinfo)
            if (nsi_info.nsi_id !== null) {
                this.nsiInfo = [nsi_info];
            }
        })
    }
    showdetail(data) {
        const nsiModal = this.modalService.create({
            nzTitle: "Detail",
            nzContent: NsiModelComponent,
            nzWidth: "70%",
            nzOkText: null,
            nzCancelText: null,
            nzComponentParams: {
                nsiId: data.nsi_id
            }
        });
    }
}