From faf7f86b53e3702074846c7c09f008fb35cab896 Mon Sep 17 00:00:00 2001 From: zhangab Date: Sat, 17 Nov 2018 21:21:00 +0800 Subject: Fix bugs in list data Change-Id: I4e88172b79b85f47717bd6cbaf02643fa4ece533 Issue-ID: USECASEUI-159 Signed-off-by: zhangab --- .../onboard-vnf-vm/onboard-vnf-vm.component.html | 15 +++--- .../onboard-vnf-vm/onboard-vnf-vm.component.ts | 54 +++++++++++++--------- 2 files changed, 38 insertions(+), 31 deletions(-) (limited to 'usecaseui-portal/src/app/services/onboard-vnf-vm') diff --git a/usecaseui-portal/src/app/services/onboard-vnf-vm/onboard-vnf-vm.component.html b/usecaseui-portal/src/app/services/onboard-vnf-vm/onboard-vnf-vm.component.html index a3023fb0..3c849397 100644 --- a/usecaseui-portal/src/app/services/onboard-vnf-vm/onboard-vnf-vm.component.html +++ b/usecaseui-portal/src/app/services/onboard-vnf-vm/onboard-vnf-vm.component.html @@ -14,7 +14,7 @@ limitations under the License. --> - +

Onboard {{tabTitle}}

@@ -29,7 +29,7 @@ style="margin-top: 16px"> {{ nsuploading ? 'Uploading' : 'Start Upload' }} - @@ -49,11 +49,11 @@ {{item.uuid}} {{item.nsdName}} - 无 + 无 {{item.name}} - + 无 {{item.nsdVersion}} - 无 + 无 {{ item.version }} {{item.nsdOnboardingState}} @@ -65,7 +65,6 @@ 'scaling':data.status=='Scaling','healing':data.status=='Healing'}">{{data.status || "Active"}} --> - {{item.nsdOperationalState}} {{item.nsdUsageState}} @@ -90,7 +89,7 @@ style="margin-top: 16px"> {{ vnfuploading ? 'Uploading' : 'Start Upload' }} - @@ -139,7 +138,7 @@ style="margin-top: 16px"> {{ pnfuploading ? 'Uploading' : 'Start Upload' }} - diff --git a/usecaseui-portal/src/app/services/onboard-vnf-vm/onboard-vnf-vm.component.ts b/usecaseui-portal/src/app/services/onboard-vnf-vm/onboard-vnf-vm.component.ts index 82025ec6..766540c0 100644 --- a/usecaseui-portal/src/app/services/onboard-vnf-vm/onboard-vnf-vm.component.ts +++ b/usecaseui-portal/src/app/services/onboard-vnf-vm/onboard-vnf-vm.component.ts @@ -50,9 +50,14 @@ export class OnboardVnfVmComponent implements OnInit { } //表格数据 - tableData:any; - sdcData:any; - vfcData:any; + nstableData:any; + vnftableData:any; + pnftableData:any; + nssdcData:any; + nsvfcData:any; + + vnfsdcData:any; + vnfvfcData:any; nspageIndex = 1; nspageSize = 10; vnfpageIndex = 1; @@ -85,13 +90,15 @@ export class OnboardVnfVmComponent implements OnInit { console.log(this.url); switch (tab) { case 'NS': + this.nstableData = []; this.getTableData(); - break case 'VNF': + this.vnftableData = []; this.getTableVnfData() break case 'PNF': + this.pnftableData = []; this.getTablePnfData() break } @@ -261,8 +268,8 @@ changeUploadingSta(tab) { .subscribe((data) => { console.log("NSlist-vfc-->",data); console.log("NSlist-length-vfc-->",data.length); - this.vfcData = data; - this.tableData = this.vfcData; + this.nsvfcData = data; + this.nstableData = this.nsvfcData }, (err) => { console.log(err); }) @@ -271,13 +278,13 @@ changeUploadingSta(tab) { .subscribe((data) => { console.log('NSlist-sdc-->',data); console.log("NSlist-length-vfc-->",data.length); - this.sdcData = data; - if (this.vfcData.length != 0 && this.sdcData.length != 0){ - this.tableData = this.MergeArray(this.vfcData, this.sdcData) //Array deduplication - }else if(this.vfcData.length === 0 && this.sdcData.length != 0){ - this.tableData = this.vfcData.concat(this.sdcData); //Array concat - }else if(this.vfcData.length != 0 && this.sdcData.length === 0){ - this.tableData = this.vfcData.concat(this.sdcData); //Array concat + this.nssdcData = data; + if (this.nsvfcData.length != 0 && this.nssdcData.length != 0){ + this.nstableData = this.MergeArray(this.nsvfcData, this.nssdcData) //Array deduplication + }else if(this.nsvfcData.length === 0 && this.nssdcData.length != 0){ + this.nstableData = this.nsvfcData.concat(this.nssdcData); //Array concat + }else if(this.nsvfcData.length != 0 && this.nssdcData.length === 0){ + this.nstableData = this.nsvfcData.concat(this.nssdcData); //Array concat } }, (err) => { console.log(err); @@ -292,8 +299,8 @@ changeUploadingSta(tab) { .subscribe((data) => { console.log("vnfList--vnf>", data); console.log("vnfList--vnf>", data.length); - this.vfcData = data; - this.tableData = this.vfcData; + this.vnfvfcData = data; + this.vnftableData = this.vnfvfcData }, (err) => { console.log(err); }) @@ -303,13 +310,14 @@ changeUploadingSta(tab) { .subscribe((data) => { console.log('vnfList-sdc-->', data) console.log('vnfList-sdc-->', data.length) - this.sdcData = data; - if (this.vfcData.length != 0 && this.sdcData.length != 0){ - this.tableData = this.MergeArray(this.vfcData, this.sdcData) //Array deduplication - }else if(this.vfcData.length === 0 && this.sdcData.length != 0){ - this.tableData = this.vfcData.concat(this.sdcData); //Array concat - }else if(this.vfcData.length != 0 && this.sdcData.length === 0){ - this.tableData = this.vfcData.concat(this.sdcData); //Array concat + this.vnfsdcData = data; + if (this.vnfvfcData.length != 0 && this.vnfsdcData.length != 0){ + this.vnftableData = this.MergeArray(this.vnfvfcData, this.vnfsdcData) //Array deduplication + }else if(this.vnfvfcData.length === 0 && this.vnfsdcData.length != 0){ + this.vnftableData = this.vnfvfcData.concat(this.vnfsdcData); //Array concat + }else if(this.vnfvfcData.length != 0 && this.vnfsdcData.length === 0){ + this.vnftableData = this.vnfvfcData.concat(this.vnfsdcData); //Array concat + console.log(this.vnftableData) } }, (err) => { console.log(err); @@ -322,7 +330,7 @@ changeUploadingSta(tab) { .subscribe((data) => { console.log("pnfList-->", data); console.log("pnfList-->", data.length); - this.tableData = data; + this.pnftableData = data; }, (err) => { console.log(err); }) -- cgit 1.2.3-korg