feat: Modified the progress display logic in the task management page 82/99882/1
authorcyuamber <xuranyjy@chinamobile.com>
Mon, 23 Dec 2019 05:10:15 +0000 (13:10 +0800)
committercyuamber <xuranyjy@chinamobile.com>
Mon, 23 Dec 2019 05:10:26 +0000 (13:10 +0800)
Change-Id: I06f9369a193672b42b77e071db1149d73d4eaba7
Issue-ID: USECASEUI-368
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
usecaseui-portal/src/app/mock/json/slicing_taskCreationProgress.json
usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.html
usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts

index 7a14c73..8b152a0 100644 (file)
@@ -4,8 +4,8 @@
         "result_message": "5G slicing task operation progress result."\r
     },\r
     "result_body": {\r
-        "an_progress": 60,\r
-        "tn_progress": 60,\r
+        "an_progress": 100,\r
+        "tn_progress": null,\r
         "cn_progress": 60\r
     }\r
 }\r
index 38aab54..ecba2cd 100644 (file)
@@ -17,7 +17,7 @@
                                <p class="list-title">Task Detail:</p>
                        </ng-template>
                        <ng-template #defaultItem let-item> 
-                               <nz-list-item  nz-row nzType="flex" nzJustify="center" >
+                               <nz-list-item  nz-row nzType="flex" nzJustify="center">
                                        <nz-steps 
                                                nzType="navigation"
                                                [nzCurrent]="item.currentProgress" 
                                                <nz-step [nzTitle]="item.title"></nz-step>
                                                <nz-step 
                                                        [nzTitle]="item.currentProgress > 1 ? null : 'in progress'" 
-                                                       [nzStatus]="item.status" nzIcon="anticon anticon-spin anticon-loading"
+                                                       [nzStatus]="item.status" [nzIcon]="item.status === 'process'? 'anticon anticon-spin anticon-loading' : null"
                                                > 
                                                </nz-step>
-                                               <nz-step 
-                                                       [nzTitle]="item.status === 'finish' ? 'success' : null"
-                                                       [nzStatus]="item.status === 'finish' ? 'finish' : 'wait'" 
-                                                       nzIcon='loading'
-                                               >
-                                               </nz-step>
+                                               <nz-step [nzStatus]="item.status === 'finish' ? 'finish' : 'wait'" [nzIcon]="item.status === 'process'?'loading': null"> </nz-step>
                                        </nz-steps>
-                                       
+                                       <p *ngIf="!data[0].length" [ngStyle]="{marginBottom: 0}">No data</p>
                                </nz-list-item>
+
+                               
                        </ng-template>
                </nz-list>      
        </nz-spin>
index 181eaf7..1babf27 100644 (file)
@@ -96,17 +96,19 @@ export class CheckProcessModelComponent implements OnInit {
                                        let currentProgress = 1
                                        let status = 'process';
                                        if (+result_body[item] === 100) {
-                                               currentProgress = 2;
+                                               currentProgress = 3;
                                                status = 'finish'
                                        }
                                        const title = item === 'an_progress' ? 'An' : (item === 'tn_progress' ? 'Tn' : 'Cn')
                                        let obj = { [item]: result_body[item], currentProgress, title, status };
-                                       this.data.push(obj)
+                                       if(result_body[item]){
+                                               this.data.push(obj)
+                                       }
                                })
                                this.data = [this.data];
                                let flag: boolean = false;
                                Object.values(result_body).forEach(item => {
-                                       if (item !== 100) {
+                                       if (+item !== 100 && typeof item !== 'object') {
                                                flag = true;
                                        }
                                })