|
|
|
@ -739,247 +739,11 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
let adjoinArr = [] //毗邻数组
|
|
|
|
|
|
|
|
|
|
if(this.pattern){//如果是基本信息编辑模式
|
|
|
|
|
for (const key in object) { |
|
|
|
|
if (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/SitePlanData",SitePlanData,{ |
|
|
|
|
params:{ |
|
|
|
|
companyId:this.params.companyId |
|
|
|
|
} |
|
|
|
|
}).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('平面图数据保存失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
//保存建筑数据
|
|
|
|
|
this.http.post("/api/CompanyData",CompanyData,{ |
|
|
|
|
params:{ |
|
|
|
|
companyId:this.params.companyId |
|
|
|
|
} |
|
|
|
|
}).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('单位数据保存失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
//批量保存单位毗邻
|
|
|
|
|
let CompanyAdjoins = this.canvasData.getCompanyAdjoinInfo() |
|
|
|
|
this.http.post("/api/CompanyAdjoins/Batch",CompanyAdjoins,{ |
|
|
|
|
params:{ |
|
|
|
|
companyId:this.params.companyId |
|
|
|
|
} |
|
|
|
|
}).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('单位毗邻保存失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
//批量保存单位重点部位
|
|
|
|
|
let CompanyImportantLocations = this.canvasData.getCompanyImportantLocations() |
|
|
|
|
this.http.post("/api/CompanyImportantLocations/Batch",CompanyImportantLocations,{ |
|
|
|
|
params:{ |
|
|
|
|
companyId:this.params.companyId |
|
|
|
|
} |
|
|
|
|
}).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('单位重点部位保存失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
//批量保存单位消防设施素材
|
|
|
|
|
let CompanyFacilityAssets = this.canvasData.getAllCompanyFacilityAssetInfo() |
|
|
|
|
this.http.post("/api/CompanyFacilityAssets/Batch",CompanyFacilityAssets,{ |
|
|
|
|
params:{ |
|
|
|
|
companyId:this.params.companyId |
|
|
|
|
} |
|
|
|
|
}).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('单位消防设施素材保存失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}else{ //如果是建筑
|
|
|
|
|
|
|
|
|
|
//建筑平面图数据
|
|
|
|
|
this.http.post("/api/BuildingAreaData",SitePlanData,{ |
|
|
|
|
params:{ |
|
|
|
|
companyId:this.params.companyId |
|
|
|
|
} |
|
|
|
|
}).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('平面图数据保存失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
//建筑数据
|
|
|
|
|
this.http.post("/api/BuildingData",CompanyData,{ |
|
|
|
|
params:{ |
|
|
|
|
companyId:this.params.companyId |
|
|
|
|
} |
|
|
|
|
}).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('单位数据保存失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
//批量保存建筑毗邻
|
|
|
|
|
let buildingAdjoins = this.canvasData.getBuildingAdjoinInfo() |
|
|
|
|
this.http.post(`/api/BuildingAdjoins/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingAdjoins).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('建筑毗邻保存失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
//批量保存建筑重点部位
|
|
|
|
|
let buildingImportantLocations = this.canvasData.getBuildingImportantLocations() |
|
|
|
|
this.http.post(`/api/BuildingImportantLocations/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingImportantLocations).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('建筑重点部位保存失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
//批量保存建筑消防设施素材
|
|
|
|
|
let buildingFacilityAssets = this.canvasData.getAllBuildingFacilityAssetInfo() |
|
|
|
|
this.http.post(`/api/BuildingFacilityAssets/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingFacilityAssets).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('建筑消防设施素材保存失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return true |
|
|
|
|
}else{//如果是想定作业编辑模式
|
|
|
|
|
const dialogRef = this.dialog.open(saveOneDialog, { |
|
|
|
|
data: {allDisposalNode: this.canvasData.allDisposalNode, |
|
|
|
|
data: { |
|
|
|
|
allDisposalNode: this.canvasData.allDisposalNode, |
|
|
|
|
selectedBuildingData:this.beforeOneCheckedBuilding, |
|
|
|
|
selectedSiteData:this.selectingSitePlan, |
|
|
|
|
siteOrbuilding:this.checkedBuildingIndex, |
|
|
|
|