Browse Source

[合并] 合并代码

master
陈鹏飞 4 years ago
parent
commit
9f362063ad
  1. 3
      src/app/app-routing.module.ts
  2. 2
      src/app/key-unit/basicinfo/addhouseinfo.component.html
  3. 26
      src/app/key-unit/basicinfo/basicinfo.component.html
  4. 15
      src/app/key-unit/basicinfo/basicinfo.component.scss
  5. 10
      src/app/key-unit/basicinfo/basicinfo.component.ts
  6. 10
      src/app/key-unit/fire-fighting-device/fire-fighting-device.component.html
  7. 21
      src/app/key-unit/fire-fighting-device/fire-fighting-device.component.ts
  8. 20
      src/app/key-unit/key-site/key-site.component.html
  9. 6
      src/app/key-unit/key-site/key-site.component.scss
  10. 11
      src/app/key-unit/key-site/key-site.component.ts
  11. 4
      src/app/key-unit/key-site/keysiteimgs.component.html
  12. 2
      src/app/key-unit/key-unit.module.ts
  13. 2
      src/app/ui/add-six-familiar/add-six-familiar.component.scss
  14. 1
      src/app/ui/add-six-familiar/add-six-familiar.component.ts
  15. 25
      src/app/ui/basicinfo/addhouseinfo.component.html
  16. 77
      src/app/ui/basicinfo/addhouseinfo.component.ts
  17. 531
      src/app/ui/basicinfo/basicinfo.component.html
  18. 269
      src/app/ui/basicinfo/basicinfo.component.scss
  19. 2031
      src/app/ui/basicinfo/basicinfo.component.ts
  20. 26
      src/app/ui/basicinfo/lookmaster.component.html
  21. 66
      src/app/ui/basicinfo/lookmaster.component.ts
  22. 2
      src/app/ui/collection-tools/addPlaneFigure.html
  23. 20
      src/app/ui/collection-tools/collection-tools.component.html
  24. 30
      src/app/ui/collection-tools/collection-tools.component.scss
  25. 13
      src/app/ui/collection-tools/collection-tools.component.ts
  26. 2
      src/app/ui/collection-tools/createBuilding.html
  27. 2
      src/app/ui/collection-tools/editBuilding.html
  28. 2
      src/app/ui/collection-tools/editPlaneFigure.html
  29. 4
      src/app/ui/collection-tools/panel.scss
  30. 36
      src/app/ui/find-problem/find-problem.component.html
  31. 76
      src/app/ui/find-problem/find-problem.component.scss
  32. 25
      src/app/ui/find-problem/find-problem.component.spec.ts
  33. 154
      src/app/ui/find-problem/find-problem.component.ts
  34. 2
      src/app/ui/home/home.component.ts
  35. 27
      src/app/ui/know-route/know-route.component.html
  36. 60
      src/app/ui/know-route/know-route.component.scss
  37. 188
      src/app/ui/know-route/know-route.component.ts
  38. 95
      src/app/ui/photoofthescene/photoofthescene.component.html
  39. 39
      src/app/ui/photoofthescene/photoofthescene.component.scss
  40. 25
      src/app/ui/photoofthescene/photoofthescene.component.spec.ts
  41. 173
      src/app/ui/photoofthescene/photoofthescene.component.ts
  42. 4
      src/app/ui/router-gis/router-gis.component.html
  43. 23
      src/app/ui/router-gis/router-gis.component.scss
  44. 23
      src/app/ui/router-gis/router-gis.component.ts
  45. 67
      src/app/ui/training-recordinfo/training-recordinfo.component.html
  46. 11
      src/app/ui/training-recordinfo/training-recordinfo.component.ts
  47. 6
      src/app/ui/ui.module.ts
  48. 14
      src/app/ui/water-road/edittext.html
  49. 19
      src/app/ui/water-road/water-road.component.html
  50. 82
      src/app/ui/water-road/water-road.component.scss
  51. 12
      src/app/ui/water-road/water-road.component.spec.ts
  52. 135
      src/app/ui/water-road/water-road.component.ts
  53. BIN
      src/assets/images/camera.png
  54. BIN
      src/assets/images/fireHydrant.png

3
src/app/app-routing.module.ts

@ -28,7 +28,8 @@ const routes: Routes = [
component:TrainingRecordinfoComponent,canActivate: [AuthGuard],},
{path:'login',
component:LoginComponent},
{path:'home', component:HomeComponent,canActivate: [AuthGuard],}//守卫验证
{path:'home', component:HomeComponent,canActivate: [AuthGuard],},//守卫验证
// {path:'xxx', component:BasicinfoComponent,canActivate: [AuthGuard],},
]

2
src/app/key-unit/basicinfo/addhouseinfo.component.html

@ -1,5 +1,5 @@
<div mat-dialog-title>新增建筑</div>
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container" style="font-size: 16px;">
<mat-form-field hintLabel="名字不多于20个字">
<input matInput id="name" name="name"

26
src/app/key-unit/basicinfo/basicinfo.component.html

@ -113,10 +113,10 @@
<mat-spinner *ngIf="isspinner" diameter= 50></mat-spinner>
</div>
<div class="image" (click)="closeorganizationbox()">
<input id="selectedfile" type="file" (change)="filechange($event)" name="imgFile" accept=".jpg,.png,.jpeg,.gif,.webp">
<input *ngIf="pattern" id="selectedfile" type="file" (change)="filechange($event)" name="imgFile" accept=".jpg,.png,.jpeg,.gif,.webp">
</div>
<div class="addbtn">
<button type="submit" color="primary" class="submit1" mat-button mat-raised-button>保存</button>
<button *ngIf="pattern" type="submit" color="primary" class="submit1" mat-button mat-raised-button>保存</button>
</div>
</div>
<!-- <div class="mainright" (click)="closeorganizationbox()"> -->
@ -131,8 +131,8 @@
<!-- body -->
<div class="bottombox" style="flex: 70%;overflow-y: auto;" >
<div class="houseinfobox" style="height: 100%; overflow-y: auto;padding-bottom: 64px; box-sizing:border-box">
<button type="button" mat-icon-button (click)="addhouseinfo()" class="addhouseinfo"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button>
<div class="houseinfobox" style="height: 100%; overflow-y: auto; box-sizing:border-box">
<button *ngIf="pattern" type="button" mat-icon-button (click)="addhouseinfo()" class="addhouseinfo"><mat-icon class="addicon">add_circle_outline</mat-icon></button>
<mat-tab-group style="height: 100%;;" (focusChange)="selecttab($event)" >
<mat-tab [label]="item.username" *ngFor="let item of houses;let key = index">
<form style="height: 100%; overflow-y:auto; display: block;" (ngSubmit)="onSubmit2(form.value,item,key,form.invalid)" #form="ngForm" class="example-container">
@ -195,12 +195,12 @@
</div>
<div class="CustomData" style="width: 200px;">
<mat-checkbox (change)="checkCustomData($event)" name="checkbuilding" [(ngModel)]="item.isCustomData" style="float: left;margin-right: 10px;"></mat-checkbox>
<mat-checkbox *ngIf="pattern" (change)="checkCustomData($event)" name="checkbuilding" [(ngModel)]="item.isCustomData" style="float: left;margin-right: 10px;"></mat-checkbox>
<h1 style="font-size: 22px;width: 200px;">自定义信息</h1>
</div>
<div *ngIf="item.isCustomData" style="position: relative;">
<button style="position: absolute;left: 0;" type="button" mat-icon-button (click)="addCustomData(item)" class="addCustomData"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button>
<button style="position: absolute;left:60px;" type="button" mat-icon-button (click)="deleteCustomData(item)" class="deleteCustomData"><mat-icon style="font-size: 38px;">remove_circle_outline</mat-icon></button>
<button *ngIf="pattern" style="position: absolute;left: 0;" type="button" mat-icon-button (click)="addCustomData(item)" class="addCustomData"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button>
<button *ngIf="pattern" style="position: absolute;left:60px;" type="button" mat-icon-button (click)="deleteCustomData(item)" class="deleteCustomData"><mat-icon style="font-size: 38px;">remove_circle_outline</mat-icon></button>
<div class="houseinfoinput" style="float: left;margin-left: 250px;" *ngFor="let i of item.buildingCustomData.customProperties;let key = index">
<mat-form-field>
<input matInput type='text' name="{{key}}1CustomData"
@ -278,7 +278,7 @@
<div class="deviceinfo">
<div style="width: 200px;">
<mat-checkbox (change)="checkboxchange(item.buildingBasicGroups[1].submitted,$event)" name="item.buildingBasicGroups[1].name" *ngIf="item.buildingBasicGroups[1].isOptional" [(ngModel)]="item.buildingBasicGroups[1].submitted" style="float: left;margin-right: 10px;"></mat-checkbox>
<mat-checkbox (change)="checkboxchange(item.buildingBasicGroups[1].submitted,$event)" name="item.buildingBasicGroups[1].name" *ngIf="item.buildingBasicGroups[1].isOptional && pattern" [(ngModel)]="item.buildingBasicGroups[1].submitted" style="float: left;margin-right: 10px;"></mat-checkbox>
<h1 style="font-size: 22px;width: 200px;">{{item.buildingBasicGroups[1].name}}</h1>
</div>
@ -316,7 +316,7 @@
</div>
<div style="width: 200px;">
<mat-checkbox (change)="checkboxchange(item,$event)" *ngIf="item.buildingBasicGroups[2].isOptional" name="item.buildingBasicGroups[2].name" [(ngModel)]="item.buildingBasicGroups[2].submitted" style="float: left;margin-right: 10px;"></mat-checkbox>
<mat-checkbox (change)="checkboxchange(item,$event)" *ngIf="item.buildingBasicGroups[2].isOptional && pattern" name="item.buildingBasicGroups[2].name" [(ngModel)]="item.buildingBasicGroups[2].submitted" style="float: left;margin-right: 10px;"></mat-checkbox>
<h1 style="font-size: 22px;width: 200px;">储罐信息</h1>
</div>
@ -480,12 +480,12 @@
<div class="CustomData" style="width: 200px;margin-top: 60px;">
<mat-checkbox (change)="checkCustomData($event)" name="checkbuilding" [(ngModel)]="item.isCustomData" style="float: left;margin-right: 10px;"></mat-checkbox>
<mat-checkbox *ngIf="pattern" (change)="checkCustomData($event)" name="checkbuilding" [(ngModel)]="item.isCustomData" style="float: left;margin-right: 10px;"></mat-checkbox>
<h1 style="font-size: 22px;width: 200px;">自定义信息</h1>
</div>
<div *ngIf="item.isCustomData" style="position: relative;">
<button style="position: absolute;left: 0;font-size: 11px;" type="button" mat-icon-button (click)="addCustomData(item)" class="addCustomData"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button>
<button style="position: absolute;left:60px;" type="button" mat-icon-button (click)="deleteCustomData(item)" class="deleteCustomData"><mat-icon style="font-size: 38px;">remove_circle_outline</mat-icon></button>
<button *ngIf="pattern" style="position: absolute;left: 0;font-size: 11px;" type="button" mat-icon-button (click)="addCustomData(item)" class="addCustomData"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button>
<button *ngIf="pattern" style="position: absolute;left:60px;" type="button" mat-icon-button (click)="deleteCustomData(item)" class="deleteCustomData"><mat-icon style="font-size: 38px;">remove_circle_outline</mat-icon></button>
<div class="houseinfoinput" style="float: left;margin-left: 250px;" *ngFor="let i of item.buildingCustomData.customProperties;let key = index">
<mat-form-field>
<input matInput type='text' name="{{key}}1CustomData"
@ -505,7 +505,7 @@
</div>
<div class="infobtnbox">
<div class="infobtnbox" *ngIf="pattern">
<button type="submit()" mat-button mat-raised-button color="primary" >保存</button>
<button type="button" mat-raised-button (click)="deletedbuilding(item)" color="warn">删除</button>
</div>

15
src/app/key-unit/basicinfo/basicinfo.component.scss

