fix: after submit to new page 50/128150/1
authorliuwh7 <liuwh7@asiainfo.com>
Tue, 29 Mar 2022 06:37:38 +0000 (14:37 +0800)
committerliuwh7 <liuwh7@asiainfo.com>
Tue, 29 Mar 2022 06:37:52 +0000 (14:37 +0800)
Signed-off-by: liuwh7 <liuwh7@asiainfo.com>
Change-Id: I945a645748991d13b3195f3390642bfb2ef5a3e7
Issue-ID: REQ-1075

usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line-modal/cloud-leased-line-modal.component.html
usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line-modal/cloud-leased-line-modal.component.ts
usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.html
usecaseui-portal/src/app/views/services/intent-based-services/cloud-leased-line/cloud-leased-line.component.ts
usecaseui-portal/src/app/views/services/intent-based-services/intent-based-predict/intent-based-predict.component.html
usecaseui-portal/src/app/views/services/intent-based-services/intent-based-predict/intent-based-predict.component.ts
usecaseui-portal/src/app/views/services/intent-based-services/intent-based-services.component.html
usecaseui-portal/src/app/views/services/intent-based-services/intent-based-services.component.ts
usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.html
usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts
usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.ts

index b48cd3f..4299ba8 100644 (file)
@@ -19,7 +19,7 @@ export class CloudLeasedLineModalComponent implements OnInit {
 
   @Input() modelParams: any;
   @Input() cloudLeasedLineShowFlag: boolean;
-  @Output() cancelEmitter = new EventEmitter<boolean>();
+  @Output() cancelEmitter = new EventEmitter<any>();
   comunicationFormItems = COMMUNICATION_FORM_ITEMS;
   isUpdateFlag: boolean = false;
   nodeLists: any[] = [];
@@ -125,7 +125,7 @@ export class CloudLeasedLineModalComponent implements OnInit {
           return;
         }
         this.nzMessage.success('Update IntentInstance Success!');
-        this.cancel();
+        this.cancel(true);
       },
       (err) => {
         console.log(err);
@@ -144,7 +144,7 @@ export class CloudLeasedLineModalComponent implements OnInit {
           return;
         }
         this.nzMessage.success('Create IntentInstance Success!');
-        this.cancel();
+        this.cancel(true);
       },
       (err) => {
         console.log(err);
@@ -152,7 +152,7 @@ export class CloudLeasedLineModalComponent implements OnInit {
     )
   }
 
