|
|
|
@ -588,6 +588,9 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
companyBuildingData:any; // 单位/建筑 数据 ←消防要素/canvas使用
|
|
|
|
|
everyStoreyData:any; // 总平面图/楼层/区域 楼层数据 ←消防要素/canvas使用
|
|
|
|
|
|
|
|
|
|
originalcompanyBuildingData:any; // 原始数据 单位/建筑 数据
|
|
|
|
|
originaleveryStoreyData:any; // 原始数据 总平面图/楼层/区域
|
|
|
|
|
|
|
|
|
|
toggleExpandPanel:boolean = false; //可展开面板展开或关闭
|
|
|
|
|
togglePlane:boolean = true; //可展开面板平面图 显隐
|
|
|
|
|
toggleMaterialBank:boolean = false; //可展开面板素材库 显隐
|
|
|
|
@ -648,6 +651,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
//获取 单位 数据
|
|
|
|
|
getSitePlanCompanyData () { |
|
|
|
|
this.http.get('/api/CompanyAccount/CompanyData').subscribe((data:any)=>{ |
|
|
|
|
this.originalcompanyBuildingData = JSON.parse(JSON.stringify(data || {})) //深拷贝一份 单位原数据
|
|
|
|
|
if (data) { |
|
|
|
|
this.companyBuildingData = JSON.parse(data.data) |
|
|
|
|
} else { |
|
|
|
@ -660,6 +664,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
getSitePlanStorey (e) { |
|
|
|
|
let params = {sitePlanId: e.id} |
|
|
|
|
this.http.get(`/api/CompanyAccount/SitePlanData`,{params}).subscribe((data:any)=>{ |
|
|
|
|
this.originaleveryStoreyData = JSON.parse(JSON.stringify(data || {})) //深拷贝一份 楼层原数据
|
|
|
|
|
if (data && data.data && this.companyBuildingData) { |
|
|
|
|
data.data = JSON.parse(data.data) |
|
|
|
|
for(let key in this.companyBuildingData){ |
|
|
|
@ -679,6 +684,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
//获取 建筑 数据
|
|
|
|
|
getBuildingData (e) { |
|
|
|
|
this.http.get(`/api/CompanyAccount/BuildingData`,{params:e}).subscribe((data:any)=>{ |
|
|
|
|
this.originalcompanyBuildingData = JSON.parse(JSON.stringify(data || {})) //深拷贝一份 建筑原数据
|
|
|
|
|
if (data) { |
|
|
|
|
this.companyBuildingData = JSON.parse(data.data) |
|
|
|
|
} else { |
|
|
|
@ -691,6 +697,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
getBuildingStorey (e) { |
|
|
|
|
let params = {buildingAreaId: e.id} |
|
|
|
|
this.http.get(`/api/CompanyAccount/BuildingAreaData`,{params}).subscribe((data:any)=>{ |
|
|
|
|
this.originaleveryStoreyData = JSON.parse(JSON.stringify(data || {})) //深拷贝一份 楼层原数据
|
|
|
|
|
if (data && data.data && this.companyBuildingData) { |
|
|
|
|
data.data = JSON.parse(data.data) |
|
|
|
|
for(let key in this.companyBuildingData){ |
|
|
|
@ -838,7 +845,41 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
//复制图层 平面图 楼层/区域
|
|
|
|
|
duplicateLayer (item) { |
|
|
|
|
console.log('复制',item) |
|
|
|
|
if (this.checkedBuildingIndex==-1) { //总平面图
|
|
|
|
|
item.id = "" |
|
|
|
|
item.modifiedTime = new Date() |
|
|
|
|
item.name = item.name + '(副本)' |
|
|
|
|
item.order = this.sitePlanData[this.sitePlanData.length-1].order+1 |
|
|
|
|
this.http.post('/api/CompanyAccount/SitePlans',item).subscribe((data:any)=>{ |
|
|
|
|
let newData = { |
|
|
|
|
version: this.originaleveryStoreyData.version || "1.0", |
|
|
|
|
id: "", |
|
|
|
|
data: this.originaleveryStoreyData.data || null, |
|
|
|
|
sitePlanId: data.id |
|
|
|
|
} |
|
|
|
|
this.http.post('/api/CompanyAccount/SitePlanData',newData).subscribe(data=>{ |
|
|
|
|
this.renovateSitePlan() |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} else { //楼层/区域
|
|
|
|
|
item.id = "" |
|
|
|
|
item.modifiedTime = new Date() |
|
|
|
|
item.name = item.name + '(副本)' |
|
|
|
|
item.order = this.sitePlanData[this.sitePlanData.length-1].order+1 |
|
|
|
|
this.http.post('/api/CompanyAccount/BuildingAreas',item).subscribe((data:any)=>{ |
|
|
|
|
let newData = { |
|
|
|
|
version: this.originaleveryStoreyData.version || "1.0", |
|
|
|
|
id: "", |
|
|
|
|
data: this.originaleveryStoreyData.data || null, |
|
|
|
|
buildingAreaId: data.id |
|
|
|
|
} |
|
|
|
|
this.http.post('/api/CompanyAccount/BuildingAreaData',newData).subscribe(data=>{ |
|
|
|
|
this.renovateBuilding() |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//平面图 楼层/区域 替换底图
|
|
|
|
|