@ -115,8 +115,15 @@
border-bottom: 1px solid black;
}
.houseinfobox{
// height:340px;
font-size: 16px;
overflow: auto;
.addicon{
font-size: 30px;
width: 30px;
height: 30px;
vertical-align: bottom;
line-height: 30px;
}
.addhouseinfo{
float: left;
}
@ -246,10 +253,10 @@ textarea {
}
.imgbox{
text-align: center;
height: 750px;
height: 500px;
img{
max-width: 1500px;
max-height: 740px;
max-width: 800px;
max-height: 6400px;
}
}
.previewImgBottom{

10
src/app/key-unit/basicinfo/basicinfo.component.ts

@ -86,9 +86,15 @@ export class BasicinfoComponent implements OnInit {
allorganizing:any = [] //所有组织机构
constructor(private router:Router,private route:ActivatedRoute,private http: HttpClient, private tree: TreeService, private sanitizer: DomSanitizer, public dialog: MatDialog,public snackBar: MatSnackBar) { }
pattern:any
unitId : any //当前单位id
ngOnInit(): void {
if(localStorage.getItem("pattern") == "edit"){
this.pattern = true
}else if(localStorage.getItem("pattern") == "look"){
this.pattern = false
}
this.getallunittype()
this.getorganization()
// this.getunitinfo()
@ -864,8 +870,8 @@ export class BasicinfoComponent implements OnInit {
//查看单位大图
lookmaster(){
const dialogRef = this.dialog.open(LookMaster, {//调用open方法打开对话框并且携带参数过去
width: '1600px',
height:'900px',
width: '800px',
height:'640px',
data: {img:this.imgsrc}
});
dialogRef.afterClosed().subscribe(

10
src/app/key-unit/fire-fighting-device/fire-fighting-device.component.html

@ -3,10 +3,10 @@
<mat-tab label="单位消防设施">
<div class="contentBox">
<p style="width: 100%; margin: 30px auto; text-align: center;" *ngIf="!companyBuiltInGrouping.length">暂无数据,请完善单位基本信息</p>
<p style="width: 100%; margin: 30px auto; text-align: center;font-size: 16px;" *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;">
<div style="margin-bottom: 10px;" *ngIf="isEditPattern">
<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>
@ -74,7 +74,7 @@
<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-icon *ngIf="isEditPattern" 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>
@ -100,7 +100,7 @@
<div style="width: 100%;margin-top: 25px;" *ngFor="let item of newItem.buildingFacilityGroups">
<h3 style="text-align: center;font-weight: 550;">{{item.name}}</h3>
<div style="margin-bottom: 10px;">
<div style="margin-bottom: 10px;" *ngIf="isEditPattern">
<mat-icon title="创建" (click)='addBuildingGrouping(newItem,item)'>add_circle_outline</mat-icon>
<mat-icon title="保存" style="margin-left: 25px;" (click)='editBuildingGrouping(newItem,item)'>description</mat-icon>
<mat-icon title="删除" style="margin-left: 25px;" (click)='deleteBuildingGrouping(newItem,item)'>delete</mat-icon>
@ -168,7 +168,7 @@
<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)='editBuildingOptional($event,item)'>description</mat-icon>
<mat-icon *ngIf="isEditPattern" title="保存" style="margin-left: 25px;" (click)='editBuildingOptional($event,item)'>description</mat-icon>
</mat-expansion-panel-header>
<div *ngFor="let items of item.propertyInfos" class="InputField">
<label>{{items.propertyName}}:</label>

21
src/app/key-unit/fire-fighting-device/fire-fighting-device.component.ts

@ -20,9 +20,16 @@ export class FireFightingDeviceComponent implements OnInit {
constructor(private router:Router,private route:ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
isEditPattern = true
ngOnInit(): void {
this.getCompanyInformation()
this.getAllBuilding()
if(localStorage.getItem("pattern") == "edit"){
this.isEditPattern = true
}else if(localStorage.getItem("pattern") == "look"){
this.isEditPattern = false
}
}
//定义属性数据
@ -52,6 +59,13 @@ export class FireFightingDeviceComponent implements OnInit {
elements.total = element.facilityCount[index]
elements.expanded = false});
});
if(sessionStorage.getItem("tabsindex") == "4"){
this.companyBuiltInGrouping = [this.companyBuiltInGrouping[1]]
this.companyOptionalGrouping = []
}
if(sessionStorage.getItem("tabsindex") == "5"){
this.companyBuiltInGrouping.splice(1,1)
}
}) //http
} //if
@ -247,6 +261,13 @@ export class FireFightingDeviceComponent implements OnInit {
newElement.total = elements.facilityCount[index]
newElement.expanded = false });
});
if(sessionStorage.getItem("tabsindex") == "4"){
element.buildingFacilityGroups = [element.buildingFacilityGroups[1]]
element.buildingOptionalGroups = []
}
if(sessionStorage.getItem("tabsindex") == "5"){
element.buildingFacilityGroups.splice(1,1)
}
})
});

20
src/app/key-unit/key-site/key-site.component.html

@ -4,7 +4,7 @@
<div class="contentBox">
<div style="margin-top: 25px;">
<h3 style="text-align: center;font-weight: 550;">重点部位情况</h3>
<h3 style="text-align: center;font-weight: 550;font-size: 20px;">重点部位情况</h3>
<table mat-table [dataSource]="allCompanyPosition">
<ng-container matColumnDef="mainname">
<th mat-header-cell *matHeaderCellDef>重点部位名称</th>
@ -45,13 +45,13 @@
<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>
<p style="text-align: center;font-size: 20px;" *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>
<h3 style="text-align: center;font-weight: 550;font-size: 20px;">重点提示</h3>
<mat-icon *ngIf="isEditPattern" title="保存" style="margin-left: 11%; cursor: pointer;" (click)='Preservation()'>description</mat-icon>
<p class="tips">
<textarea [(ngModel)]="companyInput" maxlength="5000"></textarea>
<textarea [disabled]="!isEditPattern" [(ngModel)]="companyInput" maxlength="5000"></textarea>
</p>
</div>
@ -62,7 +62,7 @@
<div class="contentBox">
<div style="margin-top: 25px;">
<h3 style="text-align: center;font-weight: 550;">重点部位情况</h3>
<h3 style="text-align: center;font-weight: 550;font-size: 20px;">重点部位情况</h3>
<table mat-table [dataSource]="item.position">
<ng-container matColumnDef="mainname">
<th mat-header-cell *matHeaderCellDef>重点部位名称</th>
@ -103,13 +103,13 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<p style="text-align: center;" *ngIf="!item.position.length">暂无数据,请前往平面图进行相关数据录入</p>
<p style="text-align: center;font-size: 20px;" *ngIf="!item.position.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)='PreservationBuilding(item)'>description</mat-icon>
<h3 style="text-align: center;font-weight: 550;font-size: 20px;">重点提示</h3>
<mat-icon *ngIf="isEditPattern" title="保存" style="margin-left: 11%;cursor: pointer;" (click)='PreservationBuilding(item)'>description</mat-icon>
<p class="tips">
<textarea [(ngModel)]="item.companyInput" maxlength="5000"></textarea>
<textarea [disabled]="!isEditPattern" [(ngModel)]="item.companyInput" maxlength="5000"></textarea>
</p>
</div>

6
src/app/key-unit/key-site/key-site.component.scss

