1 import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
2 import { SlicingTaskServices } from '../../../../../core/services/slicingTaskServices';
3 import { BUSINESS_REQUIREMENT } from '../../../../../../constants/constants';
6 selector: 'app-slicing-task-model',
7 templateUrl: './slicing-task-model.component.html',
8 styleUrls: ['./slicing-task-model.component.less']
10 export class SlicingTaskModelComponent implements OnInit {
11 @Input() showDetail: boolean;
12 @Input() moduleTitle: string;
13 @Input() taskId: string;
14 @Output() cancel = new EventEmitter<boolean>();
16 constructor(private http: SlicingTaskServices) { }
19 businessList: object[] = BUSINESS_REQUIREMENT;
21 checkDetail: object[] = [{}];
23 businessRequirement: object[] = [{}];
25 NSTinfo: object[] = [{}];
27 selectedServiceId: string;
28 selectedServiceName: string;
30 slicingSubnet: any[] = [
51 if (this.showDetail) {
56 getautidInfo(): void {
57 this.http.getAuditInfo(this.taskId).subscribe( res => {
58 const { result_header: { result_code } } = res;
59 if (+result_code === 200) {
60 const { task_id, task_name, create_timer, processing_status, business_demand_info, nst_info, nsi_nssi_info, business_demand_info: { service_snssai } } = res.result_body;
69 cn_suggest_nssi_name } = nsi_nssi_info;
71 this.checkDetail = [{ task_id, task_name, create_timer, processing_status, service_snssai }];
73 this.businessRequirement = [business_demand_info];
74 this.NSTinfo = [nst_info];
76 this.selectedServiceId = suggest_nsi_id;
77 this.selectedServiceName = suggest_nsi_name;
79 this.slicingSubnet[0].slicingId = an_suggest_nssi_id;
80 this.slicingSubnet[0].slicingName = an_suggest_nssi_name;
81 this.slicingSubnet[1].slicingId = tn_suggest_nssi_id;
82 this.slicingSubnet[1].slicingName = tn_suggest_nssi_name;
83 this.slicingSubnet[2].slicingId = cn_suggest_nssi_id;
84 this.slicingSubnet[2].slicingName = cn_suggest_nssi_name;
94 serviceId = ['46da8cf8-0878-48ac-bea3-f2200959411a', '46da8cf8-0878-48ac-bea3-f2200959411b', '46da8cf8-0878-48ac-bea3-f2200959411c'];
96 "46da8cf8-0878-48ac-bea3-f2200959411a": "eMBB instancela",
97 "46da8cf8-0878-48ac-bea3-f2200959411b": "eMBB instancelb",
98 "46da8cf8-0878-48ac-bea3-f2200959411c": "eMBB instancelc",
103 serviceIdChange(value: string): void {
104 this.selectedServiceName = this.serviceData[value];
105 console.log(this.selectedServiceName, "=====")
108 this.selectedServiceId = "";
109 this.serviceIdChange(this.selectedServiceId);
113 this.showDetail = false;
114 this.cancel.emit(this.showDetail);