Browse Source

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

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

14
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 == "毗邻") {//如果是相同楼层,则筛选出毗邻

Loading…
Cancel
Save