@ -42,14 +42,14 @@ table {
.rotateC {transform: rotate(270deg) scale(0.75);}
//预览图片
.previewImgBox {
width: 1500px;
height: 700px;
width: 800px;
height: 650px;
text-align: center;
img{
width: auto;
height: auto;
max-width: 100%;
height: 100%;}
max-height: 100%;}
}
.previewImgBottom {
text-align: center;

11
src/app/key-unit/key-site/key-site.component.ts

@ -17,8 +17,15 @@ export class KeySiteComponent implements OnInit {
constructor(public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private route:ActivatedRoute,) { }
displayedColumns: string[] = ['mainname', 'position', 'construction', 'nature', 'danger', 'img'];
isEditPattern = true
ngOnInit(): void {
if(localStorage.getItem("pattern")=="edit"){
this.isEditPattern = true
}else if(localStorage.getItem("pattern") == "look"){
this.isEditPattern = false
}
this.getCompanyPostion()
this.getCompanyTips()
this.getAllBuilding()
@ -144,8 +151,8 @@ export class KeySiteComponent implements OnInit {
if (e.length) {
let data = e
const dialogRef = this.dialog.open(KeySiteImgs, {//调用open方法打开对话框并且携带参数过去
width: '1600px',
height:'900px',data});
width: '820px',
height:'670px',data});
dialogRef.afterClosed().subscribe();
} else {
const config = new MatSnackBarConfig();

4
src/app/key-unit/key-site/keysiteimgs.component.html

@ -12,7 +12,7 @@
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</div>
<!--
<div class="previewImgBottom">
<button type="button" mat-icon-button (click)='rotate()'><mat-icon>refresh</mat-icon></button>
</div>
</div> -->

2
src/app/key-unit/key-unit.module.ts

@ -77,7 +77,7 @@ import { LookMaster2 } from './basicinfo-look/lookmaster.component';
@NgModule({
declarations: [KeyUnitManagementComponent, EditUnitInfoComponent, ViewUnitDetailsComponent,CreateUnit,BasicinfoComponent,LookMaster,AddHouseInfo, EditPlanInfoComponent,BasicinfoLookComponent, ViewUnitDetailsPlanComponent,FunctionDivisionComponent,addPartition,addPartitionAttribute,AllaroundComponent,ImgDetails,RealisticPictureComponent,previewImg,addRealPicture,editRealPicture,KeySiteComponent,KeyImgDetail,KeySiteImgs,UploadingCADComponent,readFile,editFile,KeySiteLookComponent,KeySiteImgs2,FunctionDivisionLookComponent,RealisticPictureLookComponent,previewImg3,UploadingCADLookComponent,FireFightingDeviceComponent,ImagesData,previewBigImg,ImgsDataDetail,FireFightingDeviceLookComponent,ImagesData2,ImgsDataDetail2,previewBigImg2,LookMaster2,addPartitionAttribute2],
exports:[ViewUnitDetailsPlanComponent,BasicinfoComponent,FireFightingDeviceComponent],
exports:[ViewUnitDetailsPlanComponent,BasicinfoComponent,FireFightingDeviceComponent,KeySiteComponent],
imports: [
CommonModule,
KeyUnitRoutingModule,

2
src/app/ui/add-six-familiar/add-six-familiar.component.scss

@ -1,6 +1,6 @@
.bigbox{
width: 10rem;
height: 7.5rem;
height: 100%;
position: relative;
background: #F4F5F9;
.content{

1
src/app/ui/add-six-familiar/add-six-familiar.component.ts

@ -41,6 +41,7 @@ export class AddSixFamiliarComponent implements OnInit {
// ?id=${this.unitdata.id}
console.log(this.unitdata)
if(this.unitname && this.address && this.contactname && this.contactphone && this.peoplenum && this.leadname){
localStorage.setItem("pattern","edit")
this.router.navigate([`/trainingrecordinfo`],{queryParams:{'id':this.unitdata.id}})
}else{
const config = new MatSnackBarConfig();

25
src/app/ui/basicinfo/addhouseinfo.component.html

@ -1,25 +0,0 @@
<div mat-dialog-title>新增建筑</div>
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<mat-form-field hintLabel="名字不多于20个字">
<input matInput id="name" name="name"
required
maxlength="20"
ngModel #name="ngModel" placeholder="建筑名称"
#input
>
<mat-hint align="end">{{input.value?.length || 0}}/20</mat-hint>
</mat-form-field>
<mat-form-field>
<mat-select required name="unittype" ngModel #unittype="ngModel" placeholder="建筑类型">
<mat-option [value]="item.id" *ngFor="let item of allunittype" >{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
<div class="btn">
<button type="submit" class="savebtn" mat-raised-button color="primary" [disabled]='form.invalid'>确定</button>
<button type="button" mat-button (click)="onNoClick()" mat-raised-button>取消</button>
</div>
</form>

77
src/app/ui/basicinfo/addhouseinfo.component.ts

@ -1,77 +0,0 @@
import { Component, OnInit, Inject } from '@angular/core';
import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree';
import {FlatTreeControl} from '@angular/cdk/tree';
import { HttpClient } from '@angular/common/http';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
import {FormControl} from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
@Component({
selector: 'addhouseinfo',
templateUrl: './addhouseinfo.component.html',
styleUrls: ['./basicinfo.component.scss']
})
export class AddHouseInfo {
myControl = new FormControl();
//注入MatDialogRef,可以用来关闭对话框
//要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌
constructor(private http: HttpClient,public dialogRef: MatDialogRef<AddHouseInfo>,@Inject(MAT_DIALOG_DATA) public data) {}
allunittype:any
onNoClick(): void {
this.dialogRef.close();
}
ngOnInit(): void {
// console.log(this.data)
this.getallunittype()
}
getallunittype(){
this.http.get("/api/BuildingTypes/Simple").subscribe(data=>{
this.allunittype = data
})
}
onSubmit(value){
this.http.get("/api/Buildings",{
params:{
companyId:this.data.unitId
}
}).subscribe((data:any)=>{
this.data.allBuildings = data
let order
if(data.length == 0){
order = 0
}else{
order = data[data.length - 1].order + 1
}
let buildingTypename = ""
this.allunittype.forEach(item => {
if(item.id == value.unittype){
buildingTypename = item.name
}
});
this.http.post("/api/Buildings",{
id: "",
name: value.name,
order: order,
enabled: true,
companyId: this.data.unitinfo.id,
buildingTypes: [
{
id: value.unittype,
name: buildingTypename
}
]
},{params:{
companyId : this.data.unitId
}}).subscribe(data=>{
this.dialogRef.close(data);
})
})
}
}

531
src/app/ui/basicinfo/basicinfo.component.html

@ -1,531 +0,0 @@
<div style="height: 100%;display: flex; flex-direction: column;">
<!-- header -->
<mat-accordion>
<mat-expansion-panel expanded hideToggle >
<mat-expansion-panel-header style="color: black;">
<mat-panel-title>
单位信息
<mat-icon style="position: absolute;right:30px;">keyboard_arrow_down</mat-icon>
</mat-panel-title>
</mat-expansion-panel-header>
<div class="topbox">
<form (ngSubmit)="onSubmit(form.value,form.invalid,form)" #form="ngForm" class="example-container">
<div class="mainbox" >
<div class="mainleft">
<div class="inputbox" >
<span style="color: red;">*</span>
<span>统一社会信用代码:</span>
<mat-form-field>
<input matInput id="creditcode" name="creditcode" type='text' #usci="ngModel"
required minlength="1" maxlength="18"
[(ngModel)]="unitinfo.usci"
(focus)="closeorganizationbox()"
pattern="^[0-9A-HJ-NP-RTUW-Y]{2}\d{6}[0-9A-HJ-NP-RTUW-Y]{10}$">
</mat-form-field>
<div *ngIf="usci.invalid && (usci.dirty || usci.touched)" class="alert-danger">
<div *ngIf="usci.errors.pattern" class="alert-danger">
统一社会信用代码格式不正确
</div>
</div>
</div>
<div class="inputbox">
<span style="color: red;">*</span>
<span>单位类型:</span>
<mat-form-field (click)="closeorganizationbox()">
<mat-select required name="unittype" [(ngModel)]="defaultbuildingTypes">
<mat-option [value]="item.id" *ngFor="let item of allunittype">{{item.name}}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="inputbox">
<span style="color: red;">*</span>
<span>联系人:</span>
<mat-form-field>
<input matInput id="linkman" name="linkman" type='text'
required minlength="1"
[(ngModel)]="unitinfo.contacts"
(focus)="closeorganizationbox()"
>
</mat-form-field>
</div>
<div class="inputbox">
<span style="color: red;">*</span>
<span>联系电话:</span>
<mat-form-field>
<input matInput id="linkphone" name="linkphone" type='text' #linkphone="ngModel"
required pattern="^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[35-8]\d{2}|4(?:0\d|1[0-2]|9\d))|9[0135-9]\d{2}|66\d{2})\d{6}$"
[(ngModel)]="unitinfo.phone"
(focus)="closeorganizationbox()"
>
</mat-form-field>
<div *ngIf="linkphone.invalid && (linkphone.dirty || linkphone.touched)" class="alert-danger">
<div *ngIf="linkphone.errors.pattern" class="alert-danger">
电话号码格式不正确
</div>
</div>
</div>
<div class="inputbox" style="width: 700px;">
<span style="color: red;">*</span>
<span>辖区中队:</span>
<mat-form-field style="width: 538px;">
<input matInput id="organization" name="organization" type='text'
required minlength="1"
[(ngModel)]="selectedorganization"
(focus)="openorganizationbox()"
readonly="value" >
</mat-form-field>
</div>
<div id="organizationbox" class="organizationbox" *ngIf="isorganizationbox">
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button type="button" mat-icon-button disabled ></button>
<li>{{node.name}}</li>
</mat-tree-node>
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding (click)='add(node)' class="organizationlist">
<button
type="button"
mat-icon-button
matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
<li>{{node.name}}</li>
</mat-tree-node>
</mat-tree>
</div>
<div class="inputbox" style="width: 700px;">
<span style="color: red;">*</span>
<span>单位地址:</span>
<mat-form-field style="width: 538px;">
<input matInput id="unitaddress" name="unitaddress" type='text'
required minlength="1"
[(ngModel)]="unitinfo.address"
(focus)="closeorganizationbox()">
</mat-form-field>
</div>
<div class="uploadimg" (click)="lookmaster()">
<span>单位照片:</span>
<div class="uploadingimg">
<img [src]="imgsrc" alt="" style="width: 299px; height: 170px;" >
</div>
<mat-spinner *ngIf="isspinner" diameter= 50></mat-spinner>
</div>
<div class="image" (click)="closeorganizationbox()">
<input id="selectedfile" type="file" (change)="filechange($event)" name="imgFile" accept=".jpg,.png,.jpeg,.gif,.webp">
</div>
<div class="addbtn">
<button type="submit" color="primary" class="submit1" mat-button mat-raised-button>保存</button>
</div>
</div>
<!-- <div class="mainright" (click)="closeorganizationbox()"> -->
<!-- 地图预留位置 -->
<!-- </div> -->
</div>
</form>
</div>
</mat-expansion-panel>
</mat-accordion>
<!-- body -->
<div class="bottombox" style="flex: 70%;overflow-y: auto;" >
<div class="houseinfobox" style="height: 100%; overflow-y: auto;padding-bottom: 64px; box-sizing:border-box">
<button type="button" mat-icon-button (click)="addhouseinfo()" class="addhouseinfo"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button>
<mat-tab-group style="height: 100%;;" (focusChange)="selecttab($event)" >
<mat-tab [label]="item.username" *ngFor="let item of houses;let key = index">
<form style="height: 100%; overflow-y:auto; display: block;" (ngSubmit)="onSubmit2(form.value,item,key,form.invalid)" #form="ngForm" class="example-container">
<!-- 正常建筑 -->
<div class="highinfo" *ngIf="item.tongyong">
<div class="houseinfoinput" >
<span>建筑名称:</span>
<mat-form-field>
<input matInput id="housename" name="housename" type='text'
minlength="1" [(ngModel)]="item.name"
>
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput">
<span>建筑类型:</span>
<mat-form-field>
<mat-select name="unittype" [(ngModel)]="item.buildtype">
<mat-option [value]="n.name" *ngFor="let n of allunittype" (click)="templatebuildtype(n,item,key)">{{n.name}}</mat-option>
</mat-select>
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div *ngFor="let item of item.buildingBasicGroups;let www = index" style="float: left;">
<h1 style="font-size: 22px;">{{item.name}}</h1>
<div class="houseinfoinput" *ngFor="let i of item.propertyInfos" style="float: left;margin-left: 250px;position: relative;">
<span>{{i.propertyName}}<span *ngIf="i.physicalUnit">({{i.physicalUnit}})</span></span>
<!-- 如果类型是文本 -->
<mat-form-field *ngIf="i.propertyType == 0">
<input matInput name="{{i.propertyName}}{{www}}" type='text'
required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue">
</mat-form-field>
<!-- 如果类型是数字 -->
<mat-form-field *ngIf="i.propertyType == 2">
<input matInput name="{{i.propertyName}}{{www}}" type='number'
required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue"
(change)="inputchange($event,i.ruleName,i.ruleValue,i)"
>
<!-- <mat-error *ngIf="isshowrule">{{rulevalue}}</mat-error> -->
</mat-form-field>
<!-- 如果类型是多行文本 -->
<textarea *ngIf="i.propertyType == 1" style="width: 180px;height: 60px;" required="{{ i.required==true ? 'true' : 'false' }}" [(ngModel)]="i.propertyValue" name="{{i.propertyName}}{{key}}"></textarea>
<span style="color: red;" *ngIf="i.required">*</span>
<div *ngIf="i.isshowrule" style="position: absolute;
left: 205px;
top: 45px;
font-size: 11px;
color: red;">
<span>{{i.rulevalue}}</span>
</div>
</div>
</div>
<div class="CustomData" style="width: 200px;">
<mat-checkbox (change)="checkCustomData($event)" name="checkbuilding" [(ngModel)]="item.isCustomData" style="float: left;margin-right: 10px;"></mat-checkbox>
<h1 style="font-size: 22px;width: 200px;">自定义信息</h1>
</div>
<div *ngIf="item.isCustomData" style="position: relative;">
<button style="position: absolute;left: 0;" type="button" mat-icon-button (click)="addCustomData(item)" class="addCustomData"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button>
<button style="position: absolute;left:60px;" type="button" mat-icon-button (click)="deleteCustomData(item)" class="deleteCustomData"><mat-icon style="font-size: 38px;">remove_circle_outline</mat-icon></button>
<div class="houseinfoinput" style="float: left;margin-left: 250px;" *ngFor="let i of item.buildingCustomData.customProperties;let key = index">
<mat-form-field>
<input matInput type='text' name="{{key}}1CustomData"
required
[(ngModel)]="i.name">
</mat-form-field>
<span>:</span>
<mat-form-field>
<input matInput type='text' name="{{key}}2CustomData"
required
[(ngModel)]="i.value">
</mat-form-field>
<span style="color: red;" *ngIf="i.required">*</span>
</div>
</div>
</div>
<!-- 石油化工 -->
<div class="highinfo" *ngIf="item.isshiyou;let bigkey = index">
<div class="basicinfobox">
<div class="houseinfoinput">
<span>建筑名称:</span>
<mat-form-field>
<input matInput id="housename" name="housename" type='text'
required minlength="1" [(ngModel)]="item.name"
>
</mat-form-field>
<span style="color: red;">*</span>
</div>
<div class="houseinfoinput" >
<span>建筑类型:</span>
<mat-form-field>
<mat-select required name="unittype" [(ngModel)]="item.buildtype">
<mat-option [value]="n.name" *ngFor="let n of allunittype" (click)="templatebuildtype(n,item,key)">{{n.name}}</mat-option>
</mat-select>
</mat-form-field>
<span style="color: red;">*</span>
</div>
<h1 style="font-size: 22px;">{{item.buildingBasicGroups[0].name}}</h1>
<div class="houseinfoinput" *ngFor="let i of item.buildingBasicGroups[0].propertyInfos;let smkey = index" style="float: left;margin-left: 250px;position: relative;">
<span>{{i.propertyName}} <span *ngIf="i.physicalUnit">({{i.physicalUnit}})</span></span>
<!-- 如果类型是文本 -->
<mat-form-field *ngIf="i.propertyType == 0">
<input matInput name="{{i.propertyName}}" type='text'
required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue">
</mat-form-field>
<!-- 如果类型是数字 -->
<mat-form-field *ngIf="i.propertyType == 2">
<input matInput name="{{i.propertyName}}" type='number'
required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue"
(change)="inputchange($event,i.ruleName,i.ruleValue,i)"
>
<!-- <mat-error *ngIf="isshowrule">{{rulevalue}}</mat-error> -->
</mat-form-field>
<!-- 如果类型是多行文本 -->
<textarea *ngIf="i.propertyType == 1" style="width: 180px;height: 60px;" required="{{ i.required==true ? 'true' : 'false' }}" [(ngModel)]="i.propertyValue" name="{{i.propertyName}}"></textarea>
<span style="color: red;" *ngIf="i.required">*</span>
<div *ngIf="i.isshowrule" style=" position: absolute;
left: 205px;
top: 45px;
font-size: 11px;
color: red;">
<span>{{i.rulevalue}}</span>
</div>
</div>
</div>
<div class="deviceinfo">
<div style="width: 200px;">
<mat-checkbox (change)="checkboxchange(item.buildingBasicGroups[1].submitted,$event)" name="item.buildingBasicGroups[1].name" *ngIf="item.buildingBasicGroups[1].isOptional" [(ngModel)]="item.buildingBasicGroups[1].submitted" style="float: left;margin-right: 10px;"></mat-checkbox>
<h1 style="font-size: 22px;width: 200px;">{{item.buildingBasicGroups[1].name}}</h1>
</div>
<table mat-table [dataSource]="devicedataSourcebox[item.buildingId]" class="mat-elevation-z8" *ngIf="item.buildingBasicGroups[1].submitted">
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>
<button style="width: 24px;" type="button" mat-icon-button class="adddeviceinfo2" (click)="adddeviceinfo(item)"><mat-icon>add_circle_outline</mat-icon></button>
<button style="width: 24px;" type="button" mat-icon-button class="removedeviceinfo" (click)="removedeviceinfo(item)"><mat-icon>remove_circle_outline</mat-icon></button>
装置区名称<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<textarea style="width: 100px;" [(ngModel)]="element.name" name="{{key}}1" required></textarea>
</td>
</ng-container>
<ng-container matColumnDef="flow">
<th mat-header-cell *matHeaderCellDef>工艺流程<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<textarea [(ngModel)]="element.flow" name="{{key}}2" required></textarea>
</td>
</ng-container>
<ng-container matColumnDef="danger">
<th mat-header-cell *matHeaderCellDef>火灾危险性<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<textarea [(ngModel)]="element.danger" name="{{key}}3" required></textarea>
</td>
</ng-container>
<ng-container matColumnDef="payattentionto">
<th mat-header-cell *matHeaderCellDef>灭火注意事项</th>
<td mat-cell *matCellDef="let element;let key = index">
<textarea style="width: 100px;" [(ngModel)]="element.payattentionto" name="{{key}}4"></textarea>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</div>
<div style="width: 200px;">
<mat-checkbox (change)="checkboxchange(item,$event)" *ngIf="item.buildingBasicGroups[2].isOptional" name="item.buildingBasicGroups[2].name" [(ngModel)]="item.buildingBasicGroups[2].submitted" style="float: left;margin-right: 10px;"></mat-checkbox>
<h1 style="font-size: 22px;width: 200px;">储罐信息</h1>
</div>
<button *ngIf="item.buildingBasicGroups[2].submitted" type="button" mat-raised-button color="primary" (click)="addtankbox(item,bigkey)" style="margin-top: 30px;margin-right: 5px;">添加储罐</button>
<button *ngIf="item.buildingBasicGroups[2].submitted" type="button" mat-raised-button color="warn" (click)="removetankbox(item,bigkey)" style="margin-top: 30px;" matTooltip="会将此建筑处于末尾的储罐移除">移除末尾储罐</button>
<div *ngIf="item.buildingBasicGroups[2].submitted" style="margin-top: 30px;">
<div class="tankinfo" *ngFor="let x of item.bigfor;let www = index">
<p style="font-size: 22px; width: 200px;">{{x[0].name}}</p>
<div class="basicinfobox" >
<div class="houseinfoinput" *ngFor="let i of x[0].propertyInfos;let key = index" style="line-height: 65px;">
<span>{{i.propertyName}} {{i.physicalUnit}}:</span>
<mat-form-field *ngIf="i.propertyType == 0">
<input matInput name="{{www+2}}-tanker-{{key}}" type='text'
required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue"
>
</mat-form-field>
<textarea style="width: 180px;height: 45px;" *ngIf="i.propertyType == 1" [(ngModel)]="i.propertyValue" name="{{www+2}}-tanker-{{key}}"></textarea>
<span style="color: red;" *ngIf="i.required">*</span>
</div>
</div>
<p style="font-size: 22px; width: 200px;">{{x[1].name}}</p>
<div class="tankdetailinfo">
<table #table mat-table [dataSource]="x[1].propertyInfos" class="mat-elevation-z8" style="position: relative;">
<ng-container matColumnDef="tank">
<th mat-header-cell *matHeaderCellDef>
<button type="button" mat-icon-button class="adddeviceinfo" (click)="adddeviceinfo2(www,item)" style="position: absolute;left: 0;"><mat-icon>add_circle_outline</mat-icon></button>
<button type="button" mat-icon-button class="removedeviceinfo" (click)="removedeviceinfo3(www,item)"><mat-icon>remove_circle_outline</mat-icon></button>
罐区 </th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tank}}tank{{key}}" type='text'
[(ngModel)]="element.tank">
</td>
</ng-container>
<ng-container matColumnDef="tankid">
<th mat-header-cell *matHeaderCellDef>罐区编号<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tankid}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankid">
</td>
</ng-container>
<ng-container matColumnDef="tankmedium">
<th mat-header-cell *matHeaderCellDef>储存介质<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tankmedium}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankmedium">
</td>
</ng-container>
<ng-container matColumnDef="tanktype">
<th mat-header-cell *matHeaderCellDef>储罐类型<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tanktype}}tank{{key}}" type='text'
required
[(ngModel)]="element.tanktype">
</td>
</ng-container>
<ng-container matColumnDef="tankcapacity">
<th mat-header-cell *matHeaderCellDef>容量(m³)<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tankcapacity}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankcapacity">
</td>
</ng-container>
<ng-container matColumnDef="tankdiameter">
<th mat-header-cell *matHeaderCellDef>直径(m)<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tankdiameter}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankdiameter">
</td>
</ng-container>
<ng-container matColumnDef="tankheight">
<th mat-header-cell *matHeaderCellDef>高度(m)<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tankheight}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankheight">
</td>
</ng-container>
<ng-container matColumnDef="tanktectum">
<th mat-header-cell *matHeaderCellDef>顶盖形式</th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tanktectum}}tank{{key}}" type='text'
[(ngModel)]="element.tanktectum">
</td>
</ng-container>
<ng-container matColumnDef="tanktexture">
<th mat-header-cell *matHeaderCellDef>浮盘材质</th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.tanktexture}}tank{{key}}" type='text'
[(ngModel)]="element.tanktexture">
</td>
</ng-container>
<ng-container matColumnDef="platetype">
<th mat-header-cell *matHeaderCellDef>浮盘类型</th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.platetype}}tank{{key}}" type='text'
[(ngModel)]="element.platetype">
</td>
</ng-container>
<ng-container matColumnDef="foamgeneratorid">
<th mat-header-cell *matHeaderCellDef>泡沫产生器型号</th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.foamgeneratorid}}tank{{key}}" type='text'
[(ngModel)]="element.foamgeneratorid">
</td>
</ng-container>
<ng-container matColumnDef="foamgeneratortype">
<th mat-header-cell *matHeaderCellDef>泡沫产生器形式</th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.foamgeneratortype}}tank{{key}}" type='text'
[(ngModel)]="element.foamgeneratortype">
</td>
</ng-container>
<ng-container matColumnDef="isprotect">
<th mat-header-cell *matHeaderCellDef>是否设置氮封惰化保护装置</th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.isprotect}}tank{{key}}" type='text'
[(ngModel)]="element.isprotect">
</td>
</ng-container>
<ng-container matColumnDef="fendinggroyneheight">
<th mat-header-cell *matHeaderCellDef>防护堤高度(m)<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.fendinggroyneheight}}tank{{key}}" type='text'
required
[(ngModel)]="element.fendinggroyneheight">
</td>
</ng-container>
<ng-container matColumnDef="portnum">
<th mat-header-cell *matHeaderCellDef>半固定泡沫灭火接口数量</th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.portnum}}tank{{key}}" type='text'
[(ngModel)]="element.portnum">
</td>
</ng-container>
<ng-container matColumnDef="else">
<th mat-header-cell *matHeaderCellDef>其它设施</th>
<td mat-cell *matCellDef="let element;let key = index">
<input style="height:45px" class="tankinfo" name="{{www}}{{element.else}}tank{{key}}" type='text'
[(ngModel)]="element.else">
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns2"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns2;"></tr>
</table>
</div>
</div>
</div>
<div class="CustomData" style="width: 200px;margin-top: 60px;">
<mat-checkbox (change)="checkCustomData($event)" name="checkbuilding" [(ngModel)]="item.isCustomData" style="float: left;margin-right: 10px;"></mat-checkbox>
<h1 style="font-size: 22px;width: 200px;">自定义信息</h1>
</div>
<div *ngIf="item.isCustomData" style="position: relative;">
<button style="position: absolute;left: 0;font-size: 11px;" type="button" mat-icon-button (click)="addCustomData(item)" class="addCustomData"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button>
<button style="position: absolute;left:60px;" type="button" mat-icon-button (click)="deleteCustomData(item)" class="deleteCustomData"><mat-icon style="font-size: 38px;">remove_circle_outline</mat-icon></button>
<div class="houseinfoinput" style="float: left;margin-left: 250px;" *ngFor="let i of item.buildingCustomData.customProperties;let key = index">
<mat-form-field>
<input matInput type='text' name="{{key}}1CustomData"
required
[(ngModel)]="i.name">
</mat-form-field>
<span>:</span>
<mat-form-field>
<input matInput type='text' name="{{key}}2CustomData"
required
[(ngModel)]="i.value">
</mat-form-field>
<span style="color: red;" *ngIf="i.required">*</span>
</div>
</div>
</div>
<div class="infobtnbox">
<button type="submit()" mat-button mat-raised-button color="primary" >保存</button>
<button type="button" mat-raised-button (click)="deletedbuilding(item)" color="warn">删除</button>
</div>
</form>
</mat-tab>
</mat-tab-group>
</div>
</div>
</div>

