fix: fix bugs of progress task model 95/99895/2
authorcyuamber <xuranyjy@chinamobile.com>
Tue, 24 Dec 2019 03:37:23 +0000 (11:37 +0800)
committerTao Shen <shentao@chinamobile.com>
Tue, 24 Dec 2019 03:40:18 +0000 (03:40 +0000)
Change-Id: Ibf979e1a377f362809e9d585e61622ae0b78ca3e
Issue-ID: USECASEUI-368
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.html
usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.ts

index e312593..6bc7202 100644 (file)
@@ -1,10 +1,7 @@
-<nz-modal [nzVisible]="showDetail" nzWidth="85%" [nzTitle]="moduleTitle" [nzFooter]="modalFooter"  (nzOnCancel)="handleCancel()">
+<nz-modal [nzVisible]="showDetail" nzWidth="85%" [nzTitle]="moduleTitle" [nzFooter]="modalFooter"
+  (nzOnCancel)="handleCancel()">
   <nz-spin [nzSpinning]="isSpinning">
-    <app-basic-info
-      [checkDetail]="checkDetail"
-      [businessRequirement]="businessRequirement"
-      [NSTinfo]="NSTinfo"
-    >
+    <app-basic-info [checkDetail]="checkDetail" [businessRequirement]="businessRequirement" [NSTinfo]="NSTinfo">
     </app-basic-info>
     <div>
       <nz-list class="taskmodel_list" nzBordered [nzHeader]="nssiInfoTile" [nzFooter]="null" *ngIf="slicingInstances">
         <nz-list-item nz-row nzType="flex" nzJustify="start" [nzGutter]="8">
           <div nz-col nzSpan="12">
             NSI ID:
-            <nz-select 
-              nzShowSearch 
-              [(ngModel)]="selectedServiceId" 
-              (nzOpenChange)="openSlicingInstance($event)"
-              (nzScrollToBottom)="getNextPageData()"
-              (ngModelChange)="slicingInstanceChange()"
-            >
-              <nz-option 
-                nzCustomContent   
-                *ngFor="let item of slicingInstances.list" 
-                [nzValue]="item.service_instance_id" 
-                [nzLabel]="item.service_instance_id"
-              >
-                <span>{{item.service_instance_name + ' -- '}}</span> {{item.service_instance_id}}
+            <nz-select nzShowSearch [(ngModel)]="selectedServiceId" (nzOpenChange)="openSlicingInstance($event)"
+              (nzScrollToBottom)="getNextPageData()" (ngModelChange)="slicingInstanceChange()">
+              <nz-option nzCustomContent *ngFor="let item of slicingInstances.list" [nzValue]="item.service_instance_id"
+                [nzLabel]="item.service_instance_id">
+                <span>{{item.service_instance_name + ' : '}}</span> {{item.service_instance_id}}
               </nz-option>
               <nz-option *ngIf="slicingInstances.isLoading" nzDisabled nzCustomContent>
-                <i class="anticon anticon-loading anticon-spin loading-icon"></i> 
+                <i class="anticon anticon-loading anticon-spin loading-icon"></i>
                 Loading Data...
               </nz-option>
             </nz-select>
             <div nz-row [nzGutter]="8">
               <div nz-col nzSpan="12">
                 NSSI ID:
-                <nz-select 
-                  nzShowSearch 
-                  [nzDisabled]="isDisabled"
-                  [(ngModel)]="item.slicingId" 
-                  (ngModelChange)="slicingSubnetChange(item)"
-                  (nzOpenChange)="openSubnetInstances($event, item)" 
-                  (nzScrollToBottom)="getNextPageSubnet(item)"
-                >
-                  <nz-option 
-                    nzCustomContent 
-                    *ngFor="let item of item.instances" 
-                    [nzValue]="item.service_instance_id"
-                    [nzLabel]="item.service_instance_id" 
-                  >
-                    <span>{{item.service_instance_name + ' -- '}}</span> {{item.service_instance_id}}
+                <nz-select nzShowSearch [nzDisabled]="isDisabled" [(ngModel)]="item.slicingId"
+                  (ngModelChange)="slicingSubnetChange(item)" (nzOpenChange)="openSubnetInstances($event, item)"
+                  (nzScrollToBottom)="getNextPageSubnet(item)">
+                  <nz-option nzCustomContent *ngFor="let item of item.instances" [nzValue]="item.service_instance_id"
+                    [nzLabel]="item.service_instance_id">
+                    <span>{{item.service_instance_name + ' : '}}</span> {{item.service_instance_id}}
                   </nz-option>
                   <nz-option *ngIf="item.isLoading" nzDisabled nzCustomContent>
-                    <i class="anticon anticon-loading anticon-spin loading-icon"></i> 
+                    <i class="anticon anticon-loading anticon-spin loading-icon"></i>
                     Loading Data...
                   </nz-option>
                 </nz-select>
   <button nz-button (click)="handleCancel()">Cancel</button>
   <button nz-button nzType="primary" [nzLoading]='loading' (click)="handleOk()">OK</button>
 </ng-template>
-<app-subnet-params-model 
-  [showModel]="isShowParams" 
-  [detailData]="params" 
-  [title]="paramsTitle" 
-  (cancel)="isShowParams=$event" 
-  (paramsDataChange)="changeParams($event)"
->
+<app-subnet-params-model [showModel]="isShowParams" [detailData]="params" [title]="paramsTitle"
+  (cancel)="isShowParams=$event" (paramsDataChange)="changeParams($event)">
 </app-subnet-params-model>
 <app-notification #notification [isServicesList]="false" [parentComponent]="'slicing'"></app-notification>
\ No newline at end of file
index 76a1eda..4b19a12 100644 (file)
@@ -144,6 +144,9 @@ export class SlicingTaskModelComponent implements OnInit {
         // 共享切片实例
         this.selectedServiceId = suggest_nsi_id;
         this.selectedServiceName = suggest_nsi_name;
+        if (!this.selectedServiceId || !this.selectedServiceName) {
+          this.isDisabled = false;
+        }
         this.slicingInstances = {
           currentPage: '1',
           pageSize: '10',
@@ -227,14 +230,15 @@ export class SlicingTaskModelComponent implements OnInit {
 
   slicingInstanceChange(): void {
     this.isDisabled = true;
-    this.selectedServiceName = ''
+    this.selectedServiceName = '';
     // 获取切片子网实例数据
     this.http.getSlicingSubnetInstance(this.selectedServiceId).subscribe(res => {
       const { result_header: { result_code }, result_body, record_number } = res;
       if (+result_code === 200) {
-        this.subnetDataFormatting(result_body, record_number)
+        this.subnetDataFormatting(result_body, record_number);
       } else {
-        this.message.error('Failed to get slicing subnet instance ID')
+        this.subnetDataFormatting({}, 1);
+        this.message.error('Failed to get slicing subnet instance ID');
       }
     }, ({ status, statusText }) => {
       this.message.error(status + ' (' + statusText + ')');