1 import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
2 import { SlicingTaskServices } from '../../../../../core/services/slicingTaskServices'
5 selector: 'app-check-process-model',
6 templateUrl: './check-process-model.component.html',
7 styleUrls: ['./check-process-model.component.less']
9 export class CheckProcessModelComponent implements OnInit {
11 @Input() moduleTitle: string;
12 @Input() showProcess: boolean;
13 @Input() taskId: string;
15 @Output() cancel = new EventEmitter<boolean>();
17 constructor(private http: SlicingTaskServices) { }
20 businessRequirement: any[];
23 currentProgress: number = 1;
29 if (this.showProcess) {
33 clearTimeout(this.timer);
38 this.http.getSlicingBasicInfo(this.taskId).subscribe(res => {
39 const { result_body, result_header: { result_code } } = res;
40 if (+result_code === 200) {
48 business_demand_info: { service_snssai }
51 this.checkDetail = [{ task_id, task_name, create_time, processing_status, service_snssai }];
53 this.businessRequirement = [business_demand_info];
55 this.NSTinfo = [nst_info];
61 this.http.getSlicingCreateProgress(this.taskId).subscribe(res => {
62 const { result_body, result_header: {result_code } } = res;
63 if (+result_code === 200) {
65 Object.keys(result_body).forEach( item => {
66 let currentProgress = 1
67 let status = 'process';
68 if(+result_body[item] === 100){
72 const title = item === 'an_progress'? '无线域': (item === 'tn_progress'? '传输域' : '核心域')
73 let obj = { [item]: result_body[item], currentProgress, title, status };
76 this.data = [this.data];
77 let flag: boolean = false;
78 Object.values(result_body).forEach ( item => {
84 this.timer = setTimeout( () => {
93 this.showProcess = false;
94 this.cancel.emit(this.showProcess)