269
src/app/ui/basicinfo/basicinfo.component.scss

@ -1,269 +0,0 @@
.topbox{
height: 485px;
width: 100%;
// border-bottom: 1px solid black;
.mainbox{
height: 100%;
position: relative;
.mainleft{
width:800px;
height: 100%;
// background-color: yellow;
float: left;
.inputbox{
width: 343px;
height: 58px;
margin:2px 6px;
float: left;
text-align: end;
}
.organizationbox{
width:538px;
height: 200px;
background: white;
position: absolute;
top: 164px;
left:166px;
z-index: 100;
border: 1px solid grey;
overflow: auto;
li{
list-style: none;
}
mat-tree-node{
cursor: pointer;
}
mat-tree-node:hover{
background: rgba(225, 225, 225, 0.8);
}
}
.addbtn{
width: 695px;
position: absolute;
bottom: -495px;
text-align: center;
margin-bottom:20px;
button{
margin: 0 4px;
}
}
.uploadimg{
width: 400px;
height: 200px;
float: left;
margin-top:12px;
position: relative;
margin-left: 80px;
cursor: pointer;
span{
float: left;
}
// img{
// float: left;
// }
.uploadingimg{
width: 299px;
height: 170px;
// background: url('../../../assets/images/upload2.png') no-repeat center center;
position: absolute;
top: 0px;
left: 79px;
border: 1px dashed gray;
border-radius:3px;
}
}
.image{
// position: absolute;
// top: 199px;
// left: 160px;
// width: 299px;
// height: 170px;
input{
// width: 299px;
// height: 170px;
width: 190px;
margin-top: 160px;
cursor: pointer;
}
// opacity:0;
}
}
.mainright{
float: left;
width: 600px;
height: 400px;
// position: absolute;
// right: 170px;
}
}
}
.bottombox{
// height:400px;
width: 100%;
// background-color: skyblue;
.bottomtitle{
height: 60px;
// background-color: orange;
line-height: 60px;
border-top: 1px solid black;
border-bottom: 1px solid black;
}
.houseinfobox{
// height:340px;
overflow: auto;
.addhouseinfo{
float: left;
}
.infobtnbox{
margin-left: 800px;
position: absolute;
top: 30px;
right: 75px;
button{
width: 80px;
height: 40px;
margin: 0 12px;
margin-top: 15px;
}
}
.infotitle{
font-size: 28px;
font-weight: 900;
margin-left: 180px;
}
.houseinfoinput{
width: 393px;
text-align: end;
margin-left:240px;
}
}
}
.btn{
width: 100%;
text-align: center;
button{
margin: 0 8px;
}
}
.mat-spinner{
margin-top: 58px;
margin-left: 203px;
}
.mat-table{
width: 100%;
}
table{
width: 1000px;
thead{
tr{
th{
width: 60px;
display: block;
float: left;
}
}
}
tbody{
tr{
td{
width: 60px;
display: block;
float: left;
text-align: center;
}
}
}
}
.deviceinfo{
// border-bottom: 1px solid black;;
padding-bottom: 60px;
}
.tankdetailinfo{
// border-bottom: 1px solid black;;
padding-bottom: 35px;
table{
th{
text-align: center;
}
}
}
.tankinfo{
display: block;
width: 100%;
// height: 45px;
text-align: center;
}
// .adddeviceinfo{
// // position: absolute;
// // left: 0px;
// }
.submit1{
margin-left: -66px !important;
}
textarea {
vertical-align: middle;
border-radius: 5px;
padding: 5px;
width: 600px;
height: 110px;
resize: none;
}
//预览图片旋转角度
.img1{
transform:rotate(90deg) scale(0.55);
height: 100%;
}
.img2{
transform:rotate(180deg);
// height: 100%;
}
.img3{
transform:rotate(270deg) scale(0.55);
// height: 100%;
}
.img4{
transform:rotate(90deg) scale(1.3);
// height: 100%;
}
.img5{
transform:rotate(180deg);
// height: 100%;
}
.img6{
transform:rotate(270deg) scale(1.3);
// height: 100%;
}
.imgbox{
text-align: center;
height: 750px;
img{
max-width: 1500px;
max-height: 740px;
}
}
.previewImgBottom{
text-align: center;
}
.alert-danger {
margin-top: -16px;
text-align: left;
padding-left: 77px;
font-size: 12px;
color: red;
}
.mat-expansion-panel{
span{
color: black;
}
}

2031
src/app/ui/basicinfo/basicinfo.component.ts

File diff suppressed because it is too large Load Diff

26
src/app/ui/basicinfo/lookmaster.component.html

@ -1,26 +0,0 @@
<div mat-dialog-title>单位照片</div>
<div>
<div>
<ng-container *ngIf="isshowimg; else elseTemplate">
<div class="imgbox">
<img class="imgitemdefault" [src]="ImgUrl">
<!-- <img class="imgitemdefault" [src]="ImgUrl" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" > -->
</div>
</ng-container>
<ng-template #elseTemplate >
<p style="text-align: center;">暂无单位图片,请先上传</p>
</ng-template>
</div>
</div>
<!--
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div> -->
<!-- <div class="previewImgBottom">
<button type="button" mat-icon-button (click)='rotate()'><mat-icon>refresh</mat-icon></button>
</div> -->

66
src/app/ui/basicinfo/lookmaster.component.ts

@ -1,66 +0,0 @@
import { Component, OnInit, Inject } from '@angular/core';
import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree';
import {FlatTreeControl} from '@angular/cdk/tree';
import { HttpClient } from '@angular/common/http';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
import {FormControl} from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
@Component({
selector: 'lookmaster',
templateUrl: './lookmaster.component.html',
styleUrls: ['./basicinfo.component.scss']
})
export class LookMaster {
// myControl = new FormControl();
//注入MatDialogRef,可以用来关闭对话框
//要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌
constructor(private http: HttpClient,public dialogRef: MatDialogRef<LookMaster>,@Inject(MAT_DIALOG_DATA) public data) {}
allunittype:any
ImgUrl:string
rotationAngle=0
isheng:any
isshowimg:boolean
onNoClick(): void {
this.dialogRef.close();
}
ngOnInit(): void {
if(this.data.img.indexOf('?') == -1){
this.isshowimg = false
}else{
this.isshowimg = true
var imgurl = this.data.img.split("?")
this.ImgUrl = imgurl[0]
}
}
//点击旋转按钮时
rotateA = 0
rotateB = 0
rotate(){
var w= document.getElementsByClassName("imgitemdefault")[0]['naturalWidth'];
var h = document.getElementsByClassName("imgitemdefault")[0]['naturalHeight'];
if(w > h){
this.isheng = true
}else{
this.isheng = false
}
if(this.isheng){
this.rotateA += 90
if(this.rotateA == 360){
this.rotateA = 0
}
}else{
this.rotateB += 10
if(this.rotateB == 40){
this.rotateB = 0
}
}
}
}

