efb8ba721298191618dbc168c8c57e214bb80d1e
[usecase-ui.git] /
1 import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
2 import { SlicingTaskServices } from '../../../../../core/services/slicingTaskServices'
3
4 @Component({
5         selector: 'app-check-process-model',
6         templateUrl: './check-process-model.component.html',
7         styleUrls: ['./check-process-model.component.less']
8 })
9 export class CheckProcessModelComponent implements OnInit {
10
11         @Input() moduleTitle: string;
12         @Input() showProcess: boolean;
13         @Input() taskId: string;
14
15         @Output() cancel = new EventEmitter<boolean>();
16
17         constructor(private http: SlicingTaskServices) { }
18
19         checkDetail: any[];
20         businessRequirement: any[];
21         NSTinfo: any[];
22
23         ngOnInit() { }
24
25         ngOnChanges() {
26                 if (this.showProcess) {
27                         this.getInfo();
28                 }
29         }
30
31         getInfo(): void {
32                 this.http.getSlicingBasicInfo(this.taskId).subscribe(res => {
33                         const { result_body, result_header: { result_code } } = res;
34                         if (+result_code === 200) {
35                                 const {
36                                         task_id,
37                                         task_name,
38                                         create_time,
39                                         processing_status,
40                                         business_demand_info,
41                                         nst_info,
42                                         business_demand_info: { service_snssai }
43                                 } = result_body;
44                                 // 处理配置审核详情数据
45                                 this.checkDetail = [{ task_id, task_name, create_time, processing_status, service_snssai }];
46                                 // 业务需求信息数据
47                                 this.businessRequirement = [business_demand_info];
48                                 // 匹配NST信息
49                                 this.NSTinfo = [nst_info];
50                         }
51                 })
52         }
53
54         handleCancel() {
55                 this.showProcess = false;
56                 this.cancel.emit(this.showProcess)
57         }
58         handleOk() { }
59
60 }