diff options
author | cyuamber <xuranyjy@chinamobile.com> | 2019-12-26 17:56:23 +0800 |
---|---|---|
committer | cyuamber <xuranyjy@chinamobile.com> | 2019-12-26 17:56:43 +0800 |
commit | edf19113159f8d31946cc40e2a86cff9b7a013c1 (patch) | |
tree | 39ff3635ac424d6c39ab4873c6fd757769690937 /usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model | |
parent | 04c43a5bc9f4078368f6dcb880f7f9e6eca26c36 (diff) |
feat: Modified progress logic
Change-Id: I06f2e78c8ffccfd4a0bd1eab723ea892b100af3c
Issue-ID: USECASEUI-368
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model')
2 files changed, 16 insertions, 14 deletions
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.html b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.html index ecba2cdf..00a63057 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.html +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.html @@ -30,10 +30,10 @@ <nz-step [nzTitle]="item.title"></nz-step> <nz-step [nzTitle]="item.currentProgress > 1 ? null : 'in progress'" - [nzStatus]="item.status" [nzIcon]="item.status === 'process'? 'anticon anticon-spin anticon-loading' : null" + [nzStatus]="item.status" [nzIcon]="item.status === 'processing'? 'anticon anticon-spin anticon-loading' : null" > </nz-step> - <nz-step [nzStatus]="item.status === 'finish' ? 'finish' : 'wait'" [nzIcon]="item.status === 'process'?'loading': null"> </nz-step> + <nz-step [nzStatus]="item.status === 'finish' ? 'finish' : 'wait'" [nzIcon]="item.status === 'processing' ? 'loading': null"> </nz-step> </nz-steps> <p *ngIf="!data[0].length" [ngStyle]="{marginBottom: 0}">No data</p> </nz-list-item> 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; } }) |