feat:Adjust page style and order of cmsf slice business management 38/101438/1
authorcyuamber <xuranyjy@chinamobile.com>
Mon, 10 Feb 2020 09:17:05 +0000 (17:17 +0800)
committercyuamber <xuranyjy@chinamobile.com>
Mon, 10 Feb 2020 09:17:15 +0000 (17:17 +0800)
Change-Id: I20f10dcaf6724279e8f486fdbca281a568c4093d
Issue-ID: USECASEUI-369
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.html
usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.less
usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.ts
usecaseui-portal/src/app/views/services/slicing-management/slicing-management.component.html
usecaseui-portal/src/app/views/services/slicing-management/slicing-management.component.ts
usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.html
usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.less
usecaseui-portal/src/styles.less

index c3f2d63..2da0554 100644 (file)
@@ -1,4 +1,4 @@
-<div class="slicing-resource-table slicing-resource_tab">
+<div>
   <div nz-row>
     <div nz-col nzSpan="12" class="task_status">
       <span>Status : </span>
       <ng-template ngFor let-data [ngForOf]="basicTable.data" let-i="index">
         <tr>
           <td>{{i+1}}</td>
-          <td>{{ data.service_id }}</td>
-          <td>{{ data.service_name }}</td>
+          <td>{{ data.service_instance_id }}</td>
+          <td>{{ data.service_instance_name }}</td>
           <td>{{ data.service_type?data.service_type:'--' }}</td>
           <td>{{ data.service_snssai }}</td>
           <td>
                             <span class="marginLeft10">
-                                <span *ngIf="data.last_operation_process && data.last_operation_process !== '100'">
-                                    {{data.last_operation_process+'%'}}
+                                <span *ngIf="data.last_operation_progress && data.last_operation_progress !== '100'">
+                                    {{data.last_operation_progress+'%'}}
                                 </span>
                                 <br>
-                                {{data.service_status}}
+                                {{data.orchestration_status}}
                             </span>
             <br>
           </td>
           <td>
             <div class="action-icon">
               <nz-switch [ngModel]="data.service_status==='activated'?true:false"
-                         [nzDisabled]="data.last_operation_type && data.last_operation_process && data.last_operation_process !== '100'"
+                         [nzDisabled]="data.last_operation_type && data.last_operation_progress && data.last_operation_progress !== '100'"
                          (ngModelChange)="switchChange(data,i)"></nz-switch>
               <nz-progress
-                      *ngIf="data.last_operation_type && data.last_operation_process && data.last_operation_process !== '100' && data.last_operation_type !== 'DELETE'"
-                      [nzPercent]="data.last_operation_process" [nzShowInfo]="false" nzStatus="active">
+                      *ngIf="data.last_operation_type && data.last_operation_progress && data.last_operation_progress !== '100' && data.last_operation_type !== 'DELETE'"
+                      [nzPercent]="data.last_operation_progress" [nzShowInfo]="false" nzStatus="active">
               </nz-progress>
             </div>
             <div class="action-icon">
-              <i [ngClass]="{'cannotclick': data.last_operation_type && data.last_operation_process && data.last_operation_process !== '100' && (data.last_operation_type !== 'DELETE' || data.service_status==='activated')}"
+              <i [ngClass]="{'cannotclick': data.last_operation_type && data.last_operation_progress && data.last_operation_progress !== '100' && (data.last_operation_type !== 'DELETE' || data.service_status==='activated')}"
                  nz-icon nzType="poweroff" nzTheme="outline" class="anticon anticon-poweroff"
                  (click)="terminate(data)"></i>
               <nz-progress
-                      *ngIf="data.last_operation_type && data.last_operation_process && data.last_operation_process !== '100' && terminateStart"
-                      [nzPercent]="data.last_operation_process" [nzShowInfo]="false" nzStatus="active">
+                      *ngIf="data.last_operation_type && data.last_operation_progress && data.last_operation_progress !== '100' && terminateStart"
+                      [nzPercent]="data.last_operation_progress" [nzShowInfo]="false" nzStatus="active">
               </nz-progress>
             </div>
           </td>
