From f574888b41dbf6d465973899c0265c4baa251f7f Mon Sep 17 00:00:00 2001 From: cyuamber Date: Sat, 28 Dec 2019 09:04:06 +0800 Subject: feat:Optimize loading of slicing page Change-Id: I7bebe12f9e62268ce40142b518e592a9335040f5 Issue-ID: USECASEUI-369 Signed-off-by: cyuamber --- .../slicing-business-table/slicing-business-table.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management') 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 f81f94e1..92973d58 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 @@ -51,9 +51,9 @@ export class SlicingBusinessTableComponent implements OnInit { } this.myhttp.getSlicingBusinessList(paramsObj, this.isSelect).subscribe(res => { const { result_header: { result_code }, result_body: { slicing_business_list, record_number } } = res; + this.loading = false; if (+result_code === 200) { this.total = record_number; - this.loading = false; this.listOfData = slicing_business_list.map((item, index) => { if (item.last_operation_progress && item.last_operation_type && item.last_operation_progress < 100) { let updata = (prodata: { operation_progress: string }) => { @@ -115,6 +115,7 @@ export class SlicingBusinessTableComponent implements OnInit { this.loading = true; this.myhttp.changeActivateSlicingService(paramsObj, isActivate).subscribe(res => { const { result_header: { result_code, result_message }, result_body: { operation_id } } = res; + this.loading = false; if (+result_code === 200) { this.notification1.notificationSuccess('slicing business', finished, slicing.service_instance_id); this.getBusinessList(); @@ -127,6 +128,7 @@ export class SlicingBusinessTableComponent implements OnInit { } this.getBusinessList(); }, () => { + this.loading = false; let singleSlicing = Object.assign({}, this.listOfData[index]); this.listOfData[index] = singleSlicing; this.listOfData = [...this.listOfData]; @@ -145,6 +147,7 @@ export class SlicingBusinessTableComponent implements OnInit { this.loading = true; this.myhttp.terminateSlicingService(paramsObj).subscribe(res => { const { result_header: { result_code, result_message }, result_body: { operation_id } } = res; + this.loading = false; if (+result_code === 200) { this.notification1.notificationSuccess('slicing business', 'terminate', slicing.service_instance_id); this.getBusinessList(); @@ -153,6 +156,7 @@ export class SlicingBusinessTableComponent implements OnInit { this.terminateStart = false; } }, () => { + this.loading = false; this.notification1.notificationFailed('slicing business', 'terminate', slicing.service_instance_id); this.terminateStart = false; }) -- cgit 1.2.3-korg