Browse Source

[更新]更新编制工具文件

dev
邵佳豪 4 years ago
parent
commit
32504a6f56
  1. 5
      src/app/ui/collection-tools/collection-tools.component.html
  2. 2
      src/app/ui/collection-tools/collection-tools.component.scss
  3. 67
      src/app/ui/collection-tools/collection-tools.component.ts

5
src/app/ui/collection-tools/collection-tools.component.html

@ -135,8 +135,7 @@
</div>
<div [hidden]="!togglePlane" >
<div class="sitePlanContent" *ngFor="let item of sitePlanData;let key = index" [ngClass]="{'isRefugeStorey':item.isRefugeStorey==true,'selectSitePlan': selectSitePlanIndex==key}" (click)='selectSitePlan(item,key)'>
<mat-icon *ngIf="!item.imageUrl" class="matIcons">broken_image</mat-icon>
<label class="overflowText">{{item.name}}</label>
<label class="overflowText" style="display:inline-block; max-width: 160px;"><mat-icon *ngIf="!item.imageUrl" class="matIcons">broken_image</mat-icon>{{item.name}}</label>
<a href="javascript:;" class="fireForce" *ngIf="isEditPattern && !pattern">
<img src="../../../assets/images/fire.png" *ngIf="item.fire && item.fire==2">
<img src="../../../assets/images/noFire.png" *ngIf="item.fire && item.fire==1">
@ -218,7 +217,7 @@
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div id="terrNodePublic" (click)='selectanelPoint(node.origin)' [ngClass]="{'selectanelPoint': selectDisposalNode==node.origin.id}">
<label title="{{node.title}}" class="overflowText textNode">{{node.title}}</label>
<div class="planIconDiv" *ngIf="isEditPattern">
<div class="scoreDiv" *ngIf="isEditPattern">
<mat-icon *ngIf="!node.origin.sitePlanId && !node.origin.buildingAreaId" (click)='editPanelPoint($event,node)'>edit</mat-icon>
<mat-icon *ngIf="node.level===0" (click)='addPanelPoint($event,node.origin,null)'>add</mat-icon>
<mat-icon *ngIf="!node.origin.sitePlanId && !node.origin.buildingAreaId" (click)='copyPanelPoint($event,node,treeData)'>library_books</mat-icon>

2
src/app/ui/collection-tools/collection-tools.component.scss

@ -4,7 +4,7 @@
}
.content {
width: 100%;
height: 93%;
height: 100%;
overflow: hidden;
box-sizing: border-box;
padding: 1px;

67
src/app/ui/collection-tools/collection-tools.component.ts

@ -587,6 +587,13 @@ export class CollectionToolsComponent implements OnInit {
this.gallery.update()
}, 0);
//将上传的input框显示出来
this.isImgNumCss = true;
//清除图片缓存
if((<HTMLInputElement>document.getElementById('inputimg'))){
(<HTMLInputElement>document.getElementById('inputimg')).value = null //清空input框缓存
}
this.canvasData.isChange = true
}
}
@ -649,7 +656,7 @@ export class CollectionToolsComponent implements OnInit {
let that = this
window.setTimeout(()=>{
document.getElementById("functionalDomainContent").oncontextmenu = function (event) {
that.canvas.cancelPaint()
// that.canvas.cancelPaint()
that.selectImageIndex = -1
event.preventDefault();
};
@ -736,7 +743,7 @@ export class CollectionToolsComponent implements OnInit {
//保存平面图
saveNum :any = []
saveSite(){
console.log(this.beforeOneCheckedBuilding)
if (this.selectingSitePlan && this.selectingSitePlan.id) {
this.saveNum = []
let SitePlanData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData));
SitePlanData.data = JSON.stringify(SitePlanData.data)
@ -999,6 +1006,13 @@ export class CollectionToolsComponent implements OnInit {
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){
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.checkedBuildingIndex = index
if (index==-1) { //总平面图数据
@ -1054,6 +1074,26 @@ export class CollectionToolsComponent implements OnInit {
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.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 = []
@ -1468,8 +1523,11 @@ export class CollectionToolsComponent implements OnInit {
this.canvasData.selectStorey = item //服务中 存一份数据
if (this.checkedBuildingIndex==-1) { //总平面图时
this.getSitePlanStorey(item) //获取 平面图 楼层数据
this.getSitePlanCompanyData()
} else { //楼层/区域时
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.canvasData.selectStorey = this.sitePlanData[0] || {} //服务中 存一份数据
this.selectSitePlanIndex = 0
this.canvasData.isChange = false
if (isCompany===-1) {
this.http.post("/api/CompanyData",newData).subscribe(data => {})
this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据
@ -1791,7 +1850,7 @@ export class CollectionToolsComponent implements OnInit {
});
this.allLibrary = data
this.selectImageIndex = -1
this.canvas.cancelPaint()
// this.canvas.cancelPaint()
})
}

Loading…
Cancel
Save