diff options
author | cyuamber <xuranyjy@chinamobile.com> | 2019-12-04 20:29:15 +0800 |
---|---|---|
committer | cyuamber <xuranyjy@chinamobile.com> | 2019-12-04 21:01:23 +0800 |
commit | 7a7b81477be87698d847f9424fa58d4cdf64a143 (patch) | |
tree | 3ffc53669abd0e44acfdc9a2739f8e0b67b2511c /usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management | |
parent | 60011b80da470f37bd1512b3fbd05b8243ed42b6 (diff) |
feat:slicing business page basic functions code
Change-Id: Ifae9e28151a746c1258e181c05154e86b3f89aee
Issue-ID: USECASEUI-352
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management')
9 files changed, 237 insertions, 11 deletions
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-management.component.html b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-management.component.html index 6ea00aa1..7626b040 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-management.component.html +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-management.component.html @@ -1,3 +1,3 @@ <h3> - slicing-business-management + <app-slicing-business-table></app-slicing-business-table> </h3>
\ No newline at end of file diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-management.component.less b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-management.component.less index e69de29b..8fe39e97 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-management.component.less +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-management.component.less @@ -0,0 +1,3 @@ +.slicing-content{ + padding: 0!important; +}
\ No newline at end of file diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.html b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.html new file mode 100644 index 00000000..fde155a5 --- /dev/null +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.html @@ -0,0 +1,75 @@ +<div class="slicing-resource-table"> + <div nz-row> + <div nz-col nzSpan="12" class="task_status"> + <span>Status : </span> + <nz-select nzShowSearch nzPlaceHolder="Select a processing status" [(ngModel)]="selectedValue" + (ngModelChange)="getListOfProcessingStatus()"> + <nz-option *ngFor="let item of statusOptions" [nzLabel]="item" [nzValue]="item"></nz-option> + </nz-select> + </div> + </div> + <div> + <nz-table + #basicTable + [nzData]="listOfData" + [nzFrontPagination]="false" + [nzPageSizeOptions]="[5,10,15,20]" + [nzTotal]='total' + [(nzPageSize)]="pageSize" + [(nzPageIndex)]='pageIndex' + [nzLoading]="loading" + (nzPageIndexChange)="searchData()" + (nzPageSizeChange)="searchData(true)" + > + <thead> + <tr> + <th>Service_instance_id</th> + <th>Service_instance_name</th> + <th>Service_type</th> + <th>S-NSSAI</th> + <th>Orchestration_status</th> + <th>Aciton</th> + <th>Detail</th> + </tr> + </thead> + <tbody> + <ng-template ngFor let-data [ngForOf]="basicTable.data" let-i="index"> + <tr> + <td>{{ data.service_instance_id }}</td> + <td>{{ data.service_instance_name }}</td> + <td>{{ data.service_type }}</td> + <td>{{ data.service_snssai }}</td> + <td> + + <span class="marginLeft10"> + {{ data.last_operation_progress!==100?data.last_operation_type+' '+data.last_operation_progress+'%':data.orchestration_status }} + </span> + <nz-progress *ngIf="data.last_operation_progress !== 100" + [nzPercent]="data.last_operation_progress" + [nzShowInfo]="false" nzStatus="active"></nz-progress> + </td> + <td> + <nz-switch [ngModel]="switchStatusAll[i]==='activated'?true:false" + [nzDisabled]="data.last_operation_progress !== 100" + (ngModelChange)="switchChange(data,i)" + ></nz-switch> + <i [ngClass]="{'cannotclick':data.last_operation_progress !== 100}" + nz-icon + nzType="poweroff" + nzTheme="outline" + (click)="terminate(data)" + ></i> + </td> + <td> + <!--<i [ngClass]="{'cannotclick':data.last_operation_progress !== 100}"--> + <!--class="anticon anticon-bars"--> + <!--(click)="showdetail(data)">--> + <!--</i>--> + <i (click)="showdetail(data)" [ngClass]="{'cannotclick':data.last_operation_progress !== 100}">Detail</i> + </td> + </tr> + </ng-template> + </tbody> + </nz-table> + </div> +</div>
\ No newline at end of file diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.less b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.less new file mode 100644 index 00000000..b95d55e0 --- /dev/null +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.less @@ -0,0 +1,22 @@ +nz-select { + width: 200px; +} +.task_status{ + margin-bottom: 20px; + span{ + margin-right: 5%; + } +} +i.anticon { + cursor: pointer; + font-size: 18px; + padding: 2px; + &:hover{ + color: #147dc2; + } +} +.cannotclick { + pointer-events: none; + color: #aaa; + opacity: 0.6; +}
\ No newline at end of file diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.spec.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.spec.ts new file mode 100644 index 00000000..200a0fb3 --- /dev/null +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SlicingBusinessTableComponent } from './slicing-business-table.component'; + +describe('SlicingBusinessTableComponent', () => { + let component: SlicingBusinessTableComponent; + let fixture: ComponentFixture<SlicingBusinessTableComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SlicingBusinessTableComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SlicingBusinessTableComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.ts new file mode 100644 index 00000000..0397de9c --- /dev/null +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-table/slicing-business-table.component.ts @@ -0,0 +1,96 @@ +import {Component, OnInit} from '@angular/core'; +import {SlicingTaskServices} from '.././../../../../../core/services/slicingTaskServices'; +import {BUSINESS_STATUS} from '../../../../../../../constants/constants'; +import { NzModalService } from 'ng-zorro-antd'; + +@Component({ + selector: 'app-slicing-business-table', + templateUrl: './slicing-business-table.component.html', + styleUrls: ['./slicing-business-table.component.less'] +}) +export class SlicingBusinessTableComponent implements OnInit { + + constructor( + private myhttp: SlicingTaskServices, + private modalService: NzModalService + ) { + } + + ngOnInit() { + this.getBusinessList() + } + + selectedValue = null; + switchStatusAll: any[] = []; + listOfData: any[] = []; + pageIndex: number = 1; + pageSize: number = 10; + total: number = 100; + loading = false; + statusOptions: any[] = BUSINESS_STATUS; + + + getBusinessList (): void{ + this.loading = true; + let paramsObj = { + pageNo: this.pageIndex, + pageSize: this.pageSize + }; + this.myhttp.getSlicingBusinessList(paramsObj).subscribe (res => { + const { result_header: { result_code }, result_body: { slicing_business_list } } = res; + if (+result_code === 200) { + this.listOfData = slicing_business_list; + this.total = slicing_business_list.length; + this.switchStatusAll = slicing_business_list.map((item)=>{ + return item.orchestration_status + }); + this.loading = false; + } + }) + } + searchData(reset: boolean = false) { + this.getBusinessList(); + } + switchChange(data,i){ + console.log(data,i,"----- switchChange"); + this.modalService.confirm({ + nzTitle: '<i>Do you Want to'+(data.orchestration_status === 'activated'?'deactivated':'activated')+ 'slicing business?</i>', + nzContent: '<b>service_instance_id:'+data.service_instance_id+'</b>', + nzOnOk: () => { + let paramsObj = { + serviceId:data.service_instance_id + }; + if(data.orchestration_status === 'activated'){ + this.myhttp.changeActivateSlicingService(paramsObj,false).subscribe (res => { + const { result_header: { result_code }, result_body: { operation_id } } = res; + if (+result_code === 200) { + this.switchStatusAll[i] = 'deactivated'; + console.log(operation_id,"operation_id") + } + }) + }else { + this.myhttp.changeActivateSlicingService(paramsObj,true).subscribe (res => { + const { result_header: { result_code, result_message }} = res; + if (+result_code === 200) { + this.switchStatusAll[i] = 'activated'; + console.log(result_message,"result_message") + } + }) + } + }, + nzCancelText: 'No', + nzOnCancel: () => { + this.switchStatusAll[i] = data.orchestration_status + } + }); + } + terminate(data){ + + } + showdetail(data){ + + } + getListOfProcessingStatus(){ + + } +} diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-resource-management.component.html b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-resource-management.component.html index a6a06298..7e6856b6 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-resource-management.component.html +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-resource-management.component.html @@ -1,11 +1,17 @@ -<nz-tabset class="slicing-resource_tab"> +<nz-tabset class="slicing-resource_tab" (nzSelectChange)="handleTabChange($event)"> <nz-tab nzTitle="Slicing Business Management"> - <app-slicing-business-management></app-slicing-business-management> + <app-slicing-business-management + *ngIf="currentTab ==='Slicing Business Management'" + ></app-slicing-business-management> </nz-tab> <nz-tab nzTitle="Slicing Instance Management"> - <app-nsi-management></app-nsi-management> + <app-nsi-management + *ngIf="currentTab ==='Slicing Instance Management'" + ></app-nsi-management> </nz-tab> <nz-tab nzTitle="Slicing Subnet Instance Management"> - <app-nssi-management></app-nssi-management> + <app-nssi-management + *ngIf="currentTab ==='Slicing Subnet Instance Management'" + ></app-nssi-management> </nz-tab> </nz-tabset>
\ No newline at end of file diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-resource-management.component.less b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-resource-management.component.less index b3180ba2..e69de29b 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-resource-management.component.less +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-resource-management.component.less @@ -1,5 +0,0 @@ -.slicing-resource_tab { - width: 104%; - margin-left: 20px; - margin-top: -35px; -}
\ No newline at end of file diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-resource-management.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-resource-management.component.ts index 38dc48c8..b88b9073 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-resource-management.component.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-resource-management.component.ts @@ -11,5 +11,9 @@ export class SlicingResourceManagementComponent implements OnInit { ngOnInit() { } - + currentTab = 'Slicing Business Management'; + handleTabChange($event): void { + console.log($event,"$event"); + this.currentTab = $event.tab._title; + } } |