|
|
|
@ -811,6 +811,7 @@ export class CollectionToolsPlanComponent implements OnInit {
|
|
|
|
|
//遍历 建筑数据 删除多余数据
|
|
|
|
|
let object = this.canvasData.originalcompanyBuildingData.data |
|
|
|
|
let adjoinArr = [] //毗邻数组
|
|
|
|
|
console.log('平面图数据',this.sitePlanData) |
|
|
|
|
Object.keys(object).forEach(key => { |
|
|
|
|
let isExist = this.sitePlanData.find(item => { return item.id === object[key].FloorId }) |
|
|
|
|
if (isExist === undefined) { |
|
|
|
@ -818,7 +819,7 @@ export class CollectionToolsPlanComponent implements OnInit {
|
|
|
|
|
delete object[key] |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
//遍历 建筑数据 删除多余数据
|
|
|
|
|
//遍历 楼层数据 删除多余数据
|
|
|
|
|
this.saveNum = [] |
|
|
|
|
let SitePlanData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData)); |
|
|
|
|
for (const key in SitePlanData.data) { |
|
|
|
@ -837,9 +838,9 @@ export class CollectionToolsPlanComponent implements OnInit {
|
|
|
|
|
CompanyData.data = JSON.stringify(CompanyData.data) |
|
|
|
|
|
|
|
|
|
if (this.pattern) {//如果是基本信息编辑模式
|
|
|
|
|
console.log(1234, object) |
|
|
|
|
for (const key in object) { |
|
|
|
|
if (object[key].Name == "毗邻") {//如果是相同楼层,则筛选出毗邻
|
|
|
|
|
|
|
|
|
|
object[key].PropertyInfos.forEach(element => { |
|
|
|
|
if (element.PropertyName == "方向") { |
|
|
|
|
adjoinArr.push(element.PropertyValue) |
|
|
|
@ -857,7 +858,7 @@ export class CollectionToolsPlanComponent implements OnInit {
|
|
|
|
|
} else { |
|
|
|
|
//如果是单位 总平面图
|
|
|
|
|
if (this.checkedBuildingIndex == -1) { |
|
|
|
|
|
|
|
|
|
//保存中心点和层级
|
|
|
|
|
if (this.isGis) { |
|
|
|
|
let data = JSON.parse(JSON.stringify(this.selectingSitePlan)) |
|
|
|
|
data.zoomLevel = this.map.getZoom(), |
|
|
|
@ -1014,129 +1015,6 @@ export class CollectionToolsPlanComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} else { //如果是建筑
|
|
|
|
|
|
|
|
|
|
//建筑平面图数据
|
|
|
|
|
this.http.post("/api/BuildingAreaData", SitePlanData, { |
|
|
|
|
params: { |
|
|
|
|
companyId: this.params.companyId |
|
|
|
|
} |
|
|
|
|
}).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if (this.saveNum.length == 5) { |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存成功', '确定', config); |
|
|
|
|
this.tabbarService.sendMessage('changeScore'); |
|
|
|
|
} |
|
|
|
|
}, err => { |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
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.maskLayerService.sendMessage(false) |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存成功', '确定', config); |
|
|
|
|
this.tabbarService.sendMessage('changeScore'); |
|
|
|
|
} |
|
|
|
|
}, err => { |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
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.maskLayerService.sendMessage(false) |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存成功', '确定', config); |
|
|
|
|
this.tabbarService.sendMessage('changeScore'); |
|
|
|
|
} |
|
|
|
|
}, err => { |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
if (err == 'infos 有重复方向!') { |
|
|
|
|
this.snackBar.open('建筑毗邻同步失败,存在相同方向', '确定', config); |
|
|
|
|
} else { |
|
|
|
|
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.maskLayerService.sendMessage(false) |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存成功', '确定', config); |
|
|
|
|
this.tabbarService.sendMessage('changeScore'); |
|
|
|
|
} |
|
|
|
|
}, err => { |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
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.maskLayerService.sendMessage(false) |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存成功', '确定', config); |
|
|
|
|
this.tabbarService.sendMessage('changeScore'); |
|
|
|
|
} |
|
|
|
|
}, err => { |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('建筑消防设施素材同步失败', '确定', config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -2344,7 +2222,9 @@ export class CollectionToolsPlanComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
//将图标数据添加
|
|
|
|
|
let itemData = JSON.parse(JSON.stringify(this.selectImage)) |
|
|
|
|
console.log(6666,this.selectingSitePlan) |
|
|
|
|
itemData.id = id |
|
|
|
|
itemData.FloorId = this.selectingSitePlan.id |
|
|
|
|
itemData.point = { x: e.lnglat.lng, y: e.lnglat.lat } |
|
|
|
|
itemData = this.canvasData.deserialize(JSON.stringify(itemData))//反序列化为大写
|
|
|
|
|
// 添加楼层数据
|
|
|
|
|