diff options
author | 2019-12-26 10:10:31 +0000 | |
---|---|---|
committer | 2019-12-26 10:10:31 +0000 | |
commit | 6f871653cde9c4579527bddf65fd9684f22eff60 (patch) | |
tree | 5f3324f333c3e357d0a7a9c4c81ced29a559eb52 /usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts | |
parent | 21dbd718fa1e9f7c8312f87b5b4168777a38fbc3 (diff) | |
parent | edf19113159f8d31946cc40e2a86cff9b7a013c1 (diff) |
Merge "feat: Modified progress logic"
Diffstat (limited to 'usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts')
-rw-r--r-- | usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts index 8a0ef970..95106050 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts @@ -92,23 +92,25 @@ export class CheckProcessModelComponent implements OnInit { const { result_body, result_header: { result_code } } = res; if (+result_code === 200) { this.data = []; - Object.keys(result_body).forEach(item => { - let currentProgress = 1 - let status = 'process'; - if (+result_body[item] === 100) { - currentProgress = 3; - status = 'finish' - } - const title = item === 'an_progress' ? 'An' : (item === 'tn_progress' ? 'Tn' : 'Cn') - let obj = { [item]: result_body[item], currentProgress, title, status }; - if (result_body[item]) { + const nssiList: string[] = ['an', 'tn', 'cn']; + nssiList.forEach( item => { + const progress: number = +result_body[item +'_progress']; + const title: string = item.charAt(0).toUpperCase() + item.slice(1); + let status: string = result_body[item +'_status']; + if ((progress || progress === 0) && status) { + let currentProgress = 1 + if (progress === 100 && status === 'finished') { + currentProgress = 3; + status = 'finish' + } + const obj = { progress, currentProgress, title, status }; this.data.push(obj) } }) this.data = [this.data]; let flag: boolean = false; - Object.values(result_body).forEach(item => { - if (+item !== 100 && typeof item !== 'object') { + nssiList.forEach(item => { + if (result_body[item +'_status'] === 'processing' && result_body[item +'_progress'] !== 0) { flag = true; } }) |