|
|
|
@ -1204,16 +1204,44 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
if (isDelete) { |
|
|
|
|
if (this.checkedBuildingIndex==-1) { //总平面图
|
|
|
|
|
this.http.delete(`/api/CompanyAccount/SitePlans/${item.id}`).subscribe(data=>{ |
|
|
|
|
this.getSitePlan() |
|
|
|
|
this.deleteShareData(item,-1) |
|
|
|
|
}) |
|
|
|
|
} else { //楼层/区域
|
|
|
|
|
this.http.delete(`/api/CompanyAccount/BuildingAreas/${item.id}`).subscribe(data=>{ |
|
|
|
|
this.getBuildingSitePlan(this.beforeOneCheckedBuilding) |
|
|
|
|
this.deleteShareData(item,1) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//删除当前 单位/建筑的 共享数据中 已删除data
|
|
|
|
|
deleteShareData (e,isCompany) { |
|
|
|
|
this.sitePlanData.forEach((element,index) => { |
|
|
|
|
if (element.id===e.id) { |
|
|
|
|
this.sitePlanData.splice(index,1) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
let data = this.canvasData.originalcompanyBuildingData; |
|
|
|
|
for(let key in data.data){ |
|
|
|
|
if (data.data[key].FloorId === e.id) { //处理 单位/建筑 数据是否归于当前楼层下
|
|
|
|
|
delete data.data[key] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
let newData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); |
|
|
|
|
newData.data = JSON.stringify(newData.data) // 转换JSON 数据格式
|
|
|
|
|
this.selectingSitePlan = this.sitePlanData[0] || {} |
|
|
|
|
this.canvasData.selectStorey = this.sitePlanData[0] || {} //服务中 存一份数据
|
|
|
|
|
this.selectSitePlanIndex = 0 |
|
|
|
|
if (isCompany===-1) { |
|
|
|
|
this.http.post("/api/CompanyAccount/CompanyData",newData).subscribe(data => {}) |
|
|
|
|
this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据
|
|
|
|
|
} else { |
|
|
|
|
this.http.post("/api/CompanyAccount/BuildingData",newData).subscribe(data => {}) |
|
|
|
|
this.getBuildingStorey(this.selectingSitePlan) //获取 建筑 楼层数据
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//复制图层 平面图 楼层/区域
|
|
|
|
|
duplicateLayer (item) { |
|
|
|
|
if (this.checkedBuildingIndex==-1) { //总平面图
|
|
|
|
|