index e1b3705..fac4e0c 100644 (file)
@@ -33,34 +33,40 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit {
     total: number = 0;
     loading = false;
     statusOptions: any[] = BUSINESS_STATUS;
+    isSelect: boolean = false;
     progressingTimer: any[] = [];
     terminateStart: boolean = false;
 
     getCSMFBusinessList() {
         this.loading = true;
+        this.isSelect = false;
         this.listOfData = [];
         let paramsObj = {
             status: this.selectedValue,
             pageNo: this.pageIndex,
             pageSize: this.pageSize
         };
-        this.myhttp.getCSMFSlicingBusinessList(paramsObj).subscribe(res => {
-            const {result_header: {result_code}, result_body: {slicing_service_list, record_number}} = res;
+        if (this.selectedValue !== BUSINESS_STATUS[0]) {
+            paramsObj["businessStatus"] = this.selectedValue;
+            this.isSelect = true;
+        }
+        this.myhttp.getSlicingBusinessList(paramsObj, this.isSelect).subscribe(res => {
+            const {result_header: {result_code}, result_body: {slicing_business_list, record_number}} = res;
             this.loading = false;
             if (+result_code === 200) {
                 this.total = record_number;
-                if (slicing_service_list !== null && slicing_service_list.length > 0) {
-                    this.listOfData = slicing_service_list.map((item, index) => {
-                        if (item.last_operation_process && item.last_operation_type && Number(item.last_operation_process) < 100) {
+                if (slicing_business_list !== null && slicing_business_list.length > 0) {
+                    this.listOfData = slicing_business_list.map((item, index) => {
+                        if (item.last_operation_progress && item.last_operation_type && Number(item.last_operation_progress) < 100) {
                             let updata = (prodata: { operation_progress: string }) => {
-                                item.last_operation_process = prodata.operation_progress || item.last_operation_process;
+                                item.last_operation_progress = prodata.operation_progress || item.last_operation_progress;
                             };
                             let obj = {
                                 serviceId: item.service_instance_id
                             };
                             if (item.last_operation_type === 'DELETE') this.terminateStart = true;
                             this.queryProgress(obj, index, updata).then((res) => {
-                                item.last_operation_process = '100';
+                                item.last_operation_progress = '100';
                                 this.getCSMFBusinessList();
                             })
                         }
@@ -93,12 +99,12 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit {
         console.log(slicing, i, "slicing");
         this.modalService.confirm({
             nzTitle: '<i>Are you sure you want to perform this task?</i>',
-            nzContent: '<b>Name:' + slicing.service_name + '</b>',
+            nzContent: '<b>Name:' + slicing.service_instance_name + '</b>',
             nzOnOk: () => {
                 let paramsObj = {
-                    serviceId: slicing.service_id
+                    serviceId: slicing.service_instance_id
                 };
-                if (slicing.service_status === 'activated') {
+                if (slicing.orchestration_status === 'activated') {
                     this.changeActivate(paramsObj, false, slicing, "deactivate", "deactivated", i)
                 } else {
                     this.changeActivate(paramsObj, true, slicing, "activate", "activated", i);
@@ -114,7 +120,7 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit {
     }
     changeActivate(paramsObj, isActivate, slicing, activateValue, finished, index) {
         this.loading = true;
-        this.myhttp.csmfChangeActivate(paramsObj, isActivate).subscribe(res => {
+        this.myhttp.changeActivateSlicingService(paramsObj, isActivate).subscribe(res => {
             const { result_header: { result_code, result_message }, result_body: { operation_id } } = res;
             this.loading = false;
             if (+result_code === 200) {
@@ -139,12 +145,12 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit {
         console.log(slicing, "slicing");
         this.modalService.confirm({
             nzTitle: 'Are you sure you want to terminate this task?',
-            nzContent: '<b>Name:&nbsp;</b>' + slicing.service_name,
+            nzContent: '<b>Name:&nbsp;</b>' + slicing.service_instance_name,
             nzOnOk: () => {
-                let paramsObj = { serviceId: slicing.service_id };
+                let paramsObj = { serviceId: slicing.service_instance_id };
                 this.terminateStart = true;
                 this.loading = true;
-                this.myhttp.csmfTerminate(paramsObj).subscribe(res => {
+                this.myhttp.terminateSlicingService(paramsObj).subscribe(res => {
                     const { result_header: { result_code, result_message }, result_body: { operation_id } } = res;
                     this.loading = false;
                     if (+result_code === 200) {
@@ -166,7 +172,7 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit {
     queryProgress(obj, index, callback) {
         return new Promise(res => {
             let requery = () => {
-                this.myhttp.csmfSlicingProgress(obj)
+                this.myhttp.getSlicingBusinessProgress(obj)
                     .subscribe((data) => {
                         const { result_header: { result_code, result_message }, result_body: { operation_id } } = data;
                         if (+result_code === 200) {
index 965dca6..1de1378 100644 (file)
@@ -1,4 +1,9 @@
 <nz-tabset (nzSelectChange)="handleTabChange($event)" class="slicing">
+    <nz-tab nzTitle="communication Service">
+        <app-csmf-slicing-business-management
+                *ngIf="currentTab ==='communication Service'"
+        ></app-csmf-slicing-business-management>
+    </nz-tab>
   <nz-tab nzTitle="Slicing Task Management">
     <app-slicing-task-management
             *ngIf="currentTab ==='Slicing Task Management'"
@@ -9,9 +14,4 @@
             *ngIf="currentTab ==='Slicing Resource Management'"
     ></app-slicing-resource-management>
   </nz-tab>
-  <nz-tab nzTitle="CSMF Slicing Business Management">
-    <app-csmf-slicing-business-management
-            *ngIf="currentTab ==='CSMF Slicing Business Management'"
-    ></app-csmf-slicing-business-management>
-  </nz-tab>
 </nz-tabset>
\ No newline at end of file
index e2ca18e..597e4ee 100644 (file)
@@ -15,7 +15,7 @@ export class SlicingManagementComponent implements OnInit {
 
   ngOnInit() {
   }
-    currentTab = 'Slicing Task Management';
+    currentTab = 'communication Service';
     handleTabChange($event): void {
         console.log($event,"$event");
         this.currentTab = $event.tab._title;
index 6f10e36..bd3a6b7 100644 (file)
@@ -816,8 +816,8 @@ nz-notification-container .ant-notification{
   }
 }
 .slicing-resource_tab {
-  width: 104%;
-  margin-left: 20px!important;
+  width: 103%;
+  margin-left: 60px!important;
   margin-top: -35px!important;
   .ant-tabs-content.ant-tabs-content-animated{
     padding:  20px 0!important;