|
|
|
@ -763,14 +763,40 @@ export class CollectionToolsComponent 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
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//编辑建筑
|
|
|
|
@ -909,7 +935,6 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//子节点跟随父节点的islook变化
|
|
|
|
|
if(node.children && node.children.length != 0){ |
|
|
|
@ -923,9 +948,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.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 = [] |
|
|
|
|