diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index af298b3..d273b75 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -687,14 +687,22 @@ export class CollectionToolsComponent implements OnInit { this.canvasData.updateBuildingData() if (this.selectingSitePlan && this.selectingSitePlan.id) { + //遍历 建筑数据 删除多余数据 + let object = this.canvasData.originalcompanyBuildingData.data + let adjoinArr = [] //毗邻数组 + Object.keys(object).forEach(key=>{ + let isExist = this.sitePlanData.find(item=>{ return item.id === object[key].FloorId }) + if (isExist === undefined) { + console.log(object[key],'当前楼层已被删除') + delete object[key] + } + }) + //遍历 建筑数据 删除多余数据 this.saveNum = [] let SitePlanData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData)); SitePlanData.data = JSON.stringify(SitePlanData.data) let CompanyData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); CompanyData.data = JSON.stringify(CompanyData.data) - - let object = this.canvasData.originaleveryStoreyData.data - let adjoinArr = [] //毗邻数组 for (const key in object) { if (object[key].Name == "毗邻") {//如果是相同楼层,则筛选出毗邻