|
|
@ -587,6 +587,13 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
this.gallery.update() |
|
|
|
this.gallery.update() |
|
|
|
}, 0); |
|
|
|
}, 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//将上传的input框显示出来
|
|
|
|
|
|
|
|
this.isImgNumCss = true; |
|
|
|
|
|
|
|
//清除图片缓存
|
|
|
|
|
|
|
|
if((<HTMLInputElement>document.getElementById('inputimg'))){ |
|
|
|
|
|
|
|
(<HTMLInputElement>document.getElementById('inputimg')).value = null //清空input框缓存
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.canvasData.isChange = true |
|
|
|
this.canvasData.isChange = true |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -649,7 +656,7 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
let that = this |
|
|
|
let that = this |
|
|
|
window.setTimeout(()=>{ |
|
|
|
window.setTimeout(()=>{ |
|
|
|
document.getElementById("functionalDomainContent").oncontextmenu = function (event) { |
|
|
|
document.getElementById("functionalDomainContent").oncontextmenu = function (event) { |
|
|
|
that.canvas.cancelPaint() |
|
|
|
// that.canvas.cancelPaint()
|
|
|
|
that.selectImageIndex = -1 |
|
|
|
that.selectImageIndex = -1 |
|
|
|
event.preventDefault(); |
|
|
|
event.preventDefault(); |
|
|
|
}; |
|
|
|
}; |
|
|
@ -736,7 +743,7 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
//保存平面图
|
|
|
|
//保存平面图
|
|
|
|
saveNum :any = [] |
|
|
|
saveNum :any = [] |
|
|
|
saveSite(){ |
|
|
|
saveSite(){ |
|
|
|
console.log(this.beforeOneCheckedBuilding) |
|
|
|
if (this.selectingSitePlan && this.selectingSitePlan.id) { |
|
|
|
this.saveNum = [] |
|
|
|
this.saveNum = [] |
|
|
|
let SitePlanData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData)); |
|
|
|
let SitePlanData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData)); |
|
|
|
SitePlanData.data = JSON.stringify(SitePlanData.data) |
|
|
|
SitePlanData.data = JSON.stringify(SitePlanData.data) |
|
|
@ -999,6 +1006,13 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
console.log('The dialog was closed'); |
|
|
|
console.log('The dialog was closed'); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { //if
|
|
|
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
|
|
|
config.duration = 3000 |
|
|
|
|
|
|
|
this.snackBar.open('暂无楼层数据','确定',config); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//获得所有的建筑物
|
|
|
|
//获得所有的建筑物
|
|
|
@ -1046,6 +1060,12 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
//选择建筑
|
|
|
|
//选择建筑
|
|
|
|
checkedBuilding(item,index){ |
|
|
|
checkedBuilding(item,index){ |
|
|
|
if (this.checkedBuildingIndex!=index) { |
|
|
|
if (this.checkedBuildingIndex!=index) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.canvasData.isChange) { //true 数据被改动
|
|
|
|
|
|
|
|
let isTrue = confirm('是否保存当前编辑数据') |
|
|
|
|
|
|
|
if (isTrue) { //先保存数据 在切换
|
|
|
|
|
|
|
|
let isSuccess = this.saveSite()//true的时候 先保存数据
|
|
|
|
|
|
|
|
if (isSuccess != false) { |
|
|
|
this.beforeOneCheckedBuilding = item |
|
|
|
this.beforeOneCheckedBuilding = item |
|
|
|
this.checkedBuildingIndex = index |
|
|
|
this.checkedBuildingIndex = index |
|
|
|
if (index==-1) { //总平面图数据
|
|
|
|
if (index==-1) { //总平面图数据
|
|
|
@ -1054,6 +1074,26 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
this.getBuildingSitePlan(item) |
|
|
|
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.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上的素材显隐
|
|
|
|
//canvas上的素材显隐
|
|
|
|
let iconVisibleArr:any = [] |
|
|
|
let iconVisibleArr:any = [] |
|
|
@ -1468,8 +1523,11 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
this.canvasData.selectStorey = item //服务中 存一份数据
|
|
|
|
this.canvasData.selectStorey = item //服务中 存一份数据
|
|
|
|
if (this.checkedBuildingIndex==-1) { //总平面图时
|
|
|
|
if (this.checkedBuildingIndex==-1) { //总平面图时
|
|
|
|
this.getSitePlanStorey(item) //获取 平面图 楼层数据
|
|
|
|
this.getSitePlanStorey(item) //获取 平面图 楼层数据
|
|
|
|
|
|
|
|
this.getSitePlanCompanyData() |
|
|
|
} else { //楼层/区域时
|
|
|
|
} else { //楼层/区域时
|
|
|
|
this.getBuildingStorey(item) //获取 建筑 楼层数据
|
|
|
|
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.selectingSitePlan = this.sitePlanData[0] || {} |
|
|
|
this.canvasData.selectStorey = this.sitePlanData[0] || {} //服务中 存一份数据
|
|
|
|
this.canvasData.selectStorey = this.sitePlanData[0] || {} //服务中 存一份数据
|
|
|
|
this.selectSitePlanIndex = 0 |
|
|
|
this.selectSitePlanIndex = 0 |
|
|
|
|
|
|
|
this.canvasData.isChange = false |
|
|
|
if (isCompany===-1) { |
|
|
|
if (isCompany===-1) { |
|
|
|
this.http.post("/api/CompanyData",newData).subscribe(data => {}) |
|
|
|
this.http.post("/api/CompanyData",newData).subscribe(data => {}) |
|
|
|
this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据
|
|
|
|
this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据
|
|
|
@ -1791,7 +1850,7 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.allLibrary = data |
|
|
|
this.allLibrary = data |
|
|
|
this.selectImageIndex = -1 |
|
|
|
this.selectImageIndex = -1 |
|
|
|
this.canvas.cancelPaint() |
|
|
|
// this.canvas.cancelPaint()
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|