Browse Source

保存前清空 已被删除楼层冗余数据

master
陈鹏飞 3 years ago
parent
commit
d1619ac18f
  1. 16
      src/app/ui/collection-tools-building/collection-tools.component.ts

16
src/app/ui/collection-tools-building/collection-tools.component.ts

@ -686,15 +686,23 @@ export class CollectionToolsComponent2 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 == "毗邻") {//如果是相同楼层,则筛选出毗邻

Loading…
Cancel
Save