7bed430497490f86f10e73e4a3928d1317e4d987
[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     businessRequirement: any[];
22     NSTinfo: any[] = [];
23     nsiInfo: any[] = [];
24     taskModel: boolean = false;
25     isSpinning: boolean = true;
26     ngOnInit() {
27         console.log(this.businessId, "id");
28         this.getDetail()
29     }
30
31     getDetail() {
32         this.myhttp.getSlicingBusinessDetail(this.businessId).then(res => {
33             this.isSpinning = false;
34             const { business_demand_info, business_demand_info: { coverage_area_ta_list }, nst_info, nsi_info } = res.result_body;
35             business_demand_info.area = coverage_area_ta_list.map(item => {
36                 item = item.split(';').join('-');
37                 return item
38             });
39             // area : Front-end analog data
40             let area = ["Haidian District;Beijing;Beijing", "Xicheng District;Beijing;Beijing", "Changping District;Beijing;Beijing"].map(item => {
41                 item = item.split(';').join(' - ');
42                 return item
43             });
44             this.businessRequirement = [{ ...business_demand_info, area }];
45             this.NSTinfo = [nst_info];
46             if (nsi_info.nsi_id !== null) {
47                 this.nsiInfo = [nsi_info];
48             }
49         })
50     }
51     showdetail(data) {
52         console.log(data, "data.nsi_id");
53         const nsiModal = this.modalService.create({
54             nzTitle: "Detail",
55             nzContent: NsiModelComponent,
56             nzWidth: "70%",
57             nzOkText: null,
58             nzCancelText: null,
59             nzComponentParams: {
60                 nsiId: data.nsi_id
61             }
62         });
63     }
64 }