2
src/app/ui/collection-tools/addPlaneFigure.html

@ -4,7 +4,7 @@
<label *ngIf="data.isBuilding">新建楼层/区域</label>
</div>
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container" style="font-size: 16px;">
<div class="keyMargin">
<mat-form-field>

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

@ -7,8 +7,8 @@
<button mat-button (click)="toggle2()">
<mat-icon style="vertical-align: middle;">list</mat-icon>
</button>
<span style="color: gray;margin-right: 10px;margin-left: 10px;">图标大小</span>
<mat-form-field style="margin-top: 3px;">
<span style="color: gray;margin-right: 10px;margin-left: 10px;font-size: 16px;">图标大小</span>
<mat-form-field style="margin-top: 3px;font-size: 16px;">
<mat-select (selectionChange)='iconScale()' [(ngModel)]="selected">
<mat-option value="1">正常</mat-option>
<mat-option value="2">放大2倍</mat-option>
@ -23,7 +23,7 @@
<mat-icon style="padding-bottom: 7px;">screen_share</mat-icon>
</button>
<span [ngClass]="{'icongray': !basicInfo}" title="基本信息名称显示/隐藏" style="margin-right:20px;user-select: none;margin-left: 22px;" class="nameShow" (click)="basicInfoClick()">
<span [ngClass]="{'icongray': !basicInfo}" title="基本信息名称显示/隐藏" style="margin-right:20px;user-select: none;margin-left: 22px;font-size: 16px;" class="nameShow" (click)="basicInfoClick()">
基本信息名称
<mat-icon>visibility</mat-icon>
</span>
@ -31,17 +31,17 @@
想定作业名称
<mat-icon>visibility</mat-icon>
</span>
<div class="patternSwitch">
<!-- <div class="patternSwitch">
<span (click)="baseInfo()" [ngClass]="{'selectedPattern': pattern}">
基本信息编辑
</span>
<span (click)="wantWork()" [ngClass]="{'selectedPattern': !pattern}">
想定作业编辑
</span>
</div>
</div> -->
<span style="position: absolute;right: 60px;cursor: pointer;">
<mat-icon title="查看/编辑模式" (click)="lookpat()" *ngIf="isEditPattern">tv</mat-icon>
<mat-icon title="查看/编辑模式" (click)="editpat()" *ngIf="!isEditPattern">create</mat-icon>
<mat-icon title="查看/编辑模式" (click)="editpat()" *ngIf="!isEditPattern && isshow" >create</mat-icon>
<mat-icon *ngIf="isEditPattern " style="margin-left: 12px;" title="保存" (click)="saveSite()">description</mat-icon>
</span>
</div>
@ -50,7 +50,7 @@
<div class="headerOperate">
<button mat-button (click)="checkedBuilding({name:'总平面图'},-1)"
[ngClass]="{'buildingbtnchecked': checkedBuildingIndex==-1}">
<span>总平面图</span>
<span style="font-size: 16px;">总平面图</span>
<span *ngIf="isEditPattern && !pattern">
<img src="../../../assets/images/fire.png" *ngIf="sitePlanIcon.fire==2">
<img src="../../../assets/images/noFire.png" *ngIf="sitePlanIcon.fire==1">
@ -60,7 +60,7 @@
</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>
<span style="font-size: 16px;">{{item.name}}</span>
<span *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">
@ -69,9 +69,9 @@
</span>
<span class="editdeletebtn" *ngIf="isEditPattern && pattern">
<mat-icon (click)="editBuilding($event,item)"
style="font-size: 23px;vertical-align:sub;margin-left: 6px;color: rgb(26, 194, 26);">create</mat-icon>
style="font-size: 18px;vertical-align:sub;margin-left: 6px;color: rgb(26, 194, 26);">create</mat-icon>
<mat-icon (click)="deleteBuilding($event,item)"
style="font-size: 23px;vertical-align:sub;color: rgb(224, 51, 51);">delete</mat-icon>
style="font-size: 18px;vertical-align:sub;color: rgb(224, 51, 51);">delete</mat-icon>
</span>
</button>
<!-- <button (click)="yyy()">yyyyy</button> -->

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

