diff options
author | cyuamber <xuranyjy@chinamobile.com> | 2019-12-09 10:13:59 +0800 |
---|---|---|
committer | cyuamber <xuranyjy@chinamobile.com> | 2019-12-09 10:14:06 +0800 |
commit | a0e23263ff319da6b34b122bcde42a810599df4c (patch) | |
tree | 5993552f09d7e65776e2c1a706b828b1998807eb | |
parent | 9b2981c50e58fa641621d4a4bcb9d8827eb5968d (diff) |
feat:add model business code of slicing business page
Change-Id: I08ddb3d37e9d96c44c596b535083306992f2bf52
Issue-ID: USECASEUI-369
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
10 files changed, 164 insertions, 16 deletions
diff --git a/usecaseui-portal/src/app/app.module.ts b/usecaseui-portal/src/app/app.module.ts index a34bca7f..37a9eaa8 100644 --- a/usecaseui-portal/src/app/app.module.ts +++ b/usecaseui-portal/src/app/app.module.ts @@ -96,7 +96,8 @@ import { BasicInfoComponent } from './shared/components/basic-info/basic-info.co import { CheckProcessModelComponent } from './views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component' import { NsiTableComponent } from './views/services/slicing-management/slicing-resource-management/nsi-management/nsi-table/nsi-table.component' import { NssiTableComponent } from './views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component' -import { SlicingBusinessModelComponent } from './views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-model/slicing-business-model.component' +import { SlicingBusinessModelComponent } from './views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-model/slicing-business-model.component'; +import { NsiModelComponent } from './views/services/slicing-management/slicing-resource-management/nsi-management/nsi-model/nsi-model.component'; @NgModule({ providers: [ @@ -158,7 +159,8 @@ import { SlicingBusinessModelComponent } from './views/services/slicing-manageme CheckProcessModelComponent, NsiTableComponent, NssiTableComponent, - SlicingBusinessModelComponent + SlicingBusinessModelComponent, + NsiModelComponent, ], imports: [ BrowserModule, @@ -176,6 +178,10 @@ import { SlicingBusinessModelComponent } from './views/services/slicing-manageme NgxEchartsModule, AppRoutingModule ], - bootstrap: [AppComponent] + bootstrap: [AppComponent], + entryComponents: [ + SlicingBusinessModelComponent, + NsiModelComponent + ] }) export class AppModule { }
\ No newline at end of file diff --git a/usecaseui-portal/src/app/core/services/slicingTaskServices.ts b/usecaseui-portal/src/app/core/services/slicingTaskServices.ts index 98be0117..7c50e561 100644 --- a/usecaseui-portal/src/app/core/services/slicingTaskServices.ts +++ b/usecaseui-portal/src/app/core/services/slicingTaskServices.ts @@ -128,6 +128,11 @@ export class SlicingTaskServices { let url = this.url.queryOperationProgress.replace("{serviceId}", paramsObj.serviceId);
return this.http.get<any>(url);
}
+ //get slicingBusinessDetail
+ getSlicingBusinessDetail(businessId: string){
+ let url = this.url.slicingBusinessDetail.replace("{businessId}",businessId);
+ return this.http.get<any>(url);
+ }
// Get slicing nsi list
getSlicingNsiList (paramsObj,isSelect: boolean) {
let url = this.url.slicingNsiList .replace("{pageNo}", paramsObj.pageNo)
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nsi-management/nsi-model/nsi-model.component.html b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nsi-management/nsi-model/nsi-model.component.html new file mode 100644 index 00000000..a90a90d1 --- /dev/null +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nsi-management/nsi-model/nsi-model.component.html @@ -0,0 +1,4 @@ +<p> + nsi-model works! + <button (click)="button()">我是nsi--button</button> +</p> diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nsi-management/nsi-model/nsi-model.component.less b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nsi-management/nsi-model/nsi-model.component.less new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nsi-management/nsi-model/nsi-model.component.less diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nsi-management/nsi-model/nsi-model.component.spec.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nsi-management/nsi-model/nsi-model.component.spec.ts new file mode 100644 index 00000000..76d1a2eb --- /dev/null +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nsi-management/nsi-model/nsi-model.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { NsiModelComponent } from './nsi-model.component'; + +describe('NsiModelComponent', () => { + let component: NsiModelComponent; + let fixture: ComponentFixture<NsiModelComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ NsiModelComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(NsiModelComponent); + 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/nsi-management/nsi-model/nsi-model.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nsi-management/nsi-model/nsi-model.component.ts new file mode 100644 index 00000000..1b8a6627 --- /dev/null +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nsi-management/nsi-model/nsi-model.component.ts @@ -0,0 +1,22 @@ +import { Component, OnInit } from '@angular/core'; +import {NzModalService} from "ng-zorro-antd"; +import { SlicingBusinessModelComponent } from '../../slicing-business-management/slicing-business-model/slicing-business-model.component'; +@Component({ + selector: 'app-nsi-model', + templateUrl: './nsi-model.component.html', + styleUrls: ['./nsi-model.component.less'] +}) +export class NsiModelComponent implements OnInit { + + constructor( + private modalService: NzModalService + ) { + } + + ngOnInit() { + } + button(){ + this.modalService.create({nzContent:SlicingBusinessModelComponent}); + console.log(2222) + } +} diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-model/slicing-business-model.component.html b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-model/slicing-business-model.component.html index 839e3aa8..9ece597e 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-model/slicing-business-model.component.html +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-model/slicing-business-model.component.html @@ -1,3 +1,37 @@ -<p> - slicing-business-model works! -</p> +<app-basic-info + [businessRequirement]="businessRequirement" + [NSTinfo]="NSTinfo" + [taskModel]="taskModel" +> +</app-basic-info> +<nz-list class="taskmodel_list" nzBordered [nzHeader]="'Slicing NSI £º'" [nzFooter]="null"> + <nz-table + #basicTable + [nzData]="nsiInfo" + [nzShowPagination]="false" + nzHideOnSinglePage + > + <thead> + <tr> + <th>Service Instance Id</th> + <th>Service Instance Name</th> + <th>Service Type</th> + <th>Status</th> + <th width="100px">Detail</th> + </tr> + </thead> + <tbody> + <ng-template ngFor let-data [ngForOf]="basicTable.data" let-i="index"> + <tr> + <td>{{ data.nsi_id }}</td> + <td>{{ data.nsi_name }}</td> + <td>{{ data.nsi_type }}</td> + <td>{{ data.nsi_orchestration-status }}</td> + <td> + <a (click)="showdetail(data)">detail</a> + </td> + </tr> + </ng-template> + </tbody> + </nz-table> +</nz-list>
\ 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-model/slicing-business-model.component.less b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-model/slicing-business-model.component.less index e69de29b..6e097cd8 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-model/slicing-business-model.component.less +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-model/slicing-business-model.component.less @@ -0,0 +1,3 @@ +.taskmodel_list{ + margin-bottom: 20px; +}
\ 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-model/slicing-business-model.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-model/slicing-business-model.component.ts index dc144c97..8115a79b 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-model/slicing-business-model.component.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/slicing-business-management/slicing-business-model/slicing-business-model.component.ts @@ -1,15 +1,55 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit, Input} from '@angular/core'; +import {NzModalService} from "ng-zorro-antd"; +import {SlicingTaskServices} from '.././../../../../../core/services/slicingTaskServices'; +import {NsiModelComponent} from "../../nsi-management/nsi-model/nsi-model.component"; @Component({ - selector: 'app-slicing-business-model', - templateUrl: './slicing-business-model.component.html', - styleUrls: ['./slicing-business-model.component.less'] + selector: 'app-slicing-business-model', + templateUrl: './slicing-business-model.component.html', + styleUrls: ['./slicing-business-model.component.less'] }) export class SlicingBusinessModelComponent implements OnInit { - constructor() { } + constructor( + private myhttp: SlicingTaskServices, + private modalService: NzModalService + ) { + } - ngOnInit() { - } + @Input() businessId; + businessRequirement: any[]; + NSTinfo: any[]; + nsiInfo: any[]; + taskModel: boolean = false; + ngOnInit() { + console.log(this.businessId, "id"); + this.getDetail() + } + getDetail() { + this.myhttp.getSlicingBusinessDetail(this.businessId).subscribe(res => { + const {result_header: {result_code}, result_body: {business_demand_info,nst_info,nsi_info} } = res; + if (+result_code === 200) { + // business_demand_info.coverage_area_ta_list.map((item)=>{ + // item.replace(";"," ") + // }); + this.businessRequirement = [business_demand_info]; + this.NSTinfo = [nst_info]; + this.nsiInfo = [nsi_info]; + } + }) + } + showdetail(data) { + console.log(data,"data.nsi_id"); + const nsiModal = this.modalService.create({ + nzTitle:"Detail", + nzContent: NsiModelComponent, + nzWidth:"70%", + nzOkText: null, + nzCancelText: null, + nzComponentParams:{ + businessId:data.nsi_id + } + }); + } } 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 index 0d4c6df8..515a4d3d 100644 --- 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 @@ -2,7 +2,7 @@ import {Component, OnInit} from '@angular/core'; import {SlicingTaskServices} from '.././../../../../../core/services/slicingTaskServices'; import {BUSINESS_STATUS} from '../../../../../../../constants/constants'; import { NzModalService } from 'ng-zorro-antd'; - +import { SlicingBusinessModelComponent } from '../slicing-business-model/slicing-business-model.component'; @Component({ selector: 'app-slicing-business-table', templateUrl: './slicing-business-table.component.html', @@ -156,8 +156,17 @@ export class SlicingBusinessTableComponent implements OnInit { } }); } - showdetail(data){ - + showdetail(data) { + const BusinessModal = this.modalService.create({ + nzTitle:"Detail", + nzContent: SlicingBusinessModelComponent, + nzWidth:"70%", + nzOkText: null, + nzCancelText: null, + nzComponentParams:{ + businessId:data.service_instance_id + } + }) } queryProgress(obj, callback) { return new Promise( res => { |