summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts
diff options
context:
space:
mode:
authorcyuamber <xuranyjy@chinamobile.com>2019-12-20 15:54:09 +0800
committercyuamber <xuranyjy@chinamobile.com>2019-12-20 15:54:19 +0800
commit961eb4aa72c04a8898862a61607da422e8c0b906 (patch)
treed902893ff79b1a0a134e752f94a46e1c9db99225 /usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts
parent43e39a785c3871a1b403b04b1085179fb95a00b2 (diff)
feat: Added error prompt for task management page
Change-Id: I59b0785c5904033aa7dfe443330c7a75119ebff5 Issue-ID: USECASEUI-368 Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts')
-rw-r--r--usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts31
1 files changed, 19 insertions, 12 deletions
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts
index 797165f6..181eaf7a 100644
--- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts
+++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts
@@ -12,6 +12,7 @@ export class CheckProcessModelComponent implements OnInit {
@Input() moduleTitle: string;
@Input() showProcess: boolean;
@Input() taskId: string;
+   @Input() moduleOperation: string;
@Output() cancel = new EventEmitter<boolean>();
@@ -41,11 +42,6 @@ export class CheckProcessModelComponent implements OnInit {
getInfo(): void {
this.http.getSlicingBasicInfo(this.taskId).subscribe(res => {
- if (this.isGetData) {
- this.isSpinning = false;
- } else {
- this.isGetData = true;
- }
const { result_body, result_header: { result_code } } = res;
if (+result_code === 200) {
const {
@@ -73,19 +69,26 @@ export class CheckProcessModelComponent implements OnInit {
// 匹配NST信息
this.NSTinfo = [nst_info];
} else {
- const errorMessage = this.moduleTitle === '切片创建中' ? 'Failed to get data' : 'Viewing results failed';
- this.message.error(errorMessage)
+ const errorMessage = this.moduleOperation === 'Creating' ? 'Failed to get data' : 'Viewing results failed';
+ this.message.error(errorMessage);
}
+ this.isLoadingShow();
+ }, ({status, statusText}) => {
+ this.message.error(status + ' (' + statusText + ')');
+ this.isLoadingShow();
})
}
+ isLoadingShow () {
+ if (this.isGetData) {
+ this.isSpinning = false;
+ } else {
+ this.isGetData = true;
+ }
+ }
+
getProgress(): void {
this.http.getSlicingCreateProgress(this.taskId).subscribe(res => {
- if (this.isGetData) {
- this.isSpinning = false;
- } else {
- this.isGetData = true;
- }
const { result_body, result_header: { result_code } } = res;
if (+result_code === 200) {
this.data = [];
@@ -115,6 +118,10 @@ export class CheckProcessModelComponent implements OnInit {
} else {
this.message.error('Failed to get progress')
}
+ this.isLoadingShow();
+ }, ({status, statusText}) => {
+ this.message.error(status + ' (' + statusText + ')');
+ this.isLoadingShow();
})
}