diff options
author | 2020-02-24 15:42:52 +0800 | |
---|---|---|
committer | 2020-02-24 15:43:01 +0800 | |
commit | 3bb632ae93f5dbe1ef43a9c08e380c142a69e1ce (patch) | |
tree | c9912f76b86b4704aec0d96d233b976161363a55 /usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management | |
parent | 1a15520467f3bdb83817c6e27bc9e933a5a9ccfe (diff) |
feat:Optimize the writing of tab switching, remove the writing of Ngif
Change-Id: I1a315a363d75ac5b18d05b20337f63c32cd7a5d9
Issue-ID: USECASEUI-368
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management')
-rw-r--r-- | usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts index 5e90bcee..6dec5c72 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-resource-management/nssi-management/nssi-table/nssi-table.component.ts @@ -1,12 +1,13 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, Input, OnInit,SimpleChanges} from '@angular/core'; import {BUSINESS_STATUS} from '../../../../../../../constants/constants'; import {SlicingTaskServices} from "../../../../../../core/services/slicingTaskServices"; -import { NzModalService } from 'ng-zorro-antd'; +import {NzModalService} from 'ng-zorro-antd'; import {NssiModelComponent} from "../nssi-model/nssi-model.component"; + @Component({ - selector: 'app-nssi-table', - templateUrl: './nssi-table.component.html', - styleUrls: ['./nssi-table.component.less'] + selector: 'app-nssi-table', + templateUrl: './nssi-table.component.html', + styleUrls: ['./nssi-table.component.less'] }) export class NssiTableComponent implements OnInit { @@ -16,10 +17,16 @@ export class NssiTableComponent implements OnInit { ) { } - ngOnInit() { - this.getNssiList() - } - selectedValue:string = BUSINESS_STATUS[0]; + @Input() currentTabName; + + ngOnChanges(changes: SimpleChanges) { + if (changes.currentTabName.currentValue === 'Slicing Subnet Instance Management') { + this.getNssiList() + } + } + ngOnInit() {} + + selectedValue: string = BUSINESS_STATUS[0]; listOfData: any[] = []; pageIndex: number = 1; pageSize: number = 10; @@ -28,7 +35,7 @@ export class NssiTableComponent implements OnInit { isSelect: boolean = false; statusOptions: any[] = BUSINESS_STATUS; - getNssiList (): void{ + getNssiList(): void { this.loading = true; this.isSelect = false; this.listOfData = []; @@ -36,42 +43,45 @@ export class NssiTableComponent implements OnInit { pageNo: this.pageIndex, pageSize: this.pageSize }; - if(this.selectedValue !== BUSINESS_STATUS[0]){ + if (this.selectedValue !== BUSINESS_STATUS[0]) { paramsObj["instanceStatus"] = this.selectedValue.toLocaleLowerCase(); this.isSelect = true; } - this.myhttp.getSlicingNssiList(paramsObj,this.isSelect).subscribe (res => { - const { result_header: { result_code }, result_body: { nssi_service_instances,record_number } } = res; + this.myhttp.getSlicingNssiList(paramsObj, this.isSelect).subscribe(res => { + const {result_header: {result_code}, result_body: {nssi_service_instances, record_number}} = res; this.loading = false; if (+result_code === 200) { this.total = record_number; this.loading = false; - if(nssi_service_instances !== null && nssi_service_instances.length >0) { + if (nssi_service_instances !== null && nssi_service_instances.length > 0) { this.listOfData = nssi_service_instances; } } - },(res) => { + }, (res) => { this.loading = false; console.error(res); }) } - getListOfProcessingStatus(){ + + getListOfProcessingStatus() { this.pageIndex = 1; this.pageSize = 10; this.getNssiList(); } + searchData(reset: boolean = false) { this.getNssiList(); } + showdetail(data) { const nssiModal = this.modalService.create({ - nzTitle:"Detail", + nzTitle: "Detail", nzContent: NssiModelComponent, - nzWidth:"70%", + nzWidth: "70%", nzOkText: null, nzCancelText: null, - nzComponentParams:{ - nssiId:data.service_instance_id + nzComponentParams: { + nssiId: data.service_instance_id } }) } |