Browse Source

[完善] 四周毗邻完善, 消防设施完善, 功能分区完善

master
陈鹏飞 4 years ago
parent
commit
d46f9c234c
  1. 36
      src/app/ui/allaround/allaround.component.html
  2. 2
      src/app/ui/allaround/allaround.component.ts
  3. 95
      src/app/ui/fire-fighting-device/fire-fighting-device.component.html
  4. 1
      src/app/ui/fire-fighting-device/fire-fighting-device.component.ts
  5. 26
      src/app/ui/function-division/function-division.component.ts

36
src/app/ui/allaround/allaround.component.html

@ -1,39 +1,41 @@
<div class="content">
<mat-tab-group style="height: 100%;">
<mat-tab label="{{item.name}}" *ngFor="let item of AllBuilding">
<mat-tab label="单位毗邻">
<div class="allImgs">
<div class="imgBox" *ngFor="let items of item.allImgs">
<div class="fixedImg" *ngIf="items.imageUrls.length">
<img [src]="items.imgURL" onerror="javascript:this.src='../../../assets/images/upload.png'" (click)='imgdetails(items.imageUrls)'>
<div class="imgBox" *ngFor="let item of AllAdjoining" >
<div class="fixedImg" *ngIf="item.imageUrls.length">
<img [src]="item.imgURL" onerror="javascript:this.src='../../../assets/images/upload.png'" (click)='imgdetails(item.imageUrls)'>
</div>
<div class="fixedImg" *ngIf="!item.imageUrls.length">
<img src="../../../assets/images/upload.png" (click)='imgdetails(item.imageUrls)'>
</div>
<div class="fixedImg" *ngIf="!items.imageUrls.length"><img src="../../../assets/images/upload.png" (click)='imgdetails(items.imageUrls)'></div>
<div style="margin-top: 5px;">
<label style="margin-left: 25px;">建筑物名称:</label>
<label style="margin-left: 25px;">{{items.name}}</label>
<label style="margin-left: 25px;">{{item.name}}</label>
</div>
<div style="margin-top: 5px;">
<label style="margin-left: 25px;">建筑物方向:</label>
<label style="margin-left: 25px;">
<label *ngIf="items.direction==0"></label>
<label *ngIf="items.direction==1">西</label>
<label *ngIf="items.direction==2"></label>
<label *ngIf="items.direction==3"></label>
<label *ngIf="items.direction==4">东南</label>
<label *ngIf="items.direction==5">西南</label>
<label *ngIf="items.direction==6">东北</label>
<label *ngIf="items.direction==7">西北</label>
<label *ngIf="item.direction==0"></label>
<label *ngIf="item.direction==1">西</label>
<label *ngIf="item.direction==2"></label>
<label *ngIf="item.direction==3"></label>
<label *ngIf="item.direction==4">东南</label>
<label *ngIf="item.direction==5">西南</label>
<label *ngIf="item.direction==6">东北</label>
<label *ngIf="item.direction==7">西北</label>
</label>
</div>
<div style="margin-top: 5px;">
<label style="margin-left: 25px;">图片数量:</label>
<label style="margin-left: 25px;" *ngIf="items.imageUrls.length">{{items.imageUrls.length}}张</label>
<label style="margin-left: 25px;" *ngIf="!items.imageUrls.length">0张</label>
<label style="margin-left: 25px;" *ngIf="item.imageUrls.length">{{item.imageUrls.length}}张</label>
<label style="margin-left: 25px;" *ngIf="!item.imageUrls.length">0张</label>
</div>
</div>
<p style="width: 100%;text-align: center;margin-top: 25px;" *ngIf="!item.allImgs.length">暂无数据,请前往平面图进行相关数据录入</p>
<p style="width: 100%;text-align: center;margin-top: 25px;" *ngIf="!AllAdjoining.length">暂无数据,请前往平面图进行相关数据录入</p>
</div>
</mat-tab>

2
src/app/ui/allaround/allaround.component.ts

