From bedce39f1baa80f816839dc8fb7f393d3076231f Mon Sep 17 00:00:00 2001 From: cyuamber Date: Mon, 6 Jan 2020 15:19:42 +0800 Subject: feat:Optimize table filtering of slicing business page Change-Id: If2c9967e0b742c399030228bda26f1f285653f83 Issue-ID: USECASEUI-369 Signed-off-by: cyuamber --- .../slicing-business-table.component.ts | 35 ++++++++++++---------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table') diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.ts index 030d9f56..23b8360b 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.ts @@ -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 + }); + } } }) } -- cgit 1.2.3-korg