Browse Source

[完善] 删除 单位总平面图 关联模块功能

master
陈鹏飞 4 years ago
parent
commit
0924b426c2
  1. 2
      proxy.config.json
  2. 37
      src/app/ui/allaround/allaround.component.html
  3. 15
      src/app/ui/allaround/allaround.component.ts
  4. 8
      src/app/ui/collection-tools/collection-tools.component.html
  5. 33
      src/app/ui/collection-tools/collection-tools.component.ts
  6. 94
      src/app/ui/fire-fighting-device/fire-fighting-device.component.html
  7. 10
      src/app/ui/fire-fighting-device/fire-fighting-device.component.ts
  8. 51
      src/app/ui/function-division/function-division.component.html
  9. 8
      src/app/ui/function-division/function-division.component.ts
  10. 57
      src/app/ui/key-site/key-site.component.html
  11. 9
      src/app/ui/key-site/key-site.component.ts

2
proxy.config.json

@ -1,6 +1,6 @@
{
"/api": {
"target": "http://121.37.20.190:8008",
"target": "http://39.106.78.171:8008",
"secure": false,
"changeOrigin": true
}

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

@ -1,42 +1,5 @@
<div class="content">
<mat-tab-group style="height: 100%;">
<mat-tab label="单位毗邻">
<div class="allImgs">
<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 style="margin-top: 5px;">
<label style="margin-left: 25px;">建筑物名称:</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="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="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="!AllAdjoining.length">暂无数据,请前往平面图进行相关数据录入</p>
</div>
</mat-tab>
<mat-tab label="{{item.name}}" *ngFor="let item of AllBuilding">
<div class="allImgs">

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

@ -16,7 +16,6 @@ export class AllaroundComponent implements OnInit {
constructor(private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.getAllCompany()
this.getAllBuilding()
}
@ -34,12 +33,16 @@ export class AllaroundComponent implements OnInit {
//获取所有建筑
getAllBuilding () {
this.http.get('/api/CompanyAccount/Buildings').subscribe((data:any)=>{
this.AllBuilding = data
if (data.length) {
this.AllBuilding = data
this.AllBuilding.forEach(element => {
element.allImgs = []
});
this.getAllArchitecture()}
this.AllBuilding.forEach(element => { element.allImgs = [] });
this.getAllArchitecture()
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无建筑数据','确定',config);
}
})
}

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

@ -27,10 +27,6 @@
基本信息名称
<mat-icon [ngClass]="{'icongray': !basicInfo}">visibility</mat-icon>
</span>
<!-- <span style="user-select: none;" class="nameShow" (click)="wantToWorkClick()">
想定作业名称
<mat-icon [ngClass]="{'icongray': !wantToWork}">visibility</mat-icon>
</span> -->
<span style="position: absolute;right: 60px;cursor: pointer;">
<mat-icon title="查看/编辑模式" (click)="lookpat()" *ngIf="isEditPattern">tv</mat-icon>
@ -41,10 +37,6 @@
<!-- 头部操作栏 -->
<div class="headerOperate">
<button mat-button (click)="checkedBuilding({name:'总平面图'},-1)"
[ngClass]="{'buildingbtnchecked': checkedBuildingIndex==-1}">
<span>总平面图</span>
</button>
<button mat-button *ngFor="let item of allBuildings;let key = index" (click)="checkedBuilding(item,key)" class="bigeditdeletebtn"
[ngClass]="{'buildingbtnchecked': checkedBuildingIndex==key}">
<span>{{item.name}}</span>

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

@ -46,9 +46,9 @@ export class CollectionToolsComponent implements OnInit {
selected = "1" //图标大小选择框
allBuildings //该单位所有建筑
beforeOneCheckedBuilding:any = {name:"总平面图"}; //当前点击选择的建筑
checkedBuildingIndex:number = -1 //当前点击选择的建筑index
isEditPat:boolean = true //当前是否是编辑模式
beforeOneCheckedBuilding:any; //当前点击选择的建筑
checkedBuildingIndex:number = 0; //当前点击选择的建筑index
isEditPat:boolean = true; //当前是否是编辑模式
assetName:String//素材名称
assetWidth:number//素材宽度
@ -431,9 +431,8 @@ export class CollectionToolsComponent implements OnInit {
}
ngOnInit(): void {
this.getAllLibrary()
this.getAllBuildings()
let that = this
window.setTimeout(()=>{
@ -443,11 +442,11 @@ export class CollectionToolsComponent implements OnInit {
event.preventDefault();
};
})
}
ngAfterViewInit(): void {
this.getSitePlan()
this.getAllBuildings(true)
// 监听canvas组件选中素材事件
this.canvas.on("select",obj=>{
//选中素材属性注入函数
@ -752,9 +751,14 @@ export class CollectionToolsComponent implements OnInit {
}
//获得所有的建筑物
getAllBuildings(){
this.http.get("/api/CompanyAccount/Buildings").subscribe(data=>{
getAllBuildings(init:boolean = false){
this.http.get("/api/CompanyAccount/Buildings").subscribe((data:any)=>{
this.allBuildings = data
if (init) {
this.checkedBuildingIndex = 0
data && data.length? this.beforeOneCheckedBuilding = data[0] : this.beforeOneCheckedBuilding = {id:null, buildingTypes:[{id:null}]}
this.getBuildingSitePlan(this.beforeOneCheckedBuilding)
}
})
}
@ -768,7 +772,7 @@ export class CollectionToolsComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('创建成功','确定',config);
this.getAllBuildings()
this.allBuildings.length? this.getAllBuildings() : this.getAllBuildings(true)
}else if (data == "创建失败") {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -846,18 +850,13 @@ export class CollectionToolsComponent implements OnInit {
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('删除成功','确定',config);
this.http.get("/api/CompanyAccount/Buildings").subscribe(data=>{
this.allBuildings = data
this.beforeOneCheckedBuilding = {name:"总平面图"}
this.checkedBuildingIndex = -1
this.getSitePlan()
})
this.getAllBuildings(true)
},err=>{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('删除失败','确定',config);
this.getAllBuildings()
this.getAllBuildings(true)
})
}
}

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

@ -1,99 +1,5 @@
<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">

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

@ -21,7 +21,6 @@ export class FireFightingDeviceComponent implements OnInit {
constructor(public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.getCompanyInformation()
this.getAllBuilding()
}
@ -223,7 +222,14 @@ export class FireFightingDeviceComponent implements OnInit {
getAllBuilding () {
this.http.get('/api/CompanyAccount/Buildings').subscribe((data:any)=>{
this.allBuildingGrouping = data
if (this.allBuildingGrouping.length) { this.getAllBuildingFacilities() }
if (this.allBuildingGrouping.length) {
this.getAllBuildingFacilities()
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无建筑数据','确定',config);
}
})
}

51
src/app/ui/function-division/function-division.component.html

@ -1,59 +1,10 @@
<div class="content">
<div style="margin-top:16px">
<div style="margin-top:16px" *ngIf="allBuilding.length">
<mat-icon title="创建" (click)='addPartition()'>add_circle_outline</mat-icon>
</div>
<mat-tab-group class="tableContent">
<mat-tab label="单位功能分区">
<div style="overflow: auto; height: 100%;">
<div style="margin: 30px 0 25px 5%;">
<mat-icon title="创建" (click)='addCompany()'>add_circle_outline</mat-icon>
<mat-icon title="保存" style="margin-left: 25px;" (click)='preservation()'>description</mat-icon>
<mat-icon title="删除" style="margin-left: 25px;" (click)='delete()'>delete</mat-icon>
</div>
<table mat-table [dataSource]="companyFunctionalZoning">
<ng-container matColumnDef="checked">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<mat-checkbox (change)='changeCompany(element,$event)'></mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="region">
<th mat-header-cell *matHeaderCellDef>区域</th>
<td mat-cell *matCellDef="let element">
<mat-form-field class="example-full-width">
<input matInput [(ngModel)]="element.region" type="text" maxlength="20">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="measure">
<th mat-header-cell *matHeaderCellDef>面积</th>
<td mat-cell *matCellDef="let element">
<mat-form-field class="example-full-width">
<input matInput type="number" [(ngModel)]="element.area" onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))" placeholder="请输入数字">
</mat-form-field>
<label style="margin-left: 5px;"></label>
</td>
</ng-container>
<ng-container matColumnDef="situation">
<th mat-header-cell *matHeaderCellDef>基本情况</th>
<td mat-cell *matCellDef="let element">
<textarea [(ngModel)]="element.details" maxlength="999"></textarea>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<p style="width: 100%; margin-top: 30px; text-align: center;" *ngIf="!companyFunctionalZoning.length">暂无数据</p>
</div>
</mat-tab>
<mat-tab label="{{item.name}}" *ngFor="let item of allBuildingFunctionalZoning;let key = index">
<div style="overflow: auto; height: 100%;">
<div style="margin: 30px 0 25px 5%;">

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

@ -16,7 +16,6 @@ export class FunctionDivisionComponent implements OnInit {
ngOnInit(): void {
this.companyId = sessionStorage.getItem('companyId')
this.getAllCompany()
this.getAllBuilding()
}
@ -101,12 +100,17 @@ export class FunctionDivisionComponent implements OnInit {
//获得所有建筑
getAllBuilding () {
this.http.get(`/api/CompanyAccount/Buildings`).subscribe((data:any)=>{
this.allBuilding = data
if (data.length) {
this.allBuilding = data
this.allBuilding.forEach(element => { //为每个建筑添加一个 功能分区对象
element.functionalZoning = null
});
this.getAllBuildingFunctionalZoning()
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无建筑数据','确定',config);
}
})
}

57
src/app/ui/key-site/key-site.component.html

@ -1,62 +1,5 @@
<div class="content">
<mat-tab-group style="height: 100%;">
<mat-tab label="单位重点部位">
<div class="contentBox">
<div style="margin-top: 25px;">
<h3 style="text-align: center;font-weight: 550;">重点部位情况</h3>
<table mat-table [dataSource]="allCompanyPosition">
<ng-container matColumnDef="mainname">
<th mat-header-cell *matHeaderCellDef>重点部位名称</th>
<td mat-cell *matCellDef="let element">
{{element.name}}
</td>
</ng-container>
<ng-container matColumnDef="position">
<th mat-header-cell *matHeaderCellDef>重点部位所在位置</th>
<td mat-cell *matCellDef="let element">
{{element.position}}
</td>
</ng-container>
<ng-container matColumnDef="construction">
<th mat-header-cell *matHeaderCellDef>建筑结构</th>
<td mat-cell *matCellDef="let element">
{{element.structure}}
</td>
</ng-container>
<ng-container matColumnDef="nature">
<th mat-header-cell *matHeaderCellDef>使用性质</th>
<td mat-cell *matCellDef="let element">
{{element.nature}}
</td>
</ng-container>
<ng-container matColumnDef="danger">
<th mat-header-cell *matHeaderCellDef>主要危险性</th>
<td mat-cell *matCellDef="let element">
{{element.hazards}}
</td>
</ng-container>
<ng-container matColumnDef="img">
<th mat-header-cell *matHeaderCellDef>图片</th>
<td mat-cell *matCellDef="let element">
<a href="javascript:void(0);" (click)='seeImg(element.imageUrls)' style="color: blue;">查看图片</a>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<p style="text-align: center;" *ngIf="!allCompanyPosition.length">暂无数据,请前往平面图进行相关数据录入</p>
</div>
<div style="margin-top: 25px; text-align: left;">
<h3 style="text-align: center;font-weight: 550;">重点提示</h3>
<mat-icon title="保存" style="margin-left: 11%; cursor: pointer;" (click)='Preservation()'>description</mat-icon>
<p class="tips">
<textarea [(ngModel)]="companyInput" maxlength="5000"></textarea>
</p>
</div>
</div>
</mat-tab>
<mat-tab label="{{item.name}}" *ngFor="let item of allBuilding">
<div class="contentBox">

9
src/app/ui/key-site/key-site.component.ts

@ -18,8 +18,6 @@ export class KeySiteComponent implements OnInit {
displayedColumns: string[] = ['mainname', 'position', 'construction', 'nature', 'danger', 'img'];
ngOnInit(): void {
this.getCompanyPostion()
this.getCompanyTips()
this.getAllBuilding()
}
@ -47,14 +45,19 @@ export class KeySiteComponent implements OnInit {
//获取所有建筑
getAllBuilding () {
this.http.get('/api/CompanyAccount/Buildings').subscribe((data:any)=>{
this.allBuilding = data
if (data.length) {
this.allBuilding = data
this.allBuilding.forEach(element => {
element.position = [] //建筑重点部位
element.tips = null //建筑重点提示
element.companyInput = null }) //建筑重点提示数据
this.getAllBuildingPositon()
this.getAllBuildingTips()
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无建筑数据','确定',config);
}
})
}

Loading…
Cancel
Save