@ -4,13 +4,13 @@
}
.content {
width: 100%;
height: 93%;
height:100%;
overflow: hidden;
box-sizing: border-box;
padding: 1px;
display: flex;
flex-direction: column;
font-size: 12px;
.buildingbtnchecked{
background-color: #34A6FD;
color: white;
@ -20,11 +20,12 @@
//header头部
.header {
position: relative;
flex: 5%;
flex: 3%;
display: flex;
align-items:center;
min-height: 40px;
min-height: 30px;
background-color: #fff;
font-size: 16px;
.nameShow{
cursor: pointer;
user-select: none;
@ -37,7 +38,7 @@
}
font-size: 18px;
mat-icon{
font-size: 26px;
font-size: 22px;
vertical-align: text-top;
}
span{
@ -48,7 +49,7 @@
position: absolute;
right: 140px;
span{
font-size: 18px;
font-size: 16px;
cursor: pointer;
margin: 0 3px;
display: inline-block;
@ -74,16 +75,18 @@
span{
font-size: 18px;
}
flex: 5%;
flex: 3%;
display: flex;
align-items:center;
min-height: 40px;
min-height: 30px;
box-sizing: border-box;
margin: 3px 0;
background-color: white;
button{
border: 0.5px solid rgb(208, 211, 214);
margin: 0 2px;
height: 30px;
line-height: 30px;
}
.editdeletebtn{
display: none;
@ -109,7 +112,7 @@
top: 0;
}
.functionalDomain {
flex: 90%;
flex: 94%;
overflow: hidden;
.functionalDomainContent {
position: relative;
@ -122,9 +125,10 @@
flex-direction: column;
margin-left: 0px;
transition: margin-left 0.5s;
min-width: 235px;
width: 1.953125rem;
min-width: 1.953125rem;
border: 1px solid #E6EAEE;
width: 235px;
left: 0;
z-index: 111;
.leftDragDiv{
@ -141,7 +145,8 @@
margin-right: 0px;
transition: margin-right 0.5s;
border: 1px solid #464646;
width: 235px;
width: 1.953125rem;
min-width: 1.953125rem;
right: 0;
}
@ -303,6 +308,7 @@
}
//右侧消防要素
.firecategories{
background-color: #fff;
position: relative;
display: flex;
flex-flow: column;

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

@ -610,11 +610,13 @@ export class CollectionToolsComponent implements OnInit {
this.canvasData.isChange = true
}
isshow = true//切换模式是否显示
ngOnInit(): void {
this.getAllLibrary() //获取素材库
this.getAllBuildings() //获取所有建筑
this.getAllFirePlan() //获取当前单位灾情
// this.getAllFirePlan() //获取当前单位灾情
let that = this
window.setTimeout(()=>{
@ -630,6 +632,14 @@ export class CollectionToolsComponent implements OnInit {
this.refurbishTreeData()
}
})
if(localStorage.getItem("pattern")=="edit"){
this.isEditPattern = true
}else if(localStorage.getItem("pattern") == "look"){
this.isshow = false
this.isEditPattern = false
}
}
@ -2128,6 +2138,7 @@ export class CreateBuilding {
allBuildingType:any//所有的建筑类型
selected:any; //选中的建筑
ngOnInit(): void {
this.getAllBuildingType()
}

2
src/app/ui/collection-tools/createBuilding.html

@ -1,5 +1,5 @@
<div mat-dialog-title>新增建筑</div>
<div>
<div style="font-size: 16px;">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<div mat-dialog-content>

2
src/app/ui/collection-tools/editBuilding.html

@ -1,6 +1,6 @@
<div mat-dialog-title>编辑建筑</div>
<div>
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container" style="font-size: 16px;">
<div mat-dialog-content>
<mat-form-field>
<input type="text" matInput [(ngModel)]="defaultName" required name="propertyName" placeholder="建筑名称" autocomplete="off">

2
src/app/ui/collection-tools/editPlaneFigure.html

@ -5,7 +5,7 @@
<label *ngIf="data.isBuilding">编辑楼层/区域</label>
</div>
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container" style="font-size: 16px;">
<div class="keyMargin">
<mat-form-field>

4
src/app/ui/collection-tools/panel.scss

@ -24,7 +24,7 @@
.hover {
width: 18px;
height: 18px;
margin-left: 90px;
margin-left: 40px;
border: 1px solid #999;
border-radius: 3px;
.mat-icon {font-size: 18px; color: #999;}
@ -215,7 +215,7 @@
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between; /* 水平居中 */
justify-content: space-around; /* 水平居中 */
.imgBox {
width: 70px;
height: 100px;

36
src/app/ui/find-problem/find-problem.component.html

@ -0,0 +1,36 @@
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2020-11-06 14:39:10
* @LastEditors: sueRimn
* @LastEditTime: 2020-11-07 19:32:56
-->
<div class="box">
<div class="topadd">
<button (click)="addPermission()">新增</button>
<button (click)="savaClick()">保存</button>
</div>
<div class="center">
<div class="one" *ngFor="let item of uploadSucced; let key=index">
<span>{{item.name}}</span>
<div style="margin-left: 80px;width: 280px;" class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide" *ngFor="let itemx of item.src; let key=index">
<img [src]="itemx" alt="" style="width: 200px; height: 100px;" >
<!-- <div class="swiper-lazy-preloader"></div> -->
</div>
</div>
<!-- 如果需要导航按钮 -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</div>
<input id="selectedfile" (change)="filechange($event,key)" type="file" name="imgFile" accept=".jpg,.png,.jpeg,.gif,.webp">
<textarea [(ngModel)]="item.text" name="" id="" cols="60" rows="6"></textarea>
<button (click)="deletePermission(key)">删除</button>
</div>
</div>
</div>

76
src/app/ui/find-problem/find-problem.component.scss

@ -0,0 +1,76 @@
.box{
width: 100%;
height: 100%;
.topadd{
width: 100%;
margin: 0.488281rem 0.097656rem;
button{
background-color: #008CBA; /* Green */
border: none;
border-radius: 8px;
color: white;
padding: 0.097656rem 0.488281rem;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 0.146484rem;
margin-left: 0.488281rem;
cursor: pointer;
}
}
.center{
width: 100%;
height: 100%;
display: flex;
flex-direction:column;
overflow: auto;
span{
font-size: 0.146484rem;
margin-left: 0.488281rem;
position: relative;
top: 0.488281rem;
}
textarea{
position: relative;
left: 15%;
bottom: 0.976563rem;
}
.one{
width: 100%;
height: 140px;
input{
z-index: 999;
width: 1.953125rem;
height: 0.976563rem;
position: relative;
left: 0.976563rem;
bottom: 180px;
opacity: 0;
margin-top: 0.048828rem;
cursor: pointer;
}
img{
position: relative;
margin-left: 20px;
}
}
button{
position: relative;
bottom: 150px;
left: 15%;
background-color: #FFFFFF; /* Green */
border: 1px solid #000000;
border-radius: 8px;
color: #000000;
padding: 0.097656rem 0.488281rem;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 0.146484rem;
margin-left: 0.488281rem;
cursor: pointer;
}
}
}

25
src/app/ui/find-problem/find-problem.component.spec.ts

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FindProblemComponent } from './find-problem.component';
describe('FindProblemComponent', () => {
let component: FindProblemComponent;
let fixture: ComponentFixture<FindProblemComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FindProblemComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FindProblemComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

154
src/app/ui/find-problem/find-problem.component.ts

@ -0,0 +1,154 @@
/*
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2020-11-06 14:39:10
* @LastEditors: sueRimn
* @LastEditTime: 2020-11-07 19:41:29
*/
import { Component, OnInit } from '@angular/core';
import { HttpClient,HttpHeaders, HttpEventType } from '@angular/common/http';
import { MatSnackBar ,MatSnackBarConfig} from '@angular/material/snack-bar';
import { FileUploader, FileItem } from 'ng2-file-upload'
import Swiper from 'swiper';
@Component({
selector: 'app-find-problem',
templateUrl: './find-problem.component.html',
styleUrls: ['./find-problem.component.scss']
})
export class FindProblemComponent implements OnInit {
constructor(public snackBar: MatSnackBar,private http: HttpClient) { }
testSwiper: Swiper;
ngOnInit(): void {
setTimeout(() => {
this.testSwiper = new Swiper('.swiper-container', {
direction: 'horizontal',
loop: true,
observer:true,//修改swiper自己或子元素时,自动初始化swiper
observeParents:true,//修改swiper的父元素时,自动初始化swiper
//lazy: true,
// 如果需要前进后退按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
}
});
}, 0);
}
ngAfterViewInit() {
console.log("d")
setTimeout(() => {
this.testSwiper = new Swiper('.swiper-container', {
direction: 'horizontal',
loop: true,
observer:true,//修改swiper自己或子元素时,自动初始化swiper
observeParents:true,//修改swiper的父元素时,自动初始化swiper
//lazy: true,
// 如果需要前进后退按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
}
});
}, 0);
}
ceshiimg=["../../../assets/images/upload.jpg","../../../assets/images/upload2.jpg"]
inputShow=true//控制input显隐
chooseid//key值
textareazhi="" //备注框初始化
imgsrc = "../../../assets/images/upload.jpg" //没有上传图片时显示的图片,当上传后就会被替换,即保存时需要传的图片地址参数
imgUrl = ""//返回来的图片地址后缀
file: any; //上传的文件
isspinner:boolean=false //控制进度圈的显示隐藏
//问题对象
knowRoute=[{name:`问题1`,idnum:""}]
num=1
//增加一行
addPermission(){
this.num++;
var nums=this.num.toString()
//this.knowRoute.push({name:"问题"+nums,idnum:""})
this.uploadSucced.push({name:"问题"+nums,src:[],text:""})
console.log(this.uploadSucced)
}
//删除一行
deletePermission(key){
this.uploadSucced.splice(key,1)
console.log(this.uploadSucced)
}
uploadSucced:any = JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"findproblem")) || [{name:"问题1",src:[],text:""}]//上传成功暂存对象
//保存点击事件
savaClick(){
// this.uploadSucced[this.chooseid].text=this.textareazhi
localStorage.setItem(sessionStorage.getItem("companyId")+"findproblem",JSON.stringify(this.uploadSucced))
alert("保存成功")
console.log(JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"xxx")) )
//this.snackBar.open('上传成功','确定',config);
}
//change选择文件
filechange(e,key) {
this.chooseid=key
this.file = e.target.files[0] || null //上传的文件
var reader = new FileReader();
reader.readAsDataURL(this.file);
var image:any = new Image();
reader.onload = function(){
image.src = reader.result
}
setTimeout(() => {
if(image.width>=4096 || image.height>=5000 ){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择分辨率小于4096*5000的图片','确定',config);
}else{
if(this.file){
this.startUploading(key)
}
}
}, 500);
}
//上传文件
startUploading(key) {
this.isspinner = true
let file = this.file || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB一个分片
if (file && fileSize <= shardSize) { //上传文件<=5MB时
// this.upload()
let formData = new FormData()
formData.append("file",file)
this.http.post(`/api/Objects/PlanPlatform/${sessionStorage.getItem('companyId')}`,formData).subscribe((data:any)=>{
this.isspinner = false
this.imgUrl = data.objectName
this.imgsrc = `/api/Objects/PlanPlatform/${this.imgUrl}?x-oss-process=image/resize,m_fill,h_170,w_299`
console.log(this.imgsrc)
console.log(this.uploadSucced)
this.uploadSucced[key].src.push(this.imgsrc)
//this.inputShow=false
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('上传成功','确定',config);
})
} else if (file && fileSize >= shardSize) { //上传文件>5MB时,分块上传
/* let data = { filename: file.name }
this.http.post(`/api/NewMultipartUpload/PlanPlatform/${this.unitinfo.id}`, {}, { params: data }).subscribe((data: any) => { //初始化分段上传
this.objectName = data.objectName
this.uploadId = data.uploadId
this.subsectionUploading()
}) */
}
}
}

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

@ -65,6 +65,8 @@ export class HomeComponent implements OnInit {
//查看详情
viewDetails () {
localStorage.setItem("pattern","look")
this.router.navigate([`/trainingrecordinfo`],{queryParams:{'id':'5fa4d863f8eb762cb03c6a72'}})
console.log('查看详情')
}

27
src/app/ui/know-route/know-route.component.html

@ -4,30 +4,31 @@
* @Author: sueRimn
* @Date: 2020-11-05 15:27:58
* @LastEditors: sueRimn
* @LastEditTime: 2020-11-06 10:33:56
* @LastEditTime: 2020-11-07 13:08:20
-->
<div class="box">
<div class="addbw">
<span>添加熟悉部位:</span>
<button (click)="addRoute($event)">消控室</button>
<button (click)="addRoute($event)">水泵房</button>
<button (click)="addRoute($event)">疏散楼梯</button>
<button (click)="addRoute($event)">各楼层</button>
<button (click)="addRoute($event)">楼层消火栓</button>
<button (click)="addRoute($event)">水泵结合器</button>
<button (click)="addRoute($event)">室外消防水源</button>
<button *ngFor="let item of knowBw; let key=index" (click)="addRoute($event,item)">{{item.name}}</button>
<button class="button" (click)="savaClick()">保存</button>
</div>
<div class="addRoute">
<span>添加路线:</span>
<input type="text" > <!-- [(ngModel)]="knowRoute" -->
<!-- <hr> -->
<span class="floot" [ngClass]="{'beijicolor': chooseid ==key}" (click)="knowroutwClick($event,key)" *ngFor="let item of knowRoute; let key=index">{{item.name+item.idnum}}</span>
<span class="floot" [ngClass]="{'beijicolor': chooseid ==key}" (click)="knowroutwClick($event,key,item)" *ngFor="let item of uploadSucced; let key=index">{{item.name}}-></span>
</div>
<div class="bottomAll">
<div class="upload"></div>
<div class="bottomAll" >
<div class="upload">
<div class="uploadingimg" id="viewerjs">
<img [src]="imgsrc" [attr.data-original]="imgsrc.split('?')[0]" alt="" style="width: 299px; height: 170px;" >
</div>
</div>
<div class="image" >
<input *ngIf="inputShow" id="selectedfile" (change)="filechange($event)" type="file" name="imgFile" accept=".jpg,.png,.jpeg,.gif,.webp">
</div>
<div class="remarks">
<span>备注:</span><br>
<textarea name="" id="" cols="50" rows="10"></textarea>
<textarea name="" id="" cols="50" rows="10" [(ngModel)]="textareazhi"></textarea>
</div>
</div>
</div>

60
src/app/ui/know-route/know-route.component.scss

@ -5,16 +5,28 @@
.addbw{
height: 0.488281rem;
width: 100%;
margin: 0.488281rem 0.097656rem;
margin: 0.488281rem 0.78125rem;
button{
margin-left: 0.097656rem;
}
.button {
background-color: #4CAF50; /* Green */
border: 0.009766rem;
color: white;
padding: 0.097656rem;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 0.146484rem;
margin-left: 0.488281rem;
cursor: pointer;
}
}
//添加路线
.addRoute{
width: 100%;
height: 1.464844rem;
margin: 0.488281rem 0.097656rem;
margin: 0.488281rem 0.78125rem;
position:relative;
white-space: nowrap;
input{
@ -46,12 +58,47 @@
//底部div
.bottomAll{
width: 100%;
height: 100%;
margin-top: 0.976563rem;
height: 30%;
//margin-top: 0.976563rem;
display: flex;
.upload{
width: 50%;
height: 50%;
height: 100%;
.uploadingimg{
width: 40%;
height: 30%;
// background: url('../../../assets/images/upload2.png') no-repeat center center;
position: absolute;
left: 0.488281rem;
//top: 0.097656rem;
bottom: 80px;
//border: 1px dashed gray;
border-radius:3px;
img{
margin-left: 0.195313rem;
margin-top: 0.097656rem;
}
}
}
.image{
// position: absolute;
// top: 199px;
// left: 160px;
// width: 299px;
// height: 170px;
input{
width: 2.929688rem;
height: 1.708984rem;
position: absolute;
left: 0.683594rem;
bottom: 0.78125rem;
opacity: 0;
margin-top: 0.048828rem;
cursor: pointer;
}
// opacity:0;
}
.remarks{
width: 50%;
@ -60,6 +107,9 @@
height: 0.488281rem;
width: 0.488281rem;
}
textarea{
margin-left: 0.195313rem;
}
}
}
//熟悉路线选中样式

188
src/app/ui/know-route/know-route.component.ts

@ -4,10 +4,13 @@
* @Author: sueRimn
* @Date: 2020-11-05 15:27:58
* @LastEditors: sueRimn
* @LastEditTime: 2020-11-06 10:30:10
* @LastEditTime: 2020-11-07 20:00:19
*/
import { Component, OnInit } from '@angular/core';
import { HttpClient,HttpHeaders, HttpEventType } from '@angular/common/http';
import { MatSnackBar ,MatSnackBarConfig} from '@angular/material/snack-bar';
import { FileUploader, FileItem } from 'ng2-file-upload'
import Viewer from 'viewerjs';
@Component({
selector: 'app-know-route',
templateUrl: './know-route.component.html',
@ -15,28 +18,185 @@ import { Component, OnInit } from '@angular/core';
})
export class KnowRouteComponent implements OnInit {
constructor() { }
constructor(public snackBar: MatSnackBar,private http: HttpClient) { }
ngOnInit(): void {
// this.uploadSucced = JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"xxx")) || []
}
//input框显隐
inputShow=true
//控制底部div显隐
showorfalse="www"
//判断选中路线的值
chooseid=-1
knowRoute=[
{name:``,idnum:""}
/* {name:`柳州支队`,idnum:"🠖"} */
]
chooseid:any
//熟悉路线对象
knowRoute=[{name:``,idnum:""}]
//熟悉部位对象
knowBw=[{name:"消控室"},{name:"水泵房"},{name:"疏散楼梯"},{name:"各楼层"},{name:"楼层消火栓"},{name:"水泵结合器"},{name:"室外消防水源"}]
textareazhi:""
//没有上传图片时显示的图片,当上传后就会被替换,即保存时需要传的图片地址参数
imgsrc = "../../../assets/images/upload.jpg"
imgUrl = ""//返回来的图片地址后缀
file: any; //上传的文件
objectName: any; //上传对象名
uploadId: any; //上传分块上传事件编号
isspinner:boolean=false //控制进度圈的显示隐藏
PartNumberETag: any = []; //分块上传每次返回需要保存的信息
//change选择文件
filechange(e) {
this.file = e.target.files[0] || null //上传的文件
var reader = new FileReader();
reader.readAsDataURL(this.file);
var image:any = new Image();
reader.onload = function(){
image.src = reader.result
}
setTimeout(() => {
if(image.width>=4096 || image.height>=5000 ){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择分辨率小于4096*5000的图片','确定',config);
}else{
if(this.file){
this.startUploading()
}
}
}, 500);
}
//上传文件
startUploading() {
this.isspinner = true
let file = this.file || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB一个分片
if (file && fileSize <= shardSize) { //上传文件<=5MB时
// this.upload()
let formData = new FormData()
formData.append("file",file)
this.http.post(`/api/Objects/PlanPlatform/${sessionStorage.getItem('companyId')}`,formData).subscribe((data:any)=>{
this.isspinner = false
this.imgUrl = data.objectName
this.imgsrc = `/api/Objects/PlanPlatform/${this.imgUrl}?x-oss-process=image/resize,m_fill,h_170,w_299`
console.log(this.imgsrc)
//localStorage.setItem(this.clickName,this.imgsrc)
//this.uploadSucced.push({name:this.clickName,src:this.imgsrc,smark})
this.uploadSucced[this.chooseid].src=this.imgsrc
this.inputShow=false
//this.uploadSucced[this.chooseid].smark=this.textareazhi
console.log(this.uploadSucced)
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('上传成功','确定',config);
})
} else if (file && fileSize >= shardSize) { //上传文件>5MB时,分块上传
/* let data = { filename: file.name }
this.http.post(`/api/NewMultipartUpload/PlanPlatform/${this.unitinfo.id}`, {}, { params: data }).subscribe((data: any) => { //初始化分段上传
this.objectName = data.objectName
this.uploadId = data.uploadId
this.subsectionUploading()
}) */
}
}
//开始分块上传
async subsectionUploading () {
let file = this.file || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB一个分片
let allSlice = Math.ceil(fileSize / shardSize) //总文件/5MB===共分多少段
for (let i = 0;i < allSlice;i++) { //循环分段上传
let start = i * shardSize //切割文件开始位置
let end = Math.min(fileSize, start + shardSize); //切割文件结束位置
let formData = new FormData()
formData.append("file",file.slice(start, end))
// 同步写法实现异步调用
let result = await new Promise((resolve, reject) => {
// await 需要后面返回一个 promise 对象
this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i+1}`,formData).subscribe((data:any)=>{
let msg = {
"partNumber":data.partNumber || null,
"eTag": data.eTag || null
}
resolve(msg) // 调用 promise 内置方法处理成功
})
});
this.PartNumberETag.push(result)
if (this.PartNumberETag.length === allSlice) {
this.endUploading()
}
}
}
//完成分块上传
endUploading() {
let data = this.PartNumberETag
let paramsData = { uploadId: this.uploadId }
this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`, data, { params: paramsData }).subscribe(data => {
this.imgsrc = `/api/Objects/PlanPlatform/${this.objectName}?x-oss-process=image/resize,m_fill,h_170,w_299`
this.isspinner = false
this.PartNumberETag = []
})
}
//熟悉部位点击事件
addRoute(event){
//console.log(event.target.innerHTML)
//this.knowRoute+=event.target.innerHTML+"🠖"
addRoute(event,item){
this.showorfalse = "show"
this.knowRoute.push({name:event.target.innerHTML,idnum:"🠖"})
this.uploadSucced.push({name:item.name,src:"",smark:""})
console.log(this.uploadSucced)
}
clickName
savekey
uploadSucced:any = JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"xxx")) || []//上传成功暂存对象
gallery
//熟悉路线点击事件
knowroutwClick(event,key){
console.log(event)
knowroutwClick(event,key,item){
setTimeout(() => {
if(document.getElementById('viewerjs')){
this.gallery = new Viewer(document.getElementById('viewerjs'),{
url: 'data-original'
});
}
}, 0);
this.showorfalse="show"
this.uploadSucced[key].smark = this.textareazhi
this.chooseid=key
//event.target.style.border="1px solid #000000"
this.clickName=item.name+key+sessionStorage.getItem("companyId")
//console.log("sss"+JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"xxx"))[key].src)
/* if(JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"xxx"))[key]){
} */
if( JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"xxx"))&& JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"xxx"))[key] && JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"xxx"))[key].src!=""){
this.imgsrc=JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"xxx"))[key].src
this.textareazhi=JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"xxx"))[key].smark
this.inputShow=false
}else if(this.uploadSucced[key].src!=""){
this.imgsrc=this.uploadSucced[key].src
this.inputShow=false
}
else{
this.imgsrc="../../../assets/images/upload.jpg"
this.textareazhi=""
this.inputShow=true
}
}
//保存点击事件
savaClick(){
this.uploadSucced[this.chooseid].smark=this.textareazhi
localStorage.setItem(sessionStorage.getItem("companyId")+"xxx",JSON.stringify(this.uploadSucced))
alert("保存成功")
console.log(JSON.parse(localStorage.getItem(sessionStorage.getItem("companyId")+"xxx")) )
}
}

