|
|
|
@ -398,6 +398,9 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
//复制素材
|
|
|
|
|
copyAsset(){ |
|
|
|
|
this.canvas.copy() |
|
|
|
|
// console.log(1,this.canvasData.originalcompanyBuildingData)
|
|
|
|
|
// console.log(2,this.canvasData.originaleveryStoreyData)
|
|
|
|
|
// console.log(3,this.selectingSitePlan.id)
|
|
|
|
|
} |
|
|
|
|
//粘贴素材
|
|
|
|
|
pasteAsset(){ |
|
|
|
@ -448,23 +451,45 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
let CompanyData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); |
|
|
|
|
CompanyData.data = JSON.stringify(CompanyData.data) |
|
|
|
|
|
|
|
|
|
let object = this.canvasData.originalcompanyBuildingData.data |
|
|
|
|
let adjoinArr = [] //毗邻数组
|
|
|
|
|
|
|
|
|
|
for (const key in object) { |
|
|
|
|
if (object[key].FloorId == this.selectingSitePlan.id && object[key].Name == "毗邻") {//如果是相同楼层,则筛选出毗邻
|
|
|
|
|
|
|
|
|
|
object[key].PropertyInfos.forEach(element => { |
|
|
|
|
if(element.PropertyName == "方向"){ |
|
|
|
|
adjoinArr.push(element.PropertyValue) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if((new Set(adjoinArr)).size != adjoinArr.length){ |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存失败,毗邻存在相同方向','确定',config); |
|
|
|
|
return false |
|
|
|
|
}else{ |
|
|
|
|
if(this.checkedBuildingIndex==-1){ |
|
|
|
|
this.http.post("/api/CompanyAccount/SitePlanData",SitePlanData).subscribe(data => { |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('平面图数据保存成功','确定',config); |
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
},err=>{ |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('平面图数据保存失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.http.post("/api/CompanyAccount/CompanyData",CompanyData).subscribe(data => { |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('单位数据保存成功','确定',config); |
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
},err=>{ |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
@ -476,18 +501,19 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('平面图数据保存成功','确定',config); |
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
},err=>{ |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('平面图数据保存失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.http.post("/api/CompanyAccount/BuildingData",CompanyData).subscribe(data => { |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('单位数据保存成功','确定',config); |
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
},err=>{ |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
@ -495,6 +521,10 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.snackBar.open('单位数据保存失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -626,7 +656,6 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
if (!element.parentId) { treeData.push(element) } |
|
|
|
|
}); |
|
|
|
|
this.dataSource.data = treeData |
|
|
|
|
// console.log(this.dataSource.data)
|
|
|
|
|
this.treeControl.expandAll() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|