feat: Delete the useless message.error code in the code of slicing-task-model page 50/112250/1
authorcyuamber <xuranyjy@chinamobile.com>
Tue, 8 Sep 2020 03:04:10 +0000 (11:04 +0800)
committercyuamber <xuranyjy@chinamobile.com>
Tue, 8 Sep 2020 03:04:20 +0000 (11:04 +0800)
Change-Id: I517edc6a3aea2cc268771ec5082d99fddf7107b5
Issue-ID: USECASEUI-444
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
usecaseui-portal/src/app/core/services/slicingTaskServices.ts
usecaseui-portal/src/app/shared/utils/http.ts
usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.ts

index e7a0a6f..1a2c989 100644 (file)
@@ -65,30 +65,30 @@ export class SlicingTaskServices {
 \r
 \r
     // Get slicing order task list\r
-    getSlicingTaskList(pageNo: string, pageSize: string) {\r
+    getSlicingTaskList(pageNo: string, pageSize: string, failedCallback?:any) {\r
         const url = this.url.slicingTaskList\r
             .replace("{pageNo}", pageNo)\r
             .replace("{pageSize}", pageSize);\r
-            return this.Http.httpAxios("get", url)\r
+            return this.Http.httpAxios("get", url, null, failedCallback)\r
     }\r
     // Get list based on task processing status\r
-    getTaskProcessingStatus(processingStatus: string, pageNo: string, pageSize: string) {\r
+    getTaskProcessingStatus(processingStatus: string, pageNo: string, pageSize: string, failedCallback?:any) {\r
         const url = this.url.taskProcessingStatus\r
             .replace('{processingStatus}', processingStatus)\r
             .replace("{pageNo}", pageNo)\r
             .replace("{pageSize}", pageSize);\r
-        return this.Http.httpAxios("get", url);\r
+            return this.Http.httpAxios("get", url, null, failedCallback)\r
     }\r
     // Get \r
-    getAuditInfo(taskId: string) {\r
+    getAuditInfo(taskId: string, failedCallback?:any) {\r
         const url = this.url.auditInfo.replace('{taskId}', taskId);\r
-        return this.Http.httpAxios("get", url);\r
+        return this.Http.httpAxios("get", url, null, failedCallback);\r
     }\r
-    getSlicingInstance(pageNo: string, pageSize: string) {\r
+    getSlicingInstance(pageNo: string, pageSize: string, failedCallback?:any) {\r
         const url = this.url.slicingInstance\r
             .replace("{pageNo}", pageNo)\r
             .replace("{pageSize}", pageSize);\r
-        return this.Http.httpAxios("get", url);\r
+        return this.Http.httpAxios("get", url, null, failedCallback);\r
     }\r
     getSlicingSubnetInstance(nsiId: string, failedCallback?:any) {\r
         const url = this.url.slicingSubnetInstance.replace('{nsiId}', nsiId);\r
@@ -188,19 +188,18 @@ export class SlicingTaskServices {
         if (!activate) {\r
             url = this.url.csmfDeactivate.replace("{serviceId}", paramsObj.serviceId)\r
         }\r
-        // return this.http.put<any>(url, paramsObj);\r
         return this.Http.httpAxios("put", url, paramsObj, failedCallback);\r
     }\r
     // terminate CSMF slicing business\r
-    csmfTerminate(paramsObj) {\r
-        const url = this.url.csmfTerminate.replace('{serviceId}', paramsObj.serviceId);\r
-        return this.http.delete<any>(url);\r
-    }\r
-    // query CSMF slicing business progress\r
-    csmfSlicingProgress(paramsObj) {\r
-        let url = this.url.csmfGetProgress.replace("{serviceId}", paramsObj.serviceId);\r
-        return this.http.get<any>(url);\r
-    }\r
+    // csmfTerminate(paramsObj) {\r
+    //     const url = this.url.csmfTerminate.replace('{serviceId}', paramsObj.serviceId);\r
+    //     return this.http.delete<any>(url);\r
+    // }\r
+    // // query CSMF slicing business progress\r
+    // csmfSlicingProgress(paramsObj) {\r
+    //     let url = this.url.csmfGetProgress.replace("{serviceId}", paramsObj.serviceId);\r
+    //     return this.http.get<any>(url);\r
+    // }\r
     csmfSlicingPurchase(paramsObj: any, failedCallback?:any){\r
         let url = this.url.csmfPurchase;\r
         return this.Http.httpAxios("post", url, paramsObj, failedCallback);\r
index bbfc19c..598d2af 100644 (file)
@@ -49,11 +49,6 @@ export class Http {
             if(+result_code === 200){\r
               resolve(response.data)\r
             }else{\r
-              // let res = {\r
-              //   message:this.message.error(result_message || "Network exception, please try again."),\r
-              //   callbackFunction:callback\r
-              // }\r
-              // reject(res)\r
               this.message.error(result_message || "Network exception, please try again.")\r
               if(callback)callback();\r
             } \r
index f782859..4e80de0 100644 (file)
@@ -1,5 +1,4 @@
 import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';
-import { NzMessageService } from 'ng-zorro-antd';
 import { SlicingTaskServices } from '@src/app/core/services/slicingTaskServices';
 import { indexDebugNode } from '@angular/core/src/debug/debug_node';
 
@@ -15,7 +14,7 @@ export class SlicingTaskModelComponent implements OnInit {
   @Output() cancel = new EventEmitter<object>();
   @ViewChild('notification') notification1: any;
 
-  constructor(private http: SlicingTaskServices, private message: NzMessageService) { }
+  constructor(private http: SlicingTaskServices) { }
 
   // 配置审核详情
   checkDetail: any[] = [{}];
@@ -102,7 +101,10 @@ export class SlicingTaskModelComponent implements OnInit {
   }
 
   getautidInfo(): void {
-    this.http.getAuditInfo(this.taskId).then( res => {
+    let getAuditInfoFailedCallback  = () => {
+      this.isSpinning = false;
+    } 
+    this.http.getAuditInfo(this.taskId, getAuditInfoFailedCallback).then( res => {
       this.isSpinning = false;
       const {
         business_demand_info,
@@ -195,9 +197,6 @@ export class SlicingTaskModelComponent implements OnInit {
         'sliceProfile_CN_ipAddress',
         'sliceProfile_CN_nextHopInfo'
       ])};
-    }, ({ status, statusText }) => {
-      this.message.error(status + ' (' + statusText + ')');
-      this.isSpinning = false;
     })
   }
 
@@ -221,7 +220,11 @@ export class SlicingTaskModelComponent implements OnInit {
 
   getSlicingInstances(pageNo: string, pageSize: string): void {
     this.slicingInstances.isLoading = true;
-    this.http.getSlicingInstance(pageNo, pageSize).then(res => {
+    let getSlicingInstanceFailedCallback  = () => {
+      this.slicingInstances.isLoading = false;
+      this.slicingInstances.flag = false;
+    }
+    this.http.getSlicingInstance(pageNo, pageSize, getSlicingInstanceFailedCallback).then(res => {
       const { result_body } = res;
       setTimeout(() => {
         const { nsi_service_instances, record_number } = result_body;
@@ -230,10 +233,6 @@ export class SlicingTaskModelComponent implements OnInit {
         this.slicingInstances.isLoading = false;
         this.slicingInstances.flag = false;
       }, 2000)
-    }, ({ status, statusText }) => {
-      this.message.error(status + ' (' + statusText + ')');
-      this.slicingInstances.isLoading = false;
-      this.slicingInstances.flag = false;
     })
   }
 
@@ -391,15 +390,13 @@ export class SlicingTaskModelComponent implements OnInit {
     let reqBody = { ...checkDetail[0], business_demand_info: businessRequirement[0], nst_info: NSTinfo[0], nsi_nssi_info };
     delete reqBody.service_snssai;
     let submitSlicingFailedCallback =  () => {
+      this.loading = false;
       this.notification1.notificationFailed('Task', 'Sumbit', this.taskId)
     }
     this.http.submitSlicing(reqBody,submitSlicingFailedCallback).then(res => {
       this.notification1.notificationSuccess('Task', 'Sumbit', this.taskId)
       this.loading = false;
       this.handleCancel(true);
-    }, ({ status, statusText }) => {
-      this.message.error(status + ' (' + statusText + ')');
-      this.loading = false;
     })
   }
 }