95
src/app/ui/photoofthescene/photoofthescene.component.html

@ -0,0 +1,95 @@
<!-- 现场照片 -->
<table >
<tr>
<td>
<div class="noImg" *ngIf="!unitImg">
<div>
<img class="camera" src="../../../assets/images/camera.png" alt="">
</div>
<p>熟悉单位照片</p>
<div>
<span>单位整体建筑或大门照片,要求照拍照时要求设置拍照日期</span>
</div>
</div>
<div class="input" *ngIf="!unitImg && isEditPattern">
<input type="file" (change)="filechange1($event,'1')" name="imgFile" accept=".jpg,.png,.jpeg,.gif,.webp">
</div>
<div *ngIf="unitImg" id="viewerjs1">
<img class="image" [src]="unitImg" alt="" [attr.data-original]="unitImg.split('?')[0]">
</div>
<div *ngIf="unitImg && isEditPattern" class="deleteicon">
<button mat-icon-button (click)="deleteimg('1')">
<mat-icon>delete</mat-icon>
</button>
</div>
</td>
<td>
<div class="noImg" *ngIf="!lingdaoImg">
<div>
<img src="../../../assets/images/camera.png" alt="">
</div>
<p>领导带队现场熟悉照片</p>
<div>
<span>人员现场熟悉照片,要求有带队领导及熟悉人员现场熟悉场景,拍照时要求设置拍照日期</span>
</div>
</div>
<div class="input" *ngIf="!lingdaoImg && isEditPattern">
<input type="file" (change)="filechange1($event,'2')" name="imgFile" accept=".jpg,.png,.jpeg,.gif,.webp">
</div>
<div *ngIf="lingdaoImg" id="viewerjs2">
<img class="image" [src]="lingdaoImg" alt="" [attr.data-original]="lingdaoImg.split('?')[0]">
</div>
<div *ngIf="lingdaoImg && isEditPattern" class="deleteicon">
<button mat-icon-button (click)="deleteimg('2')">
<mat-icon>delete</mat-icon>
</button>
</div>
</td>
</tr>
<tr>
<td>
<div class="noImg" *ngIf="!peopleImg">
<div>
<img src="../../../assets/images/camera.png" alt="">
</div>
<p>人员现场熟悉照片</p>
<div>
<span>人员现场熟悉照片,要求有熟悉人员现场熟悉场景,拍照时要求设置拍照日期</span>
</div>
</div>
<div class="input" *ngIf="!peopleImg && isEditPattern">
<input type="file" (change)="filechange1($event,'3')" name="imgFile" accept=".jpg,.png,.jpeg,.gif,.webp">
</div>
<div *ngIf="peopleImg" id="viewerjs3">
<img class="image" [src]="peopleImg" alt="" [attr.data-original]="peopleImg.split('?')[0]">
</div>
<div *ngIf="peopleImg && isEditPattern" class="deleteicon">
<button mat-icon-button (click)="deleteimg('3')">
<mat-icon>delete</mat-icon>
</button>
</div>
</td>
<td>
<div class="noImg" *ngIf="!keysiteImg">
<div>
<img src="../../../assets/images/camera.png" alt="">
</div>
<p>单位重点部位照片</p>
<div>
<span>重点部位照片,拍照时要求设置拍照日期</span>
</div>
</div>
<div class="input" *ngIf="!keysiteImg && isEditPattern">
<input type="file" (change)="filechange1($event,'4')" name="imgFile" accept=".jpg,.png,.jpeg,.gif,.webp">
</div>
<div *ngIf="keysiteImg" id="viewerjs4">
<img class="image" [src]="keysiteImg" alt="" [attr.data-original]="keysiteImg.split('?')[0]">
</div>
<div *ngIf="keysiteImg && isEditPattern" class="deleteicon">
<button mat-icon-button (click)="deleteimg('4')">
<mat-icon>delete</mat-icon>
</button>
</div>
</td>
</tr>
</table>

39
src/app/ui/photoofthescene/photoofthescene.component.scss

@ -0,0 +1,39 @@
table{
margin: 0 auto;
width: 85%;
height: 80%;
margin-top: 5%;
border-collapse: collapse;
td{
position: relative;
width: 50%;
height: 2.246094rem;
p{
font-size: 20px;
margin: 8px 0;
}
span{
font-size: 15px;
font-weight: 500;
color: gray;
}
input{
position: absolute;
width: 100%;
height: 2.246094rem;
left: 0;
top: 0;
opacity: 0;
}
.image{
height: 100%;
width: 299px;
}
.deleteicon{
position: absolute;
right: 0.058594rem;
top: 0.058594rem;
}
}
}
table,table tr th, table tr td { border:1px solid black;text-align: center; }

