diff options
author | wangyuerg <wangyuerg@chinamobile.com> | 2021-03-26 16:40:13 +0800 |
---|---|---|
committer | wangyuerg <wangyuerg@chinamobile.com> | 2021-03-26 16:40:38 +0800 |
commit | dac7f905c2761bdb54d21c8bcaee818bd3fd3489 (patch) | |
tree | 36ff071c6aef5b85869d0982d0617329867bc8e3 /usecaseui-portal/src/app | |
parent | 536421f8efaee44685f6efbdaf89ae3648cbb7f5 (diff) |
fix: fix the bug of continuous loading
Signed-off-by: wangyuerg <wangyuerg@chinamobile.com>
Change-Id: Ic8f8bb39f12bf77b67d98c4f2fb96179df33ec7b
Issue-ID: USECASEUI-527
Diffstat (limited to 'usecaseui-portal/src/app')
2 files changed, 8 insertions, 22 deletions
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/constant.ts b/usecaseui-portal/src/app/views/services/slicing-management/constant.ts index 4a0e4d4f..2cdf6cbe 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/constant.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/constant.ts @@ -1,3 +1,3 @@ // The polling interval of this module is set here uniformly // communication service, sclcing resouce management--slicing business management, -export const INTERVAL_TIME = 100000; +export const INTERVAL_TIME = 5000; 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 908d30c7..548f2d12 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,7 +1,6 @@ import { Component, OnInit, Input, SimpleChanges } from "@angular/core"; import { SlicingTaskServices } from "@src/app/core/services/slicingTaskServices"; import { TASK_PROCESSING_STATUS } from "./constants"; -import { INTERVAL_TIME } from "../constant"; @Component({ selector: "app-slicing-task-management", @@ -25,7 +24,6 @@ export class SlicingTaskManagementComponent implements OnInit { total: number = 1; pageSize: string = "10"; pageNum: string = "1"; - intervalTime: number = INTERVAL_TIME; ngOnChanges(changes: SimpleChanges) { if ( @@ -41,22 +39,13 @@ export class SlicingTaskManagementComponent implements OnInit { getTaskList(): void { const { pageNum, pageSize } = this; - this.loading = true; - let getSlicingTaskListFailedCallback = () => { + this.loading = true; // todo + this.myhttp.getSlicingTaskList(pageNum, pageSize).then((res) => { + const { slicing_task_list, record_number } = res.result_body; + this.dataFormatting(slicing_task_list); + this.total = record_number; 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; - }); + }); } processingStatusChange(): void { @@ -160,10 +149,7 @@ export class SlicingTaskManagementComponent implements OnInit { if (this.selectedValue && this.selectedValue !== "all") { this.getListOfProcessingStatus(); } else { - this.loading = true; - setTimeout(() => { - this.getTaskList(); - }, this.intervalTime); + this.getTaskList(); } } } |