From ca06a122e5ccc0a9465e916b834f9255ac52c0e3 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Fri, 5 Mar 2021 09:04:00 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E5=AE=8C=E5=96=84=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E4=BF=A1=E6=81=AF=E9=A1=B5=E9=9D=A2=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/ui/basicinfo/basicinfo.component.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app/ui/basicinfo/basicinfo.component.ts b/src/app/ui/basicinfo/basicinfo.component.ts index c9ffca5..ec569af 100644 --- a/src/app/ui/basicinfo/basicinfo.component.ts +++ b/src/app/ui/basicinfo/basicinfo.component.ts @@ -100,8 +100,10 @@ export class BasicinfoComponent implements OnInit { element.data = [] }); this.houses = data - // console.log('单位下所有建筑',data) - this.getBuildingInfo() + + if(this.houses.length != 0){ + this.getBuildingInfo() + } }) } @@ -508,8 +510,10 @@ export class BasicinfoComponent implements OnInit { selectedTabChange(e){ // console.log(e) this.selectedBuildingIndex = e.index - if((this.houses[this.selectedBuildingIndex].data && !this.houses[this.selectedBuildingIndex].data.length) || !this.houses[this.selectedBuildingIndex].data){ - this.getBuildingInfo() + if(this.houses.length != 0){ + if((this.houses[this.selectedBuildingIndex].data && !this.houses[this.selectedBuildingIndex].data.length) || !this.houses[this.selectedBuildingIndex].data){ + this.getBuildingInfo() + } } } //表格加一行