diff options
author | 2020-09-08 09:50:48 +0800 | |
---|---|---|
committer | 2020-09-08 10:03:42 +0800 | |
commit | 43cb242d5a78e86786d4274fc539d81680fc15c4 (patch) | |
tree | e4635ef8ee1c7bc7102f6333e3ed2488b27b8cab /usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts | |
parent | 926b57b4d540c73f1930e6d2d2070e5ac6939e5d (diff) |
feat: Optimize the public request method of axios
Change-Id: Iab9e86c66628c9a0c39e0a9ed56607417805c9d4
Issue-ID: USECASEUI-444
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts')
-rw-r--r-- | usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts index ba2b8971..5fe303b0 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts @@ -48,21 +48,17 @@ export class NssiTableComponent implements OnInit { paramsObj["instanceStatus"] = this.selectedValue.toLocaleLowerCase(); this.isSelect = true; } - this.myhttp.getSlicingNssiList(paramsObj, this.isSelect).subscribe(res => { - const {result_header: {result_code}, result_body: {nssi_service_instances, record_number}} = res; + let getSlicingNssiListFailedCallback = () => { this.loading = false; - if (+result_code === 200) { - this.total = record_number; - this.loading = false; - if (nssi_service_instances !== null && nssi_service_instances.length > 0) { - this.listOfData = nssi_service_instances; - } - }else{ - this.message.error(res.result_header.result_message) - } - }, (res) => { + } + this.myhttp.getSlicingNssiList(paramsObj, this.isSelect, getSlicingNssiListFailedCallback).then(res => { + const { result_body: {nssi_service_instances, record_number} } = res; this.loading = false; - this.message.error(res) + this.total = record_number; + this.loading = false; + if (nssi_service_instances !== null && nssi_service_instances.length > 0) { + this.listOfData = nssi_service_instances; + } }) } |