feat:Optimize table filtering of slicing business page 10/100010/1
authorcyuamber <xuranyjy@chinamobile.com>
Mon, 6 Jan 2020 07:19:42 +0000 (15:19 +0800)
committercyuamber <xuranyjy@chinamobile.com>
Mon, 6 Jan 2020 07:19:49 +0000 (15:19 +0800)
Change-Id: If2c9967e0b742c399030228bda26f1f285653f83
Issue-ID: USECASEUI-369
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nsi-management/nsi-table/nsi-table.component.ts
usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts
usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.ts

index 8a85f91..203df8a 100644 (file)
@@ -31,6 +31,7 @@ export class NsiTableComponent implements OnInit {
     getNsiList (): void{
         this.loading = true;
         this.isSelect = false;
+        this.listOfData = [];
         let paramsObj = {
             pageNo: this.pageIndex,
             pageSize: this.pageSize
@@ -45,7 +46,9 @@ export class NsiTableComponent implements OnInit {
             if (+result_code === 200) {
                 this.total = record_number;
                 this.loading = false;
-                this.listOfData = nsi_service_instances;
+                if(nsi_service_instances !== null  && nsi_service_instances.length >0) {
+                    this.listOfData = nsi_service_instances;
+                }
             }
         }, (res) => {
             this.loading = false;
index 7536a83..a6e00b4 100644 (file)
@@ -31,6 +31,7 @@ export class NssiTableComponent implements OnInit {
     getNssiList (): void{
         this.loading = true;
         this.isSelect = false;
+        this.listOfData = [];
         let paramsObj = {
             pageNo: this.pageIndex,
             pageSize: this.pageSize
@@ -45,7 +46,9 @@ export class NssiTableComponent implements OnInit {
             if (+result_code === 200) {
                 this.total = record_number;
                 this.loading = false;
-                this.listOfData = nssi_service_instances;
+                if(nssi_service_instances !== null && nssi_service_instances.length >0) {
+                    this.listOfData = nssi_service_instances;
+                }
             }
         },(res) => {
             this.loading = false;
index 030d9f5..23b8360 100644 (file)
@@ -41,6 +41,7 @@ export class SlicingBusinessTableComponent implements OnInit {
     getBusinessList(): void {
         this.loading = true;
         this.isSelect = false;
+        this.listOfData = [];
         let paramsObj = {
             pageNo: this.pageIndex,
             pageSize: this.pageSize
@@ -54,22 +55,24 @@ export class SlicingBusinessTableComponent implements OnInit {
             this.loading = false;
             if (+result_code === 200) {
                 this.total = record_number;
-                this.listOfData = slicing_business_list.map((item, index) => {
-                    if (item.last_operation_progress && item.last_operation_type && Number(item.last_operation_progress) < 100) {
-                        let updata = (prodata: { operation_progress: string }) => {
-                            item.last_operation_progress = prodata.operation_progress || item.last_operation_progress;
-                        };
-                        let obj = {
-                            serviceId: item.service_instance_id
-                        };
-                        if (item.last_operation_type === 'DELETE') this.terminateStart = true;
-                        this.queryProgress(obj, item.orchestration_status, index, updata).then((res) => {
-                            item.last_operation_progress = '100';
-                            this.getBusinessList();
-                        })
-                    }
-                    return item
-                });
+                if(slicing_business_list !==null && slicing_business_list.length >0){
+                    this.listOfData = slicing_business_list.map((item, index) => {
+                        if (item.last_operation_progress && item.last_operation_type && Number(item.last_operation_progress) < 100) {
+                            let updata = (prodata: { operation_progress: string }) => {
+                                item.last_operation_progress = prodata.operation_progress || item.last_operation_progress;
+                            };
+                            let obj = {
+                                serviceId: item.service_instance_id
+                            };
+                            if (item.last_operation_type === 'DELETE') this.terminateStart = true;
+                            this.queryProgress(obj, item.orchestration_status, index, updata).then((res) => {
+                                item.last_operation_progress = '100';
+                                this.getBusinessList();
+                            })
+                        }
+                        return item
+                    });
+                }
             }
         })
     }