25
src/app/ui/photoofthescene/photoofthescene.component.spec.ts

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { PhotoofthesceneComponent } from './photoofthescene.component';
describe('PhotoofthesceneComponent', () => {
let component: PhotoofthesceneComponent;
let fixture: ComponentFixture<PhotoofthesceneComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ PhotoofthesceneComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(PhotoofthesceneComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

173
src/app/ui/photoofthescene/photoofthescene.component.ts

@ -0,0 +1,173 @@
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { MatSnackBar ,MatSnackBarConfig} from '@angular/material/snack-bar';
import Viewer from 'viewerjs';
@Component({
selector: 'app-photoofthescene',
templateUrl: './photoofthescene.component.html',
styleUrls: ['./photoofthescene.component.scss']
})
export class PhotoofthesceneComponent implements OnInit {
constructor(private http: HttpClient,public snackBar: MatSnackBar) { }
gallery//viewerJs实例
isEditPattern = true
ngOnInit(): void {
setTimeout(() => {
if(document.getElementById('viewerjs1')){
this.gallery = new Viewer(document.getElementById('viewerjs1'),{
url: 'data-original'
});
}
if(document.getElementById('viewerjs2')){
this.gallery = new Viewer(document.getElementById('viewerjs2'),{
url: 'data-original'
});
}
if(document.getElementById('viewerjs3')){
this.gallery = new Viewer(document.getElementById('viewerjs3'),{
url: 'data-original'
});
}
if(document.getElementById('viewerjs4')){
this.gallery = new Viewer(document.getElementById('viewerjs4'),{
url: 'data-original'
});
}
}, 0);
if(localStorage.getItem("pattern")=="edit"){
this.isEditPattern = true
}else if(localStorage.getItem("pattern") == "look"){
this.isEditPattern = false
}
}
unitImg:any = localStorage.getItem(sessionStorage.getItem("companyId") + "1") || ""
lingdaoImg:any = localStorage.getItem(sessionStorage.getItem("companyId") + "2") || ""
peopleImg:any = localStorage.getItem(sessionStorage.getItem("companyId") + "3") || ""
keysiteImg:any = localStorage.getItem(sessionStorage.getItem("companyId") + "4") || ""
//删除照片
deleteimg(num){
var msg = "您真的确定要删除吗?";
if (confirm(msg)==true){
localStorage.removeItem(sessionStorage.getItem('companyId')+num)
if(num == "1"){
this.unitImg = ""
}
if(num == "2"){
this.lingdaoImg = ""
}
if(num == "3"){
this.peopleImg = ""
}
if(num == "4"){
this.keysiteImg = ""
}
}else{
return false;
}
}
//熟悉单位照片上传
file:any
filechange1(e,index){
this.file = e.target.files[0] || null //上传的文件
var reader = new FileReader();
reader.readAsDataURL(this.file);
var image:any = new Image();
reader.onload = function(){
image.src = reader.result
}
setTimeout(() => {
if(image.width>=4096 || image.height>=5000 ){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择分辨率小于4096*5000的图片','确定',config);
}else{
if(this.file){
this.startUploading(index)
}
}
}, 500);
}
isspinner:any //进度圈
imgUrl:any //上传后的图片地址
imgsrc:any //上传后的缩略图地址
//上传文件
startUploading(type) {
this.isspinner = true
let file = this.file || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB一个分片
if (file && fileSize <= shardSize) { //上传文件<=5MB时
// this.upload()
let formData = new FormData()
formData.append("file",file)
this.http.post(`/api/Objects/PlanPlatform/${sessionStorage.getItem('companyId')}`,formData).subscribe((data:any)=>{
this.isspinner = false
this.imgUrl = data.objectName
this.imgsrc = `/api/Objects/PlanPlatform/${this.imgUrl}?x-oss-process=image/resize,m_fill,h_170,w_299`
localStorage.setItem(sessionStorage.getItem("companyId") + type, this.imgsrc)
if(type == '1'){
this.unitImg = this.imgsrc
setTimeout(() => {
this.gallery = new Viewer(document.getElementById('viewerjs1'),{
url: 'data-original'
});
}, 0);
}
if(type == '2'){
this.lingdaoImg = this.imgsrc
setTimeout(() => {
this.gallery = new Viewer(document.getElementById('viewerjs2'),{
url: 'data-original'
});
}, 0);
}
if(type == '3'){
this.peopleImg = this.imgsrc
setTimeout(() => {
this.gallery = new Viewer(document.getElementById('viewerjs3'),{
url: 'data-original'
});
}, 0);
}
if(type == '4'){
this.keysiteImg = this.imgsrc
setTimeout(() => {
this.gallery = new Viewer(document.getElementById('viewerjs4'),{
url: 'data-original'
});
}, 0);
}
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('上传成功','确定',config);
})
} else if (file && fileSize >= shardSize) { //上传文件>5MB时,分块上传
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请上传小于5M图片','确定',config);
// let data = { filename: file.name }
// this.http.post(`/api/NewMultipartUpload/PlanPlatform/${this.unitinfo.id}`, {}, { params: data }).subscribe((data: any) => { //初始化分段上传
// this.objectName = data.objectName
// this.uploadId = data.uploadId
// this.subsectionUploading()
// })
}
}
}

4
src/app/ui/router-gis/router-gis.component.html

@ -1,3 +1,7 @@
<div class="content">
<div class="center" id="center"></div>
<div class="btnbox">
<div class="btn" (click)="next()">已到达熟悉单位</div>
<div (click)="back()">取消本次任务</div>
</div>
</div>

23
src/app/ui/router-gis/router-gis.component.scss

@ -4,8 +4,31 @@
box-sizing: border-box;
padding: 0.244141rem;
overflow: hidden;
position: relative;
.center {
width: 100%;
height: 100%;
}
.btnbox{
position: absolute;
left: 50%;
bottom: 7%;;
transform: translateX(-50%);
display: flex;
div{
text-align: center;
width: 1.757813rem;
height: 0.46875rem;
line-height: 0.46875rem;
opacity: 1;
border-radius: 0.292969rem;
font-size: 0.15625rem;
margin: 0 12px;
background: #E9EAF3;
}
.btn{
background: linear-gradient(337deg, #FC7045 0%, #FF4923 100%);
color: #fff;
}
}
}

23
src/app/ui/router-gis/router-gis.component.ts

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
declare var AMap: any;
@Component({
@ -7,18 +7,18 @@ declare var AMap: any;
styleUrls: ['./router-gis.component.scss']
})
export class RouterGISComponent implements OnInit {
@Output() onCustomEvent: EventEmitter<any> = new EventEmitter();//创建实力
constructor() { }
ngOnInit(): void {
}
ngAfterViewInit(): void {
window.setTimeout(()=>{
this.mapInit()
},0)
}
ngAfterViewInit(): void {
}
//地图初始化
mapInit () {
@ -45,4 +45,15 @@ export class RouterGISComponent implements OnInit {
//new AMap.LngLat(116.379028, 39.865042), new AMap.LngLat(116.427281, 39.903719) / [{keyword: '淄博站',city:'山东'},{keyword: '淄博北站',city:'山东'}], //路线可搜索, 可用坐标
}
//下一步
next(){
this.emitEvent()
}
private emitEvent(){
this.onCustomEvent.emit('data from child');//通过emit可将需要传递的数据发送给父组件
}
//取消
back(){
window.history.back();
}
}

67
src/app/ui/training-recordinfo/training-recordinfo.component.html

@ -1,3 +1,11 @@
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2020-11-06 10:44:49
* @LastEditors: sueRimn
* @LastEditTime: 2020-11-06 17:07:16
-->
<div class="bigbox">
<div class="title">
<app-title [title]="title"></app-title>
@ -5,23 +13,58 @@
<div class="content">
<div class="cardbox">
<mat-tab-group style="height: 100%;">
<mat-tab-group style="height: 97%;" [selectedIndex]="tabsSelectedIndex" (selectedTabChange)="selectedtab($event)">
<mat-tab label="行驶路线">
<app-router-gis></app-router-gis>
<ng-template matTabContent>
<app-router-gis (onCustomEvent)="onCustom($event)"></app-router-gis>
</ng-template>
</mat-tab>
<mat-tab label="熟悉路线"> 熟悉路线 </mat-tab>
<mat-tab label="单位基本情况">
<app-basicinfo></app-basicinfo>
<mat-tab label="熟悉路线">
<ng-template matTabContent>
<app-know-route></app-know-route>
</ng-template>
</mat-tab>
<mat-tab label="单位基本情况">
<ng-template matTabContent>
<app-basicinfo></app-basicinfo>
</ng-template>
</mat-tab>
<mat-tab label="平面图">
<ng-template matTabContent>
<app-collection-tools></app-collection-tools>
</ng-template>
</mat-tab>
<mat-tab label="安全疏散设施情况">
<ng-template matTabContent>
<app-fire-fighting-device></app-fire-fighting-device>
</ng-template>
</mat-tab>
<mat-tab label="平面图"> 平面图 </mat-tab>
<mat-tab label="安全疏散设施情况"> 安全疏散设施情况 </mat-tab>
<mat-tab label="消防设施情况">
<app-fire-fighting-device></app-fire-fighting-device>
<ng-template matTabContent>
<app-fire-fighting-device></app-fire-fighting-device>
</ng-template>
</mat-tab>
<mat-tab label="水源道路情况">
<ng-template matTabContent>
<app-water-road></app-water-road>
</ng-template>
</mat-tab>
<mat-tab label="重点部位情况">
<ng-template matTabContent>
<app-key-site></app-key-site>
</ng-template>
</mat-tab>
<mat-tab label="发现问题"> <app-find-problem></app-find-problem> </mat-tab>
<mat-tab label="现场照片">
<ng-template matTabContent>
<app-photoofthescene></app-photoofthescene>
</ng-template>
</mat-tab>
<mat-tab label="水源道路情况"> 水源道路情况 </mat-tab>
<mat-tab label="重点部位情况"> 重点部位情况 </mat-tab>
<mat-tab label="发现问题"> 发现问题 </mat-tab>
<mat-tab label="现场照片"> 现场照片 </mat-tab>
</mat-tab-group>
</div>
</div>

11
src/app/ui/training-recordinfo/training-recordinfo.component.ts

@ -6,10 +6,17 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./training-recordinfo.component.scss']
})
export class TrainingRecordinfoComponent implements OnInit {
tabsSelectedIndex:any = 0//当前选项卡值
constructor() { }
title:any = "训练记录信息"
ngOnInit(): void {
}
onCustom($event){
console.log($event);//data from child
this.tabsSelectedIndex = 1
}
selectedtab(e){
sessionStorage.setItem("tabsindex",e.index)
// console.log(e.index)
}
}

6
src/app/ui/ui.module.ts

@ -65,8 +65,12 @@ import { HomeComponent } from './home/home.component';
import { TrainingRecordinfoComponent } from './training-recordinfo/training-recordinfo.component';
import { RouterGISComponent } from './router-gis/router-gis.component';
import { KeyUnitModule } from '../key-unit/key-unit.module';
import { PhotoofthesceneComponent } from './photoofthescene/photoofthescene.component';
import { EditText, WaterRoadComponent } from './water-road/water-road.component';
import { KnowRouteComponent } from './know-route/know-route.component';
import { FindProblemComponent } from './find-problem/find-problem.component';
@NgModule({
declarations: [UiComponent, FooterComponent, UserdataComponent, ChangepasswordComponent,IsnoPipe,ConfirmpswDirective,TimePipe,EditUser,CollectionToolsComponent,WorkingAreaComponent,CreateBuilding,EditBuilding,leftFunctionalDomainComponent,editPlaneFigureComponent,ViewDetails,saveOneDialog,saveTwoDialog,addDisposalNodeComponent,editDisposalNodeComponent,HomeComponent, AddSixFamiliarComponent, TitleComponent, SelectUnit, TrainingRecordinfoComponent,RouterGISComponent],
declarations: [UiComponent, FooterComponent, UserdataComponent, ChangepasswordComponent,IsnoPipe,ConfirmpswDirective,TimePipe,EditUser,CollectionToolsComponent,WorkingAreaComponent,CreateBuilding,EditBuilding,leftFunctionalDomainComponent,editPlaneFigureComponent,ViewDetails,saveOneDialog,saveTwoDialog,addDisposalNodeComponent,editDisposalNodeComponent,HomeComponent, AddSixFamiliarComponent, TitleComponent, SelectUnit, TrainingRecordinfoComponent,RouterGISComponent, PhotoofthesceneComponent, WaterRoadComponent,FindProblemComponent,KnowRouteComponent,EditText],
imports: [
CommonModule,

14
src/app/ui/water-road/edittext.html

@ -0,0 +1,14 @@
<div class="dialogbox">
<div class="title">
<span style="color: #FC7045;">说明:</span>
<span>水源情况主要包括消火栓位置、管径、外观完好情况、停车取水位置试水情况,消防水池位置、容量、停车取水位置、取水测试情况,取消码头位置、水位、停车取水位置等;道路情况主要包括道路长度、宽度、起始点、沿线重点单位、立交、桥梁、涵洞及其通车能力。</span>
<span style="color: #FC7045;">【该项主要在道路水源熟悉时填写】</span>
</div>
<div class="text">
<textarea [disabled]="!isEditPattern" name="" id="" cols="30" rows="10" placeholder="请输入水源情况" [(ngModel)]="textcontant"></textarea>
</div>
<div class="btnbox">
<div *ngIf="isEditPattern" (click)="ok()">确认</div>
<div (click)="cancel()">取消</div>
</div>
</div>

19
src/app/ui/water-road/water-road.component.html

@ -0,0 +1,19 @@
<div class="content">
<div class="center" id="map"></div>
<!-- <div class="textbox">
<div class="btn">
<span>
<mat-icon (click)="save()">description</mat-icon>
<mat-icon (click)="clickicon()">create</mat-icon>
</span>
</div>
<div class="text" [hidden]="!isshow">
<textarea [(ngModel)]="textcontant" name="" id="" cols="28" rows="18" placeholder="水源情况主要包括消火栓位置、管径、外观完好情况、停车取水位置试水情况,消防水池位置、容量、停车取水位置、取水测试情况,取消码头位置、水位、停车取水位置等;道路情况主要包括道路长度、宽度、起始点、沿线重点单位、立交、桥梁、涵洞及其通车能力。【该项主要在道路水源熟悉时填写】"></textarea>
</div>
</div> -->
<div class="editbtn" (click)="opendialog()">
<p><mat-icon>create</mat-icon></p>
<p style="color: #fff;">编辑</p>
</div>
</div>

82
src/app/ui/water-road/water-road.component.scss

@ -0,0 +1,82 @@
.content {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 0.244141rem;
overflow: hidden;
position: relative;
.center {
width: 100%;
height: 100%;
}
.textbox{
position: absolute;
z-index: 999;
right: 0.244141rem;
top:0.244141rem;
.btn{
text-align: right;
}
}
.editbtn{
text-align: center;
position: absolute;
right: 0.507813rem;
bottom: 0.439453rem;
width: 0.976563rem;
height: 0.976563rem;
line-height: 0.859375rem;
background: linear-gradient(360deg, #FC7045 0%, #FF4923 100%);
box-shadow: 0px 2px 10px #D8A798;
border-radius: 50%;
opacity: 1;
p{
height: 0.175781rem;
font-size: 0.15625rem;
color: #fff;
}
}
}
.dialogbox{
width: 7.441406rem;
height: 5.761719rem;
.title{
span{
font-size: 16px;
}
}
.text{
width: 97%;
height: 3.554688rem;
margin-top: 0.351563rem;
background: #F4F5F9;
border-radius: 10px;
textarea{
width: 100%;
height: 100%;
}
}
.btnbox{
display: flex;
margin-top: 0.351563rem;
justify-content: center;
div{
font-size: 0.15625rem;
width: 1.757813rem;
height: 0.46875rem;
line-height: 0.46875rem;
text-align: center;
background: #E9EAF3;
opacity: 1;
border-radius: 30px;
margin: 0 10px;
}
div:nth-child(1){
color: #fff;
background: linear-gradient(337deg, #FC7045 0%, #FF4923 100%);
}
}
}

12
src/app/ui/basicinfo/basicinfo.component.spec.ts → src/app/ui/water-road/water-road.component.spec.ts

@ -1,20 +1,20 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BasicinfoComponent } from './basicinfo.component';
import { WaterRoadComponent } from './water-road.component';
describe('BasicinfoComponent', () => {
let component: BasicinfoComponent;
let fixture: ComponentFixture<BasicinfoComponent>;
describe('WaterRoadComponent', () => {
let component: WaterRoadComponent;
let fixture: ComponentFixture<WaterRoadComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ BasicinfoComponent ]
declarations: [ WaterRoadComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(BasicinfoComponent);
fixture = TestBed.createComponent(WaterRoadComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

135
src/app/ui/water-road/water-road.component.ts

@ -0,0 +1,135 @@
import { Component, Inject, OnInit } from '@angular/core';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
declare var AMap: any;
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
@Component({
selector: 'app-water-road',
templateUrl: './water-road.component.html',
styleUrls: ['./water-road.component.scss']
})
export class WaterRoadComponent implements OnInit {
constructor(public snackBar: MatSnackBar,public dialog: MatDialog) { }
isshow:boolean = true
textcontant:any = localStorage.getItem(sessionStorage.getItem("companyId") + "waterroad") || ""
clickicon(){
this.isshow = !this.isshow
}
save(){
localStorage.setItem(sessionStorage.getItem("companyId") + "waterroad",this.textcontant)
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
}
map:any //地图
ngOnInit(): void {
setTimeout(() => {
this.creatMap()
}, 0);
}
creatMap(){
var satellite = new AMap.TileLayer.Satellite();
var roadNet = new AMap.TileLayer.RoadNet();
// 创建一个 icon
var startIcon = new AMap.Icon({
image: '../../../assets/images/fireHydrant.png',
// // 图标所用图片大小
imageSize: new AMap.Size(20, 20),
// // 图标取图偏移量
// imageOffset: new AMap.Pixel(-9, -3)
});
let arr = [{lng:108.299405,lat: 22.894884},
{lng:108.597409,lat: 22.80883},
{lng:108.689419,lat: 23.061775},
{lng:107.971188,lat: 22.950537},
{lng:107.847592,lat: 23.090833},
{lng:108.176374,lat: 22.790585},
{lng:108.407087,lat: 22.671522},
{lng:108.158521,lat: 22.61322},
{lng:107.925062,lat: 22.565038},
{lng:108.180494,lat: 22.501616},
{lng:107.743222,lat: 22.535121},
{lng:108.373809,lat: 22.764746},
{lng:108.378895,lat: 22.761877},
{lng:108.383337,lat: 22.766467},
{lng:108.37647,lat: 22.763341},
{lng:108.37662,lat: 22.767397},
{lng:108.378916,lat: 22.758513},
{lng:108.379045,lat: 22.765695},
{lng:108.384731,lat: 22.760096},]
let Arr = []
arr.forEach(item=>{
let viaMarker = new AMap.Marker({
position: new AMap.LngLat(item.lng, item.lat),
icon: startIcon,
offset: new AMap.Pixel(-10, -10)
})
Arr.push(viaMarker)
})
this.map = new AMap.Map('map',{
center: [108.377865, 22.763499], //初始地图中心点
zoom: 16
});
this.map.on('click', (e) => {
console.log(e.lnglat.getLng() + ',' + e.lnglat.getLat())
});
// this.map.setCity('南宁市')
this.map.add(Arr);//火源标点
}
opendialog(){
let dialogRef = this.dialog.open(EditText);
dialogRef.afterClosed().subscribe(data=>{
if(data){
}
});
}
}
//编辑水源道路情况
@Component({
selector: 'app-editBuilding',
templateUrl: './edittext.html',
styleUrls: ['./water-road.component.scss']
})
export class EditText {
constructor(public snackBar: MatSnackBar,public dialog: MatDialog,public dialogRef: MatDialogRef<EditText>,@Inject(MAT_DIALOG_DATA) public data) { }
textcontant:any = localStorage.getItem(sessionStorage.getItem("companyId") + "waterroad") || ""//输入内容
isEditPattern = true
ngOnInit(): void {
if(localStorage.getItem("pattern")=="edit"){
this.isEditPattern = true
}else if(localStorage.getItem("pattern") == "look"){
this.isEditPattern = false
}
}
//确定
ok(){
localStorage.setItem(sessionStorage.getItem("companyId") + "waterroad",this.textcontant)
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存成功','确定',config);
this.dialogRef.close();
}
//取消
cancel(){
this.dialogRef.close();
}
}

BIN
src/assets/images/camera.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 942 B

BIN
src/assets/images/fireHydrant.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Loading…
Cancel
Save