|
|
@ -233,7 +233,6 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
if (!this.isGis) { |
|
|
|
if (!this.isGis) { |
|
|
|
this.canvas.refreshIcon(this.canvasAssetObj.Id) |
|
|
|
this.canvas.refreshIcon(this.canvasAssetObj.Id) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
//素材高度输入框改变
|
|
|
|
//素材高度输入框改变
|
|
|
|
assetHeightIunput() { |
|
|
|
assetHeightIunput() { |
|
|
@ -705,7 +704,6 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
let buildingId = this.beforeOneCheckedBuilding.id |
|
|
|
let buildingId = this.beforeOneCheckedBuilding.id |
|
|
|
let floorId = this.selectingSitePlan.id |
|
|
|
let floorId = this.selectingSitePlan.id |
|
|
|
this.canvas.paste(companyId, buildingId, floorId) |
|
|
|
this.canvas.paste(companyId, buildingId, floorId) |
|
|
|
// this.renovateTreeData(false)
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
//截图
|
|
|
|
//截图
|
|
|
|
takeScreenshot() { |
|
|
|
takeScreenshot() { |
|
|
@ -781,6 +779,7 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
saveNum: any = [] |
|
|
|
saveNum: any = [] |
|
|
|
saveSite() { |
|
|
|
saveSite() { |
|
|
|
//更新用于统计的数据
|
|
|
|
//更新用于统计的数据
|
|
|
|
|
|
|
|
|
|
|
|
this.canvasData.updateBuildingData() |
|
|
|
this.canvasData.updateBuildingData() |
|
|
|
|
|
|
|
|
|
|
|
if (this.selectingSitePlan && this.selectingSitePlan.id) { |
|
|
|
if (this.selectingSitePlan && this.selectingSitePlan.id) { |
|
|
@ -793,12 +792,11 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
CompanyData.data = JSON.stringify(CompanyData.data) |
|
|
|
CompanyData.data = JSON.stringify(CompanyData.data) |
|
|
|
|
|
|
|
|
|
|
|
let object = this.canvasData.originalcompanyBuildingData.data |
|
|
|
let object = this.canvasData.originalcompanyBuildingData.data |
|
|
|
|
|
|
|
console.log('建筑数据',object) |
|
|
|
let adjoinArr = [] //毗邻数组
|
|
|
|
let adjoinArr = [] //毗邻数组
|
|
|
|
|
|
|
|
|
|
|
|
if (this.pattern) {//如果是基本信息编辑模式
|
|
|
|
if (this.pattern) {//如果是基本信息编辑模式
|
|
|
|
for (const key in object) { |
|
|
|
for (const key in object) { |
|
|
|
if (object[key].Name == "毗邻") {//如果是相同楼层,则筛选出毗邻
|
|
|
|
if (object[key].Name == "毗邻") {//如果是相同楼层,则筛选出毗邻
|
|
|
|
|
|
|
|
|
|
|
|
object[key].PropertyInfos.forEach(element => { |
|
|
|
object[key].PropertyInfos.forEach(element => { |
|
|
|
if (element.PropertyName == "方向") { |
|
|
|
if (element.PropertyName == "方向") { |
|
|
|
adjoinArr.push(element.PropertyValue) |
|
|
|
adjoinArr.push(element.PropertyValue) |
|
|
@ -806,6 +804,7 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log('adjoinArr',adjoinArr) |
|
|
|
if ((new Set(adjoinArr)).size != adjoinArr.length) { |
|
|
|
if ((new Set(adjoinArr)).size != adjoinArr.length) { |
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
let config = new MatSnackBarConfig(); |
|
|
@ -816,7 +815,6 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
//如果是单位 总平面图
|
|
|
|
//如果是单位 总平面图
|
|
|
|
if (this.checkedBuildingIndex == -1) { |
|
|
|
if (this.checkedBuildingIndex == -1) { |
|
|
|
|
|
|
|
|
|
|
|
if (this.isGis) { |
|
|
|
if (this.isGis) { |
|
|
|
let data = JSON.parse(JSON.stringify(this.selectingSitePlan)) |
|
|
|
let data = JSON.parse(JSON.stringify(this.selectingSitePlan)) |
|
|
|
data.zoomLevel = this.map.getZoom(), |
|
|
|
data.zoomLevel = this.map.getZoom(), |
|
|
@ -865,6 +863,9 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
//保存建筑数据
|
|
|
|
//保存建筑数据
|
|
|
|
|
|
|
|
// console.log('CompanyData',CompanyData)
|
|
|
|
|
|
|
|
CompanyData.data = "{\"图例\":{\"Id\":\"图例\",\"Name\":\"图例\",\"Angle\":0,\"Color\":\"#066EED80\",\"Point\":{\"x\":200,\"y\":200},\"Scale\":1,\"Width\":32,\"Border\":null,\"Height\":32,\"PivotX\":0,\"PivotY\":0,\"Enabled\":true,\"FloorId\":\"60d43256660b093f1c3b5aa5\",\"DrawMode\":null,\"FillMode\":null,\"GameMode\":0,\"ImageUrl\":null,\"FixedSize\":null,\"Thickness\":null,\"MultiPoint\":null,\"TemplateId\":null,\"FireElementId\":null,\"PropertyInfos\":[{\"Tag\":\"\",\"Order\":0,\"Enabled\":true,\"Visible\":true,\"Required\":false,\"RuleName\":\"\",\"RuleValue\":\"\",\"PhysicalUnit\":\"\",\"PropertyName\":\"列\",\"PropertyType\":2,\"PropertyValue\":\"2\"}],\"IsFromBuilding\":null,\"InteractiveMode\":null}}" |
|
|
|
|
|
|
|
|
|
|
|
this.http.post("/api/CompanyData", CompanyData, { |
|
|
|
this.http.post("/api/CompanyData", CompanyData, { |
|
|
|
params: { |
|
|
|
params: { |
|
|
|
companyId: this.params.companyId |
|
|
|
companyId: this.params.companyId |
|
|
@ -954,7 +955,6 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
}).subscribe(data => { |
|
|
|
}).subscribe(data => { |
|
|
|
this.saveNum.push("1") |
|
|
|
this.saveNum.push("1") |
|
|
|
if (this.saveNum.length == 5) { |
|
|
|
if (this.saveNum.length == 5) { |
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
this.canvasData.isChange = false |
|
|
|
this.canvasData.isChange = false |
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
let config = new MatSnackBarConfig(); |
|
|
@ -1239,7 +1239,6 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
storeyData //将建筑素材和当前楼层素材合二为一
|
|
|
|
storeyData //将建筑素材和当前楼层素材合二为一
|
|
|
|
//处理 tree 数据结构
|
|
|
|
//处理 tree 数据结构
|
|
|
|
handleTreeData(storeyData) { |
|
|
|
handleTreeData(storeyData) { |
|
|
|
|
|
|
|
|
|
|
|
this.storeyData = storeyData |
|
|
|
this.storeyData = storeyData |
|
|
|
let data = this.allFireElements //所有消防要素模板
|
|
|
|
let data = this.allFireElements //所有消防要素模板
|
|
|
|
let treeData = [] //tree型 处理完成后的数据
|
|
|
|
let treeData = [] //tree型 处理完成后的数据
|
|
|
@ -1387,8 +1386,6 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
//封装 刷新 tree 数据
|
|
|
|
//封装 刷新 tree 数据
|
|
|
|
async renovateTreeData(isRefresh: boolean = true) { |
|
|
|
async renovateTreeData(isRefresh: boolean = true) { |
|
|
|
// this.allFireElements[this.allFireElements.length-1].children = []
|
|
|
|
|
|
|
|
console.log(888, this.selectingSitePlan) |
|
|
|
|
|
|
|
if (!this.selectingSitePlan.isGis) { |
|
|
|
if (!this.selectingSitePlan.isGis) { |
|
|
|
isRefresh ? await this.canvas.refresh() : null |
|
|
|
isRefresh ? await this.canvas.refresh() : null |
|
|
|
this.canvas.setNameVisible(this.basicInfo, 0) |
|
|
|
this.canvas.setNameVisible(this.basicInfo, 0) |
|
|
@ -1421,7 +1418,6 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
map: any |
|
|
|
map: any |
|
|
|
toLoadGis() { |
|
|
|
toLoadGis() { |
|
|
|
console.log(666666, this.isGis) |
|
|
|
|
|
|
|
this.map = new AMap.Map('planContainer', { |
|
|
|
this.map = new AMap.Map('planContainer', { |
|
|
|
viewMode: '2D', // 默认使用 2D 模式,如果希望使用带有俯仰角的 3D 模式,请设置 viewMode: '3D',
|
|
|
|
viewMode: '2D', // 默认使用 2D 模式,如果希望使用带有俯仰角的 3D 模式,请设置 viewMode: '3D',
|
|
|
|
zoom: 11, //初始化地图层级
|
|
|
|
zoom: 11, //初始化地图层级
|
|
|
@ -1490,12 +1486,6 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//陈鹏飞↓↓↓
|
|
|
|
//陈鹏飞↓↓↓
|
|
|
|
//陈鹏飞↓↓↓
|
|
|
|
//陈鹏飞↓↓↓
|
|
|
|
//陈鹏飞↓↓↓
|
|
|
|
//陈鹏飞↓↓↓
|
|
|
@ -1837,29 +1827,13 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
const isDelete = confirm('您确定要删除吗'); |
|
|
|
const isDelete = confirm('您确定要删除吗'); |
|
|
|
if (isDelete) { |
|
|
|
if (isDelete) { |
|
|
|
if (this.checkedBuildingIndex == -1) { //总平面图
|
|
|
|
if (this.checkedBuildingIndex == -1) { //总平面图
|
|
|
|
let isHave = this.canvasData.allDisposalNode.find(items => { return items.sitePlanId === item.id }) |
|
|
|
|
|
|
|
if (isHave == undefined) { |
|
|
|
|
|
|
|
this.http.delete(`/api/SitePlans/${item.id}`).subscribe(data => { |
|
|
|
this.http.delete(`/api/SitePlans/${item.id}`).subscribe(data => { |
|
|
|
this.deleteShareData(item, -1) |
|
|
|
this.deleteShareData(item, -1) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
|
|
|
config.duration = 3000 |
|
|
|
|
|
|
|
this.snackBar.open('含有数据节点的楼层不允许删除', '确定', config); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { //楼层/区域
|
|
|
|
} else { //楼层/区域
|
|
|
|
let isHave = this.canvasData.allDisposalNode.find(items => { return items.buildingAreaId === item.id }) |
|
|
|
|
|
|
|
if (isHave == undefined) { |
|
|
|
|
|
|
|
this.http.delete(`/api/BuildingAreas/${item.id}`).subscribe(data => { |
|
|
|
this.http.delete(`/api/BuildingAreas/${item.id}`).subscribe(data => { |
|
|
|
this.deleteShareData(item, 1) |
|
|
|
this.deleteShareData(item, 1) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
|
|
|
config.duration = 3000 |
|
|
|
|
|
|
|
this.snackBar.open('含有数据节点的楼层不允许删除', '确定', config); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1878,13 +1852,17 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
delete data.data[key] |
|
|
|
delete data.data[key] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log('删除e',e) |
|
|
|
|
|
|
|
console.log('删除建筑数据',data) |
|
|
|
let newData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); |
|
|
|
let newData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); |
|
|
|
newData.data = JSON.stringify(newData.data) // 转换JSON 数据格式
|
|
|
|
newData.data = JSON.stringify(newData.data) // 转换JSON 数据格式
|
|
|
|
this.selectingSitePlan = this.sitePlanData[0] || {} |
|
|
|
this.selectingSitePlan = this.sitePlanData[0] || {} |
|
|
|
|
|
|
|
this.sitePlanData[0] ? this.isGis = this.sitePlanData[0].isGis : null |
|
|
|
this.canvasData.selectStorey = this.sitePlanData[0] || {} //服务中 存一份数据
|
|
|
|
this.canvasData.selectStorey = this.sitePlanData[0] || {} //服务中 存一份数据
|
|
|
|
this.selectSitePlanIndex = 0 |
|
|
|
this.selectSitePlanIndex = 0 |
|
|
|
this.canvasData.isChange = false |
|
|
|
this.canvasData.isChange = false |
|
|
|
if (isCompany === -1) { |
|
|
|
if (isCompany === -1) { |
|
|
|
|
|
|
|
console.log('保存建筑数据',newData) |
|
|
|
this.http.post("/api/CompanyData", newData).subscribe(data => { }) |
|
|
|
this.http.post("/api/CompanyData", newData).subscribe(data => { }) |
|
|
|
this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据
|
|
|
|
this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据
|
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -1918,6 +1896,12 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
item.name = item.name + '(副本)' |
|
|
|
item.name = item.name + '(副本)' |
|
|
|
item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1 |
|
|
|
item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1 |
|
|
|
this.http.post('/api/SitePlans', item).subscribe((data: any) => { |
|
|
|
this.http.post('/api/SitePlans', item).subscribe((data: any) => { |
|
|
|
|
|
|
|
for (const key in paramsData) { |
|
|
|
|
|
|
|
if (Object.prototype.hasOwnProperty.call(paramsData, key)) { |
|
|
|
|
|
|
|
const element = paramsData[key]; |
|
|
|
|
|
|
|
element.FloorId = data.id |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
let newData = { |
|
|
|
let newData = { |
|
|
|
version: "2.0", |
|
|
|
version: "2.0", |
|
|
|
id: "", |
|
|
|
id: "", |
|
|
@ -1974,6 +1958,12 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
item.name = item.name + '(副本)' |
|
|
|
item.name = item.name + '(副本)' |
|
|
|
item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1 |
|
|
|
item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1 |
|
|
|
this.http.post('/api/BuildingAreas', item, { params: this.params }).subscribe((data: any) => { |
|
|
|
this.http.post('/api/BuildingAreas', item, { params: this.params }).subscribe((data: any) => { |
|
|
|
|
|
|
|
for (const key in paramsData) { |
|
|
|
|
|
|
|
if (Object.prototype.hasOwnProperty.call(paramsData, key)) { |
|
|
|
|
|
|
|
const element = paramsData[key]; |
|
|
|
|
|
|
|
element.FloorId = data.id |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
let newData = { |
|
|
|
let newData = { |
|
|
|
version: "2.0", |
|
|
|
version: "2.0", |
|
|
|
id: "", |
|
|
|
id: "", |
|
|
@ -2217,8 +2207,7 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
// console.log('选中图片',this.selectImage)
|
|
|
|
// console.log('选中图片',this.selectImage)
|
|
|
|
this.selectImageIndex = index |
|
|
|
this.selectImageIndex = index |
|
|
|
if (this.isGis) { |
|
|
|
if (this.isGis) { |
|
|
|
console.log(this.map) |
|
|
|
// console.log(this.map)
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.canvasData.selectTemplateData = items |
|
|
|
this.canvasData.selectTemplateData = items |
|
|
|
this.canvas.beginPaint() |
|
|
|
this.canvas.beginPaint() |
|
|
@ -2272,6 +2261,7 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
let itemData = JSON.parse(JSON.stringify(this.selectImage)) |
|
|
|
let itemData = JSON.parse(JSON.stringify(this.selectImage)) |
|
|
|
itemData.id = id |
|
|
|
itemData.id = id |
|
|
|
itemData.point = { x: e.lnglat.lng, y: e.lnglat.lat } |
|
|
|
itemData.point = { x: e.lnglat.lng, y: e.lnglat.lat } |
|
|
|
|
|
|
|
itemData.floorId = this.selectingSitePlan.id |
|
|
|
itemData = this.canvasData.deserialize(JSON.stringify(itemData))//反序列化为大写
|
|
|
|
itemData = this.canvasData.deserialize(JSON.stringify(itemData))//反序列化为大写
|
|
|
|
// 添加楼层数据
|
|
|
|
// 添加楼层数据
|
|
|
|
this.canvasData.originaleveryStoreyData.data[id] = itemData; |
|
|
|
this.canvasData.originaleveryStoreyData.data[id] = itemData; |
|
|
@ -2291,7 +2281,7 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
seekPanelPoint(paramsData) { |
|
|
|
seekPanelPoint(paramsData) { |
|
|
|
this.checkedBuildingIndex = paramsData.buildingIndex |
|
|
|
this.checkedBuildingIndex = paramsData.buildingIndex |
|
|
|
if (paramsData.buildingIndex == -1) { //总平面图时
|
|
|
|
if (paramsData.buildingIndex == -1) { //总平面图时
|
|
|
|
console.log('走了1') |
|
|
|
// console.log('走了1')
|
|
|
|
this.beforeOneCheckedBuilding = { name: "总平面图" } |
|
|
|
this.beforeOneCheckedBuilding = { name: "总平面图" } |
|
|
|
let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //获取单位下 消防要素
|
|
|
|
let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //获取单位下 消防要素
|
|
|
|
let planData = this.getSitePlanCompanyData() //获取 单位 数据
|
|
|
|
let planData = this.getSitePlanCompanyData() //获取 单位 数据
|
|
|
@ -2306,15 +2296,15 @@ export class CollectionToolsPlanComponent implements OnInit { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) //get
|
|
|
|
}) //get
|
|
|
|
} else { //建筑时
|
|
|
|
} else { //建筑时
|
|
|
|
console.log('走了2') |
|
|
|
// console.log('走了2')
|
|
|
|
console.log('allBuildings', this.allBuildings) |
|
|
|
// console.log('allBuildings', this.allBuildings)
|
|
|
|
console.log('paramsData', paramsData) |
|
|
|
// console.log('paramsData', paramsData)
|
|
|
|
this.beforeOneCheckedBuilding = this.allBuildings[paramsData.buildingIndex] |
|
|
|
this.beforeOneCheckedBuilding = this.allBuildings[paramsData.buildingIndex] |
|
|
|
let params = { buildingId: this.beforeOneCheckedBuilding.id } |
|
|
|
let params = { buildingId: this.beforeOneCheckedBuilding.id } |
|
|
|
let fireData = this.getFireElements(this.beforeOneCheckedBuilding.buildingTypes[0].id || '') //获取建筑下 消防要素
|
|
|
|
let fireData = this.getFireElements(this.beforeOneCheckedBuilding.buildingTypes[0].id || '') //获取建筑下 消防要素
|
|
|
|
let planData = this.getBuildingData(params) //获取 建筑 数据
|
|
|
|
let planData = this.getBuildingData(params) //获取 建筑 数据
|
|
|
|
this.http.get('/api/BuildingAreas', { params }).subscribe(data => { |
|
|
|
this.http.get('/api/BuildingAreas', { params }).subscribe(data => { |
|
|
|
console.log('BuildingAreas', data) |
|
|
|
// console.log('BuildingAreas', data)
|
|
|
|
this.sitePlanData = data |
|
|
|
this.sitePlanData = data |
|
|
|
let index = this.sitePlanData.findIndex(item => { return item.id === paramsData.storeyId }) |
|
|
|
let index = this.sitePlanData.findIndex(item => { return item.id === paramsData.storeyId }) |
|
|
|
this.selectingSitePlan = this.sitePlanData[index] || {} |
|
|
|
this.selectingSitePlan = this.sitePlanData[index] || {} |
|
|
|