From cf5ac1658730e1cf44f0ba9ed9c4178eb49dfba5 Mon Sep 17 00:00:00 2001 From: cyuamber Date: Tue, 8 Sep 2020 12:40:27 +0800 Subject: feat: Delete the useless message.error code of slicing-task-management page Change-Id: I65d902038279c59c214ad8d6d842527a9c1a1d9c Issue-ID: USECASEUI-444 Signed-off-by: cyuamber --- .../slicing-task-management.component.ts | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'usecaseui-portal') diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.ts index b15421b6..4e765055 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.ts @@ -1,5 +1,4 @@ import {Component, OnInit, Input, SimpleChanges} from '@angular/core'; -import { NzMessageService } from 'ng-zorro-antd'; import { SlicingTaskServices } from '@src/app/core/services/slicingTaskServices'; import { TASK_PROCESSING_STATUS } from '@src/constants/constants'; @@ -10,7 +9,7 @@ import { TASK_PROCESSING_STATUS } from '@src/constants/constants'; }) export class SlicingTaskManagementComponent implements OnInit { - constructor(private myhttp: SlicingTaskServices, private message: NzMessageService) { } + constructor(private myhttp: SlicingTaskServices) { } @Input() currentTabTitle; @@ -38,15 +37,14 @@ export class SlicingTaskManagementComponent implements OnInit { getTaskList(): void { const { pageNum, pageSize } = this; this.loading = true; - this.myhttp.getSlicingTaskList(pageNum, pageSize).then(res => { - const { result_body } = res; - const { slicing_task_list, record_number } = result_body; + let getSlicingTaskListFailedCallback = () => { + this.loading = false; + } + this.myhttp.getSlicingTaskList(pageNum, pageSize, getSlicingTaskListFailedCallback).then(res => { + const { slicing_task_list, record_number } = res.result_body; this.dataFormatting(slicing_task_list); this.total = record_number; this.loading = false; - }, ({ status, statusText }) => { - this.message.error(status + ' (' + statusText + ')'); - this.loading = false; }) } @@ -63,16 +61,16 @@ export class SlicingTaskManagementComponent implements OnInit { getListOfProcessingStatus(): void { const { selectedValue, pageNum, pageSize } = this; this.loading = true; - this.myhttp.getTaskProcessingStatus(selectedValue, pageNum + '', pageSize + '').then(res => { + let getTaskProcessingStatusFailedCallback = () => { + this.loading = false; + this.listOfData = []; + } + this.myhttp.getTaskProcessingStatus(selectedValue, pageNum + '', pageSize + '', getTaskProcessingStatusFailedCallback).then(res => { const { result_body } = res const { slicing_task_list, record_number } = result_body; this.dataFormatting(slicing_task_list) this.total = record_number; this.loading = false; - }, ({ status, statusText }) => { - this.message.error(status + ' (' + statusText + ')'); - this.listOfData = []; - this.loading = false; }) } -- cgit 1.2.3-korg