|
|
|
@ -587,6 +587,13 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.gallery.update() |
|
|
|
|
}, 0); |
|
|
|
|
|
|
|
|
|
//将上传的input框显示出来
|
|
|
|
|
this.isImgNumCss = true; |
|
|
|
|
//清除图片缓存
|
|
|
|
|
if((<HTMLInputElement>document.getElementById('inputimg'))){ |
|
|
|
|
(<HTMLInputElement>document.getElementById('inputimg')).value = null //清空input框缓存
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -649,7 +656,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
let that = this |
|
|
|
|
window.setTimeout(()=>{ |
|
|
|
|
document.getElementById("functionalDomainContent").oncontextmenu = function (event) { |
|
|
|
|
that.canvas.cancelPaint() |
|
|
|
|
// that.canvas.cancelPaint()
|
|
|
|
|
that.selectImageIndex = -1 |
|
|
|
|
event.preventDefault(); |
|
|
|
|
}; |
|
|
|
@ -736,268 +743,275 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
//保存平面图
|
|
|
|
|
saveNum :any = [] |
|
|
|
|
saveSite(){ |
|
|
|
|
console.log(this.beforeOneCheckedBuilding) |
|
|
|
|
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.originalcompanyBuildingData.data |
|
|
|
|
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 (this.selectingSitePlan && this.selectingSitePlan.id) { |
|
|
|
|
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.originalcompanyBuildingData.data |
|
|
|
|
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 |
|
|
|
|
|
|
|
|
|
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.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 |
|
|
|
|
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.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 |
|
|
|
|
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.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 |
|
|
|
|
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.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 |
|
|
|
|
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.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 |
|
|
|
|
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.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 |
|
|
|
|
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.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 |
|
|
|
|
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.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 |
|
|
|
|
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.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 |
|
|
|
|
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.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('建筑消防设施素材保存失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('建筑消防设施素材保存失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else{//如果是想定作业编辑模式
|
|
|
|
|
const dialogRef = this.dialog.open(saveOneDialog, { |
|
|
|
|
data: {allDisposalNode: this.canvasData.allDisposalNode, |
|
|
|
|
selectedBuildingData:this.beforeOneCheckedBuilding, |
|
|
|
|
selectedSiteData:this.selectingSitePlan, |
|
|
|
|
siteOrbuilding:this.checkedBuildingIndex, |
|
|
|
|
disasterId: this.allFirePlan[0].id || '' |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
|
console.log('The dialog was closed'); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}else{//如果是想定作业编辑模式
|
|
|
|
|
const dialogRef = this.dialog.open(saveOneDialog, { |
|
|
|
|
data: {allDisposalNode: this.canvasData.allDisposalNode, |
|
|
|
|
selectedBuildingData:this.beforeOneCheckedBuilding, |
|
|
|
|
selectedSiteData:this.selectingSitePlan, |
|
|
|
|
siteOrbuilding:this.checkedBuildingIndex, |
|
|
|
|
disasterId: this.allFirePlan[0].id || '' |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
|
console.log('The dialog was closed'); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} else { //if
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('暂无楼层数据','确定',config); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1046,14 +1060,40 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
//选择建筑
|
|
|
|
|
checkedBuilding(item,index){ |
|
|
|
|
if (this.checkedBuildingIndex!=index) { |
|
|
|
|
this.beforeOneCheckedBuilding = item |
|
|
|
|
this.checkedBuildingIndex = index |
|
|
|
|
if (index==-1) { //总平面图数据
|
|
|
|
|
this.getSitePlan() |
|
|
|
|
} else { //建筑楼层/区域数据
|
|
|
|
|
this.getBuildingSitePlan(item) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (this.canvasData.isChange) { //true 数据被改动
|
|
|
|
|
let isTrue = confirm('是否保存当前编辑数据') |
|
|
|
|
if (isTrue) { //先保存数据 在切换
|
|
|
|
|
let isSuccess = this.saveSite()//true的时候 先保存数据
|
|
|
|
|
if (isSuccess != false) { |
|
|
|
|
this.beforeOneCheckedBuilding = item |
|
|
|
|
this.checkedBuildingIndex = index |
|
|
|
|
if (index==-1) { //总平面图数据
|
|
|
|
|
this.getSitePlan() |
|
|
|
|
} else { //建筑楼层/区域数据
|
|
|
|
|
this.getBuildingSitePlan(item) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.beforeOneCheckedBuilding = item |
|
|
|
|
this.checkedBuildingIndex = index |
|
|
|
|
if (index==-1) { //总平面图数据
|
|
|
|
|
this.getSitePlan() |
|
|
|
|
} else { //建筑楼层/区域数据
|
|
|
|
|
this.getBuildingSitePlan(item) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { //flase 数据未被改动
|
|
|
|
|
this.beforeOneCheckedBuilding = item |
|
|
|
|
this.checkedBuildingIndex = index |
|
|
|
|
if (index==-1) { //总平面图数据
|
|
|
|
|
this.getSitePlan() |
|
|
|
|
} else { //建筑楼层/区域数据
|
|
|
|
|
this.getBuildingSitePlan(item) |
|
|
|
|
} |
|
|
|
|
} //if
|
|
|
|
|
|
|
|
|
|
} //if
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//编辑建筑
|
|
|
|
@ -1219,8 +1259,23 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const nodes = this.treeControl.dataNodes; |
|
|
|
|
const expandNodes = []; |
|
|
|
|
nodes.forEach((item) => { |
|
|
|
|
if(item.expandable && this.treeControl.isExpanded(item)){ |
|
|
|
|
expandNodes.push(item.id); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.dataSource.data = [...this.dataSource.data] |
|
|
|
|
this.treeControl.expandAll() |
|
|
|
|
|
|
|
|
|
let newNodes = this.treeControl.dataNodes; |
|
|
|
|
newNodes = newNodes.filter(n => { |
|
|
|
|
return expandNodes.indexOf(n.id) >= 0; |
|
|
|
|
}); |
|
|
|
|
newNodes.forEach(item => { |
|
|
|
|
this.treeControl.expand(item); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
//canvas上的素材显隐
|
|
|
|
|
let iconVisibleArr:any = [] |
|
|
|
@ -1468,8 +1523,11 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.canvasData.selectStorey = item //服务中 存一份数据
|
|
|
|
|
if (this.checkedBuildingIndex==-1) { //总平面图时
|
|
|
|
|
this.getSitePlanStorey(item) //获取 平面图 楼层数据
|
|
|
|
|
this.getSitePlanCompanyData() |
|
|
|
|
} else { //楼层/区域时
|
|
|
|
|
this.getBuildingStorey(item) //获取 建筑 楼层数据
|
|
|
|
|
let params = { buildingId: this.beforeOneCheckedBuilding.id } |
|
|
|
|
this.getBuildingData(params) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1644,6 +1702,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.selectingSitePlan = this.sitePlanData[0] || {} |
|
|
|
|
this.canvasData.selectStorey = this.sitePlanData[0] || {} //服务中 存一份数据
|
|
|
|
|
this.selectSitePlanIndex = 0 |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
if (isCompany===-1) { |
|
|
|
|
this.http.post("/api/CompanyData",newData).subscribe(data => {}) |
|
|
|
|
this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据
|
|
|
|
@ -1791,7 +1850,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
}); |
|
|
|
|
this.allLibrary = data |
|
|
|
|
this.selectImageIndex = -1 |
|
|
|
|
this.canvas.cancelPaint() |
|
|
|
|
// this.canvas.cancelPaint()
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|