-  cancel(): void {
+  cancel(flag): void {
     this.cloudLeasedLineShowFlag = false
     this.isUpdateFlag = false
     this.cloud_leased_line_info = {
@@ -165,7 +165,7 @@ export class CloudLeasedLineModalComponent implements OnInit {
       },
       cloudPointName: '',
     };
-    this.cancelEmitter.emit();
+    this.cancelEmitter.emit(flag);
   }
 
   isString(val) {
index 78f752c..bd4ae43 100644 (file)
@@ -74,6 +74,7 @@
                 Inactive
               </button>
               <button
+                *ngIf="data.status === '1'"
                 nz-button
                 nzType="primary"
                 class="buy-button"
index dd044e7..5dac8cb 100644 (file)
@@ -24,7 +24,11 @@ export class CloudLeasedLineComponent implements OnInit {
     this.getCloudLeasedLineList();
   }
 
-       ngOnDestroy() {}
+       ngOnDestroy() {
+    this.progressingTimer.forEach((item) => {
+      clearInterval(item.timer);
+    });
+  }
 
   statusObj: any = {
     0: 'Incomplete',
index bdd59ea..73c4ab1 100644 (file)
   <app-cloud-leased-line-modal
     [modelParams]="modalParam"
     [cloudLeasedLineShowFlag]="cloudModalShowFlag"
-    (cancelEmitter)="modalClose()"
+    (cancelEmitter)="cloudModalClose($event)"
   ></app-cloud-leased-line-modal>
   <app-business-order
     [modelParams]="modalParam"
     [showModel]="businessModalShowFlag"
-    (cancel)="modalClose()"
+    (cancel)="businessModalClose($event)"
   ></app-business-order>
 </div>
index d88afa9..d2fe0fc 100644 (file)
@@ -1,4 +1,5 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, EventEmitter, OnInit, Output } from '@angular/core';
+import { Router } from "@angular/router";
 import { NzMessageService } from 'ng-zorro-antd';
 import { intentBaseService } from '../../../../core/services/intentBase.service';
 
@@ -10,10 +11,12 @@ import { intentBaseService } from '../../../../core/services/intentBase.service'
 export class IntentBasedPredictComponent implements OnInit {
 
   constructor(
+    private router:Router,
     private myhttp: intentBaseService,
     private msg: NzMessageService
   ) {}
   
+  @Output() eventEmitter = new EventEmitter<any>();
   // textarea input predict param
   communicationMessage: String = "";
   // button loading
@@ -64,10 +67,22 @@ export class IntentBasedPredictComponent implements OnInit {
     )
   }
 
-  modalClose() {
+  cloudModalClose(param) {
     this.cloudModalShowFlag = false;
-    this.businessModalShowFlag = false;
     this.modalParam = {};
     this.communicationMessage = '';
+    if (param) {
+      this.eventEmitter.emit();
+    }
+  }
+
+  businessModalClose(param) {
+    this.businessModalShowFlag = param.closeFlag;
+    this.modalParam = {};
+    this.communicationMessage = '';
+    const to5gPage = param.to5gPage;
+    if (to5gPage) {
+      this.router.navigate(['/services/slicing-management']);
+    }
   }
 }
index 52f7098..1e09139 100644 (file)
@@ -2,6 +2,7 @@
   <nz-tab [nzTitle]="'i18nTextDefine_intentBaseService' | translate">
     <app-intent-based-predict
       *ngIf="selectedIndex === 0"
+      (eventEmitter)="toCloudPage()"
     ></app-intent-based-predict>
   </nz-tab>
   <nz-tab [nzTitle]="'i18nTextDefine_cloudLeasedLine' | translate">
index 2d6f59d..0017f62 100644 (file)
@@ -15,7 +15,12 @@ export class IntentBasedServicesComponent implements OnInit {
 
   ngOnInit() {
   }
+
   handleTabChange($event): void {
     this.selectedIndex = $event.index;
   }
+
+  toCloudPage() {
+    this.selectedIndex = 1;
+  }
 }
\ No newline at end of file
index 74069f6..9ad0d4e 100644 (file)
@@ -1,4 +1,4 @@
-<nz-modal [(nzVisible)]="showModel" nzTitle="Create Communication Service" (nzOnCancel)="handleCancel()" nzWidth="80%"
+<nz-modal [(nzVisible)]="showModel" nzTitle="Create Communication Service" (nzOnCancel)="handleCancel(false)" nzWidth="80%"
     [nzFooter]="modalFooter">
     <div class="subnet_params_container">
         <form nz-form>
index 70ef4ef..55bf386 100644 (file)
@@ -39,7 +39,7 @@ export class BusinessOrderComponent implements OnInit {
 
        @Input() showModel: boolean;
        @Input() modelParams: any;
-       @Output() cancel = new EventEmitter<boolean>();
+       @Output() cancel = new EventEmitter<any>();
        comunicationFormItems = COMMUNICATION_FORM_ITEMS;
        slicing_order_info = {
                name: null,
@@ -83,9 +83,12 @@ export class BusinessOrderComponent implements OnInit {
                });
        }
 
-       handleCancel(): void {
+       handleCancel(flag): void {
                this.showModel = false;
-               this.cancel.emit(this.showModel);
+               this.cancel.emit({
+      closeFlag: false,
+      to5gPage: flag
+    });
                this.slicing_order_info = {
                        name: null,
                        maxNumberofUEs: null,
@@ -151,7 +154,7 @@ export class BusinessOrderComponent implements OnInit {
                        slicing_order_info: this.slicing_order_info,
                };
                const csmfSlicingPurchaseFailedCallback = () => {
-                       this.handleCancel();
+                       this.handleCancel(true);
                };
                this.loading = true;
 
@@ -179,7 +182,7 @@ export class BusinessOrderComponent implements OnInit {
                                        this.message.create("error", "Network error");
                                }
                                this.loading = false;
-                               this.handleCancel();
+                               this.handleCancel(true);
                        });
   }
 
@@ -198,7 +201,7 @@ export class BusinessOrderComponent implements OnInit {
                                        this.message.create("error", "Network error");
                                }
                                this.loading = false;
-                               this.handleCancel();
+                               this.handleCancel(true);
                        });
   }
 }
index 6eb5e93..40a5c25 100644 (file)
@@ -1,8 +1,8 @@
 import { Component, Input, OnInit, SimpleChanges } from "@angular/core";
+import * as moment from "moment";
+import { NzMessageService, NzModalService } from "ng-zorro-antd";
 import { BUSINESS_STATUS } from "../../../../../constants/constants";
 import { SlicingTaskServices } from ".././../../../core/services/slicingTaskServices";
-import { NzModalService, NzMessageService } from "ng-zorro-antd";
-import * as moment from "moment";
 import { INTERVAL_TIME } from "../constant";
 @Component({
        selector: "app-csmf-slicing-business-management",
@@ -234,22 +234,22 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit {
        }
 
        OrderModelShow(): void {
-            this.orderForm = null;
-           this.businessOrderShow = true;
+    this.orderForm = null;
+    this.businessOrderShow = true;
        }
        orderModelClose($event: any): void {
-           this.businessOrderShow = $event;
-           this.getCSMFBusinessList();
-        }
-        inputOrderModelShow(): void {
-            this.inputBusinessOrderShow = true;
-        }
-        inputOrderModelClose($event: any): void {
-            this.inputBusinessOrderShow = false;
-            if ($event.cancel) {
-                return;
-            }
-            this.orderForm = $event.param;
-            this.businessOrderShow = true;
-        }
+    this.businessOrderShow = $event.closeFlag;
+    this.getCSMFBusinessList();
+  }
+  inputOrderModelShow(): void {
+    this.inputBusinessOrderShow = true;
+  }
+  inputOrderModelClose($event: any): void {
+    this.inputBusinessOrderShow = false;
+    if ($event.cancel) {
+        return;
+    }
+    this.orderForm = $event.param;
+    this.businessOrderShow = true;
+  }
 }