@ -16,7 +16,7 @@ export class AllaroundComponent implements OnInit {
constructor(private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.getAllBuilding()
this.getAllCompany()
}
AllAdjoining:any = []; //所有单位毗邻

95
src/app/ui/fire-fighting-device/fire-fighting-device.component.html

@ -1,6 +1,101 @@
<div class="content">
<mat-tab-group>
<mat-tab label="单位消防设施">
<div class="contentBox">
<p style="width: 100%; margin: 30px auto; text-align: center;" *ngIf="!companyBuiltInGrouping.length">暂无数据,请完善单位基本信息</p>
<div style="width: 100%;margin-top: 25px;" *ngFor="let item of companyBuiltInGrouping;let key = index">
<h3 style="text-align: center;font-weight: 550;">{{item.name}}</h3>
<div style="margin-bottom: 10px;">
<mat-icon title="创建" (click)='addCompanyGrouping(item)'>add_circle_outline</mat-icon>
<mat-icon title="保存" style="margin-left: 25px;" (click)='editCompanyGrouping(item)'>description</mat-icon>
<mat-icon title="删除" style="margin-left: 25px;" (click)='deleteCompanyGrouping(item)'>delete</mat-icon>
</div>
<div>
<mat-accordion multi>
<mat-expansion-panel disabled>
<mat-expansion-panel-header>
<label class="firstContent"></label>
<label class="textContent">项目</label>
<label class="textContent">照片</label>
<label class="totalContent">总数</label>
<label class="lastTextContent">主要情况</label>
</mat-expansion-panel-header>
</mat-expansion-panel>
<mat-expansion-panel *ngFor="let items of item.facilityItems" disabled [expanded]=items.expanded>
<mat-expansion-panel-header>
<label class="firstContent">
<mat-checkbox (change)='checkedCompany($event,item,items)' [disabled]='items.isBuiltin'></mat-checkbox>
</label>
<label class="textContent">{{items.name}}</label>
<label class="textContent"><a href="javascript:void(0)" (click)='previewImg(items)'>查看图片</a></label>
<label class="totalContent">{{items.total ? items.total : '总数: 0'}}</label>
<label class="lastTextContent">
<textarea maxlength="999" [(ngModel)]="items.details" style="width: 80%;"></textarea>
</label>
<label><mat-icon (click)='SwitchBoard(items)' *ngIf="items.isBuiltin">keyboard_arrow_down</mat-icon></label>
</mat-expansion-panel-header>
<div class="overflowTable">
<div class="detailsTable">
<table>
<tr>
<th *ngFor="let header of items.header">{{header}}</th>
</tr>
<tr *ngFor="let body of items.body">
<td *ngFor="let header of items.header">{{body[header]? body[header] : '暂无数据'}}</td>
</tr>
</table>
</div>
<div *ngFor="let tableMsg of items.loopTable" class="detailsTable">
<p style="text-align: center; font-size: 16px; margin: 5px 0;">楼层/区域名称: {{tableMsg.name? tableMsg.name: '暂无名称'}}</p>
<table>
<tr>
<th *ngFor="let header of tableMsg.header">{{header}}</th>
</tr>
<tr *ngFor="let body of tableMsg.body">
<td *ngFor="let header of tableMsg.header">{{body[header]? body[header] : '暂无数据'}}</td>
</tr>
</table>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
<div style="width: 100%;margin-top: 25px;" *ngFor="let item of companyOptionalGrouping;let key = index">
<mat-accordion multi>
<mat-expansion-panel>
<mat-expansion-panel-header>
<h3 style="text-align: center;font-weight: 550;">{{item.name}}</h3>
<mat-icon title="保存" style="margin-left: 25px;" (click)='editCompanyOptional($event,item)'>description</mat-icon>
</mat-expansion-panel-header>
<div *ngFor="let items of item.propertyInfos" class="InputField">
<label>{{items.propertyName}}:</label>
<input type="text" *ngIf="items.propertyType!=1&&items.propertyType!=2&&items.propertyType!=4&&items.propertyType!=6"
[(ngModel)]="items.propertyValue" name="propertyValue">
<textarea maxlength="999" *ngIf="items.propertyType==1" [(ngModel)]="items.propertyValue" name="propertyValue"></textarea>
<input type="number" *ngIf="items.propertyType==2 ||items.propertyType==4" [(ngModel)]="items.propertyValue" name="propertyValue">
<mat-radio-group *ngIf="items.propertyType==6" [(ngModel)]="items.propertyValue" name="propertyValue">
<mat-radio-button style="margin-left: 5px;" [value]='radio.value' *ngFor="let radio of singleElection">{{radio.name}}</mat-radio-button>
</mat-radio-group>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</mat-tab>
<mat-tab label="{{newItem.name}}" *ngFor="let newItem of allBuildingGrouping">
<div class="contentBox">

1
src/app/ui/fire-fighting-device/fire-fighting-device.component.ts

@ -21,6 +21,7 @@ export class FireFightingDeviceComponent implements OnInit {
constructor(public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.getCompanyInformation()
this.getAllBuilding()
}

26
src/app/ui/function-division/function-division.component.ts

@ -115,21 +115,45 @@ export class FunctionDivisionComponent implements OnInit {
})
}
noDataList = [] //没有 创建功能分区 的建筑
//获得所有建筑的功能分区
getAllBuildingFunctionalZoning () {
this.selectBuildingFunctionalZoning = []
this.allBuildingFunctionalZoning = []
this.noDataList = []
this.allBuilding.forEach(element => {
let data={buildingId: element.id}
this.http.get(`/api/CompanyAccount/BuildingFunctionalDivisions`,{params:data}).subscribe((data:any)=>{
if (data.length) {
element.functionalZoning = data
this.selectBuildingFunctionalZoning.push([]) //拥有建筑功能分区的提前push空数组
this.allBuildingFunctionalZoning.push(element) }
this.allBuildingFunctionalZoning.push(element)
this.noDataList.push(true)
} else {
this.noDataList.push(false)
}
if (this.noDataList.length === this.allBuilding.length) { this.addVoluntarilyPartition() }
})
});
}
// 没有 创建 建筑功能分区时 自动创建
addVoluntarilyPartition () {
let isFalse = []
this.noDataList.forEach(item=> { item===false? isFalse.push(1) : null })
if (isFalse.length === this.allBuilding.length) { //没有 建筑功能分区时
let data = {
buildingId: this.allBuilding[0].id,
region: "",
area: 0,
details: ""
}
this.http.post('/api/CompanyAccount/BuildingFunctionalDivisions',data).subscribe(data=>{
this.getAllBuilding()
})
} //if
}
//封装函数刷新当前建筑功能分区
updateCurrent (e,index) {
let data= {buildingId: e.id}

Loading…
Cancel
Save