|
|
|
@ -149,10 +149,6 @@ export class CollectionToolsPlanComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
pattern:boolean = true//默认为基本信息编辑
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yyy(){ |
|
|
|
|
console.log(this.canvasData.selectPanelPoint) |
|
|
|
|
} |
|
|
|
|
//基本信息编辑模式
|
|
|
|
|
baseInfo(){ |
|
|
|
|
if (!this.pattern) { |
|
|
|
@ -223,14 +219,11 @@ export class CollectionToolsPlanComponent implements OnInit {
|
|
|
|
|
targetNodeData.forEach(i => { |
|
|
|
|
idArr.push(i.id) |
|
|
|
|
}) |
|
|
|
|
console.log(6666666666666,event); |
|
|
|
|
if(this.pos == 0 && event.node.origin.children.length == 1){ |
|
|
|
|
console.log("移入,没有兄弟") |
|
|
|
|
let key = event.dragNode.key |
|
|
|
|
orders[key] = 0 |
|
|
|
|
parentId = event.node.key |
|
|
|
|
}else{ |
|
|
|
|
console.log("移入,多个兄弟") |
|
|
|
|
let array = [] |
|
|
|
|
targetNodeData.forEach(item => { |
|
|
|
|
if(item.id != event.dragNode.key){ //将拖动项先移除掉
|
|
|
|
@ -238,13 +231,10 @@ export class CollectionToolsPlanComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(event.dragNode.isEnd[event.dragNode.isEnd.length - 1]){ //如果移入到最后一个
|
|
|
|
|
console.log("最后") |
|
|
|
|
array.push(event.dragNode.origin) |
|
|
|
|
}else if(event.dragNode.isStart[event.dragNode.isStart.length - 1]){//如果移入到第一个
|
|
|
|
|
console.log("第一") |
|
|
|
|
array.unshift(event.dragNode.origin) |
|
|
|
|
}else{//如果移入中间位置
|
|
|
|
|
console.log("中间") |
|
|
|
|
array.splice(event.node.origin.order, 0, event.dragNode.origin) |
|
|
|
|
} |
|
|
|
|
array.forEach((item,key) => { |
|
|
|
@ -580,6 +570,13 @@ export class CollectionToolsPlanComponent 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 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -614,11 +611,9 @@ export class CollectionToolsPlanComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
isSixShow = true
|
|
|
|
|
isSixbtn = true //控制想定作业编辑按钮
|
|
|
|
|
isxxx = true //控制查看编辑模式的编辑模式按钮
|
|
|
|
|
isediticon = true //控制查看编辑模式的编辑模式小笔按钮
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
|
|
|
|
|
console.log(this.route,2,this.router.url) |
|
|
|
|
|
|
|
|
|
if(this.router.url.indexOf("keyUnit/viewunitinfo") != -1 || this.router.url.indexOf("keyUnit/editplaninfo")!= -1){ |
|
|
|
|
this.isSixbtn = false |
|
|
|
|
} |
|
|
|
@ -628,17 +623,22 @@ export class CollectionToolsPlanComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
if(!this.isSixbtn && sessionStorage.getItem("six") == "look"){ |
|
|
|
|
this.isEditPattern = false |
|
|
|
|
this.isxxx = false |
|
|
|
|
this.isediticon = false |
|
|
|
|
} |
|
|
|
|
//gis模块平面图
|
|
|
|
|
if(this.router.url.indexOf("gis") != -1 && sessionStorage.getItem("gisplan") == "look"){ |
|
|
|
|
this.isEditPattern = false |
|
|
|
|
this.isediticon = false |
|
|
|
|
this.canvasData.gameMode = GameMode.Assignment |
|
|
|
|
} else { |
|
|
|
|
this.getAllLibrary() //获取素材库
|
|
|
|
|
this.getAllBuildings() //获取所有建筑
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.getAllLibrary() //获取素材库
|
|
|
|
|
this.getAllBuildings() //获取所有建筑
|
|
|
|
|
// this.getAllFirePlan() //获取当前单位灾情
|
|
|
|
|
|
|
|
|
|
let that = this |
|
|
|
|
window.setTimeout(()=>{ |
|
|
|
|
document.getElementById("functionalDomainContent").oncontextmenu = function (event) { |
|
|
|
|
that.canvas.cancelPaint() |
|
|
|
|
// that.canvas.cancelPaint()
|
|
|
|
|
that.selectImageIndex = -1 |
|
|
|
|
event.preventDefault(); |
|
|
|
|
}; |
|
|
|
@ -654,7 +654,10 @@ export class CollectionToolsPlanComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ngAfterViewInit(): void { |
|
|
|
|
this.getSitePlan() |
|
|
|
|
//gis模块平面图
|
|
|
|
|
if(this.router.url.indexOf("gis") == -1) { |
|
|
|
|
this.getSitePlan() |
|
|
|
|
} |
|
|
|
|
// 监听canvas组件选中素材事件
|
|
|
|
|
this.canvas.on("select",obj=>{ |
|
|
|
|
//选中素材属性注入函数
|
|
|
|
@ -723,268 +726,276 @@ export class CollectionToolsPlanComponent 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); |
|
|
|
|
}) |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('单位消防设施素材保存失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}else{ //如果是建筑
|
|
|
|
|
}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.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(saveOneDialogPlan, { |
|
|
|
|
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(saveOneDialogPlan, { |
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1033,14 +1044,40 @@ export class CollectionToolsPlanComponent 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
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//编辑建筑
|
|
|
|
@ -1206,8 +1243,23 @@ export class CollectionToolsPlanComponent 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 = [] |
|
|
|
@ -1456,8 +1508,11 @@ export class CollectionToolsPlanComponent 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) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1632,6 +1687,7 @@ export class CollectionToolsPlanComponent 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) //获取 平面图 楼层数据
|
|
|
|
@ -1779,7 +1835,7 @@ export class CollectionToolsPlanComponent implements OnInit {
|
|
|
|
|
}); |
|
|
|
|
this.allLibrary = data |
|
|
|
|
this.selectImageIndex = -1 |
|
|
|
|
this.canvas.cancelPaint() |
|
|
|
|
// this.canvas.cancelPaint()
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|