徐振升 5 years ago
parent
commit
5190ddcd12
  1. 73
      package-lock.json
  2. 2
      src/app/pages/login/login.component.html
  3. 2
      src/app/pages/register/register.component.html
  4. 81
      src/app/ui/allaround/allaround.component.html
  5. 148
      src/app/ui/allaround/allaround.component.scss
  6. 69
      src/app/ui/allaround/allaround.component.ts
  7. 34
      src/app/ui/allaround/imgdetails.component.html
  8. 116
      src/app/ui/allaround/imgdetails.component.ts
  9. 164
      src/app/ui/basicinfo/basicinfo.component.html
  10. 11
      src/app/ui/basicinfo/basicinfo.component.scss
  11. 1674
      src/app/ui/basicinfo/basicinfo.component.ts
  12. 227
      src/app/ui/fire-fighting-device/fire-fighting-device.component.html
  13. 224
      src/app/ui/fire-fighting-device/fire-fighting-device.component.scss
  14. 40
      src/app/ui/fire-fighting-device/fire-fighting-device.component.ts
  15. 13
      src/app/ui/fire-fighting-device/imagesdata.component.html
  16. 46
      src/app/ui/fire-fighting-device/imagesdata.component.ts
  17. 24
      src/app/ui/fire-fighting-device/imgsdatadetail.component.html
  18. 102
      src/app/ui/fire-fighting-device/imgsdatadetail.component.ts
  19. 22
      src/app/ui/function-division/function-division.component.html
  20. 10
      src/app/ui/function-division/function-division.component.scss
  21. 21
      src/app/ui/function-division/function-division.component.ts
  22. 163
      src/app/ui/key-site/key-site.component.html
  23. 259
      src/app/ui/key-site/key-site.component.scss
  24. 170
      src/app/ui/key-site/key-site.component.ts
  25. 23
      src/app/ui/key-site/keyimgdetail.component.html
  26. 93
      src/app/ui/key-site/keyimgdetail.component.ts
  27. 30
      src/app/ui/key-site/keysiteimgs.component.html
  28. 87
      src/app/ui/key-site/keysiteimgs.component.ts
  29. 2
      src/app/ui/realistic-picture/addRealPicture.html
  30. 2
      src/app/ui/realistic-picture/editRealPicture.html
  31. 1
      src/app/ui/realistic-picture/previewImg.html
  32. 8
      src/app/ui/realistic-picture/realistic-picture.component.html
  33. 8
      src/app/ui/realistic-picture/realistic-picture.component.scss
  34. 40
      src/app/ui/realistic-picture/realistic-picture.component.ts
  35. 2
      src/app/ui/uploading-cad/editFile.html
  36. 2
      src/app/ui/uploading-cad/readFile.html
  37. 2
      src/app/ui/uploading-cad/uploading-cad.component.html
  38. 26
      src/app/ui/uploading-cad/uploading-cad.component.ts
  39. 6
      src/styles.scss

73
package-lock.json generated

@ -9969,7 +9969,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@ -9990,12 +9991,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -10010,17 +10013,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -10150,6 +10156,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -10164,6 +10171,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@ -10171,12 +10179,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.9.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@ -10195,6 +10205,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -10284,7 +10295,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@ -10296,6 +10308,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -10381,7 +10394,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@ -10417,6 +10431,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -10436,6 +10451,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -10479,12 +10495,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},
@ -16897,7 +16915,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@ -16925,6 +16944,7 @@
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -16939,7 +16959,8 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
@ -16950,7 +16971,8 @@
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@ -17067,7 +17089,8 @@
"inherits": {
"version": "2.0.4",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@ -17079,6 +17102,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -17093,6 +17117,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@ -17100,12 +17125,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.9.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@ -17124,6 +17151,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -17213,7 +17241,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@ -17225,6 +17254,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -17310,7 +17340,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@ -17346,6 +17377,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -17365,6 +17397,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -17408,12 +17441,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},

2
src/app/pages/login/login.component.html

@ -4,7 +4,7 @@
<div>
<div class="card">
<span class="cardheader">数据采集管理平台</span>
<span class="cardheader">数据采集平台</span>
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<div class="input">

2
src/app/pages/register/register.component.html

@ -4,7 +4,7 @@
<div>
<div class="card">
<span class="cardheader">数据采集管理平台</span>
<span class="cardheader">数据采集平台</span>
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<div class="input">

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

@ -1,23 +1,68 @@
<div class="tabbar">
<span style="margin:0 20px;">单位毗邻</span>
<button mat-raised-button color="primary">建筑一</button>
</div>
<div class="content">
<mat-tab-group>
<mat-tab label="单位毗邻">
<div class="allImgs">
<div class="aroundimagebox">
<div class="aroundimage">
<div class="imgBox" *ngFor="let item of AllAdjoining" >
<div class="fixedImg" *ngIf="item.imageUrls.length">
<img [src]="item.imageUrls[0]" onerror="javascript:this.src='../../../assets/images/upload.png'" (click)='imgdetails(item.imageUrls)'>
</div>
<div class="fixedImg" *ngIf="!item.imageUrls.length">
<img src="../../../assets/images/upload.png" (click)='imgdetails(item.imageUrls)'>
</div>
<div style="margin-top: 10px;">
<label style="margin-left: 25px;">建筑物名称:</label>
<label style="margin-left: 25px;">{{item.name}}</label>
</div>
<div style="margin-top: 10px;">
<label style="margin-left: 25px;">建筑物方向:</label>
<label style="margin-left: 25px;">
<label *ngIf="item.direction==0"></label>
<label *ngIf="item.direction==1">西</label>
<label *ngIf="item.direction==2"></label>
<label *ngIf="item.direction==3"></label>
<label *ngIf="item.direction==4">东南</label>
<label *ngIf="item.direction==5">西南</label>
<label *ngIf="item.direction==6">东北</label>
<label *ngIf="item.direction==7">西北</label>
</label>
</div>
</div>
<p style="width: 100%;text-align: center;" *ngIf="!AllAdjoining.length">暂无数据,请前往平面图进行相关数据录入</p>
</div>
</mat-tab>
<div class="imgitem"*ngFor="let item of AllAdjoining">
<span class="position">{{item.direction}}</span>
<div class="houseimg">
<span class="img1" style="margin-right: 10px;">建筑物图片</span>
<img class="img2" [src]="item.imageUrls[0]" title="查看详情" (click)="imgdetails()">
</div>
<div class="housename">
<span style="margin-right: 10px;">建筑物名称:</span>
<span>{{item.name}}</span>
</div>
<mat-tab label="{{item.name}}" *ngFor="let item of AllBuilding">
<div class="allImgs">
<div class="imgBox" *ngFor="let items of item.allImgs">
<div class="fixedImg" *ngIf="items.imageUrls.length">
<img [src]="items.imageUrls[0]" onerror="javascript:this.src='../../../assets/images/upload.png'" (click)='imgdetails(items.imageUrls)'>
</div>
<div class="fixedImg" *ngIf="!items.imageUrls.length"><img src="../../../assets/images/upload.png" (click)='imgdetails(items.imageUrls)'></div>
<div style="margin-top: 10px;">
<label style="margin-left: 25px;">建筑物名称:</label>
<label style="margin-left: 25px;">{{items.name}}</label>
</div>
<div style="margin-top: 10px;">
<label style="margin-left: 25px;">建筑物方向:</label>
<label style="margin-left: 25px;">
<label *ngIf="items.direction==0"></label>
<label *ngIf="items.direction==1">西</label>
<label *ngIf="items.direction==2"></label>
<label *ngIf="items.direction==3"></label>
<label *ngIf="items.direction==4">东南</label>
<label *ngIf="items.direction==5">西南</label>
<label *ngIf="items.direction==6">东北</label>
<label *ngIf="items.direction==7">西北</label>
</label>
</div>
</div>
<h3 *ngIf="!AllAdjoining.length" style="width: 100px; height: 100%; margin: 100px auto;">暂无数据</h3>
</div>
<p style="width: 100%;text-align: center;" *ngIf="!item.allImgs.length">暂无数据,请前往平面图进行相关数据录入</p>
</div>
</mat-tab>
</mat-tab-group>
</div>

148
src/app/ui/allaround/allaround.component.scss

@ -1,107 +1,53 @@
.tabbar{
height: 60px;
// background: yellow;
line-height: 60px;
margin-bottom: 20px;
border-bottom: 1px solid black;;
.content {
width: 100%;
height: 100%;
padding: 10px;
}
.aroundimagebox{
height: 100%;
width: 100%;
.aroundimage{
width:97%;
height: 80%;
// background-color: skyblue;
overflow: auto;
margin: 0 30px;
border: 6px solid #cccccc;
.imgitem{
position: relative;
float: left;
margin: 60px 10px 70px 98px;
img{
width: 299px;
height: 169px;
border: 1px dashed grey;
}
.position{
position: absolute;
left: 16px;
top: 6px;
}
.houseimg{
margin-bottom: 20px;
position: relative;
width: 391px;
height: 200px;
.img1{
position: absolute;
left: 0;
top: 70px;
}
.img2{
position: absolute;
left:90px;
cursor: pointer;
}
}
}
}
}
//图片详情弹出框样式
.imgdialog{
//图片外部div
.allImgs {
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin: 25px;
.imgBox{
width: 300px;
height: 230px;
margin: 0 35px 35px 0;
display: inline-block;
position: relative;
.imagestitle{
width: 100%;
.fixedImg {
width: 100%;
height: 170px;
text-align: center;
margin-bottom: 3px;
img {
width: auto;
height: auto;
max-width: 100%;
height: 100%;
cursor:pointer;}
}
}
}
.imagesbox{
width: 1500px;
height: 700px;
text-align: center;
line-height: 700px;
img{
height: 100%;
// width: 1280px;
}
.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%;
}
}
.detailbtn{
height: 50px;
width: 100%;
text-align: center;
margin-top: 20px;;
button{
margin: 0 20px;
}
}
//预览图片
.previewImgBox {
width: 1500px;
height: 700px;
text-align: center;
img{
width: auto;
height: auto;
max-width: 100%;
height: 100%;}
}
.previewImgBottom {
text-align: center;
height: 30px;
margin: 20px auto;
}
//预览图片旋转角度
.rotateA {transform: rotate(90deg) scale(0.75);}
.rotateB {transform: rotate(180deg)}
.rotateC {transform: rotate(270deg) scale(0.75);}

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

@ -1,12 +1,8 @@
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';
import format from 'date-fns/format';
import { ImgDetails } from './imgdetails.component'
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
@ -17,44 +13,59 @@ import { ImgDetails } from './imgdetails.component'
})
export class AllaroundComponent implements OnInit {
constructor(private http: HttpClient,public dialog: MatDialog) { }
AllAdjoining:any = []; //所有单位毗邻 + 建筑毗邻
constructor(private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.getAllCompany()
// this.getAllArchitecture()
this.getAllBuilding()
}
//获取所有单位毗邻
AllAdjoining:any = []; //所有单位毗邻
AllBuilding:any = []; //所有建筑 + 建筑毗邻图片
//获取所有单位毗邻图片
getAllCompany () {
this.http.get('/api/CompanyAccount/CompanyAdjoins').subscribe(data=>{
console.log(data)
this.AllAdjoining = data
})
}
//获取所有建筑毗邻
getAllArchitecture () {
let id = {buildingId:''}
this.http.get('/api/CompanyAccount/BuildingAdjoins').subscribe(data=>{
console.log(data)
//获取所有建筑
getAllBuilding () {
this.http.get('/api/CompanyAccount/Buildings').subscribe((data:any)=>{
if (data.length) {
this.AllBuilding = data
this.AllBuilding.forEach(element => {
element.allImgs = []
});
this.getAllArchitecture()}
})
}
//预览图片
imgdetails(){
const dialogRef = this.dialog.open(ImgDetails, {//调用open方法打开对话框并且携带参数过去
width: '1600px',
height:'900px',
data: {}
//获取所有建筑毗邻图片
getAllArchitecture () {
this.AllBuilding.forEach(element => {
let id = {buildingId:element.id}
this.http.get('/api/CompanyAccount/BuildingAdjoins',{params:id}).subscribe(data=>{
element.allImgs = data
})
});
dialogRef.afterClosed().subscribe(
data=>{
}
);
}
//预览图片
imgdetails(e){
if (e.length && e!=null) {
let data = e
const dialogRef = this.dialog.open(ImgDetails, {//调用open方法打开对话框并且携带参数过去
width: '1600px',
height:'900px',data});
dialogRef.afterClosed().subscribe();
} else{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据','确定',config);
}
}

34
src/app/ui/allaround/imgdetails.component.html

@ -1,24 +1,16 @@
<div class="imgdialog">
<div mat-dialog-title class="imagestitle ">图片详情</div>
<!-- <div class="swiper-container swiper-no-swiping"> -->
<div class="swiper-container swiper-no-swiping">
<div class="swiper-wrapper ">
<div class="swiper-slide imagesbox"><img class="imgitemdefault" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1583660754310&di=782b4fc4e7186c8db2fa6dfe5e0760f4&imgtype=0&src=http%3A%2F%2Ffile06.16sucai.com%2F2016%2F0704%2F04e855314b2e0b342a949fd9f8698e97.jpg" alt=""></div>
<div class="swiper-slide imagesbox"><img class="imgitemdefault" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" src="https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1804916093,12959926&fm=26&gp=0.jpg" alt=""></div>
<div class="swiper-slide imagesbox"><img class="imgitemdefault" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2496032502,3509277120&fm=26&gp=0.jpg" alt=""></div>
<div class="swiper-slide imagesbox"><img class="imgitemdefault" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" src="../../../assets/images/xxx.jpg" alt=""></div>
<div class="swiper-slide imagesbox"><img class="imgitemdefault" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" src="../../../assets/images/fengjing.jpg" alt=""></div>
<div mat-dialog-title>图片详情</div>
<div class="swiper-container">
<div class="swiper-wrapper">
<div *ngFor="let item of allImages" class="swiper-slide previewImgBox">
<img [ngClass]="{'rotateA':rotationAngle==90,'rotateB':rotationAngle==180,'rotateC':rotationAngle==270}" [src]="item">
</div>
<!-- 如果需要导航按钮 -->
<div class="swiper-button-prev" (click)="defaultrotateA($event)"></div>
<div class="swiper-button-next" (click)="defaultrotateA($event)"></div>
</div>
<div class="detailbtn">
<button type="button" mat-icon-button (click)="rotate()"><mat-icon>refresh</mat-icon></button>
<button type="button" mat-icon-button><mat-icon>vertical_align_bottom</mat-icon></button>
</div>
<!-- 如果需要导航按钮 -->
<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>

116
src/app/ui/allaround/imgdetails.component.ts

@ -1,99 +1,49 @@
import { Component, OnInit, Inject, ɵConsole } 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';
import Swiper from 'swiper';
@Component({
selector: 'imgdetails',
templateUrl: './imgdetails.component.html',
styleUrls: ['./allaround.component.scss']
})
export class ImgDetails {
myControl = new FormControl();
//注入MatDialogRef,可以用来关闭对话框
//要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌
constructor(private http: HttpClient,public dialogRef: MatDialogRef<ImgDetails>,@Inject(MAT_DIALOG_DATA) public data) {}
allunittype:any
onNoClick(): void {
this.dialogRef.close();
}
defaultavtimgindex:any
avtimgindex:any//当前轮播图显示的下标
isheng:any
ngOnInit(): void {
var mySwiper:any = new Swiper ('.swiper-container', {
initialSlide :2,
// 如果需要前进后退按钮
navigation: {
constructor(private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef<ImgDetails>,
@Inject(MAT_DIALOG_DATA) public data) { }
testSwiper: Swiper;
ngOnInit(): void {
this.allImages = this.data
}
ngAfterViewInit() {
this.testSwiper = new Swiper('.swiper-container', {
direction: 'horizontal',
loop: false,
// 如果需要前进后退按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
}
})
mySwiper.on('slideChangeTransitionEnd', ()=>{
this.avtimgindex = mySwiper.activeIndex
});
this.defaultavtimgindex =mySwiper.activeIndex
}
ngAfterViewInit(): void{
}
//点击旋转按钮时
rotateA = 0
rotateB = 0
rotate(){
if(this.avtimgindex){//如果已经点击过切换图片按钮时
var w= document.getElementsByClassName("imgitemdefault")[this.avtimgindex]['naturalWidth'];
var h = document.getElementsByClassName("imgitemdefault")[this.avtimgindex]['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
}
}
}else{//如果想要直接旋转打开图片时
var w= document.getElementsByClassName("imgitemdefault")[this.defaultavtimgindex]['naturalWidth'];
var h = document.getElementsByClassName("imgitemdefault")[this.defaultavtimgindex]['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
}
}
}
}
defaultrotateA(e){
}
onSubmit(value){
}
});
}
allImages:any; //展示所有的图片
rotationAngle:number=0; //旋转角度
//旋转图片
rotate () {
this.rotationAngle = this.rotationAngle+90
if (this.rotationAngle === 360) {this.rotationAngle = 0}
}
}

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

@ -1,8 +1,8 @@
<div class="topbox">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<div class="mainbox">
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container" >
<div class="mainbox" >
<div class="mainleft">
<div class="inputbox">
<div class="inputbox" >
<span>统一社会信用代码:</span>
<mat-form-field>
<input matInput id="creditcode" name="creditcode" type='text'
@ -104,10 +104,6 @@
</div>
<div class="bottombox">
<!-- <div class="bottomtitle">
<button mat-button *ngFor="let item of houses">{{item}}</button>
</div> -->
<div class="houseinfobox">
<button type="button" mat-icon-button (click)="addhouseinfo()" class="addhouseinfo"><mat-icon style="font-size: 38px;">add_circle_outline</mat-icon></button>
@ -128,12 +124,12 @@
<span>建筑类型:</span>
<mat-form-field>
<mat-select name="unittype" [(ngModel)]="item.buildtype">
<mat-option [value]="item.name" *ngFor="let item of allunittype" (click)="templatebuildtype(item)">{{item.name}}</mat-option>
<mat-option [value]="n.name" *ngFor="let n of allunittype" (click)="templatebuildtype(n,item)">{{n.name}}</mat-option>
</mat-select>
</mat-form-field>
<span style="color: red;">*</span>
</div>
<h1 style="font-size: 26px;">{{item.buildingBasicGroups[0].name}}</h1>
<h1 style="font-size: 22px;">{{item.buildingBasicGroups[0].name}}</h1>
<div class="houseinfoinput" *ngFor="let i of item.buildingBasicGroups[0].propertyInfos;let key = index">
<span>{{i.propertyName}}:</span>
<mat-form-field>
@ -147,7 +143,7 @@
<!-- 石油化工 -->
<div class="highinfo" *ngIf="item.isshiyou;let bigkey = index">
<h1 style="font-size: 26px;">{{item.buildingBasicGroups[0].name}}</h1>
<div class="basicinfobox">
<div class="houseinfoinput">
<span>建筑名称:</span>
@ -162,12 +158,12 @@
<span>建筑类型:</span>
<mat-form-field>
<mat-select required name="unittype" [(ngModel)]="item.buildtype">
<mat-option [value]="item.name" *ngFor="let item of allunittype">{{item.name}}</mat-option>
<mat-option [value]="n.name" *ngFor="let n of allunittype" (click)="templatebuildtype(n,item)">{{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">
<span>{{i.propertyName}}:</span>
<mat-form-field>
@ -179,37 +175,38 @@
</div>
</div>
<h1 style="font-size: 26px;">{{item.buildingBasicGroups[1].name}}</h1>
<h1 style="font-size: 22px;">{{item.buildingBasicGroups[1].name}}</h1>
<div class="deviceinfo">
<table mat-table [dataSource]="devicedataSourcebox[item.buildingId]" class="mat-elevation-z8">
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef>
<button type="button" mat-icon-button class="adddeviceinfo" (click)="adddeviceinfo(item)"><mat-icon>add_circle_outline</mat-icon></button>
装置区名称</th>
<button type="button" mat-icon-button class="adddeviceinfo2" (click)="adddeviceinfo(item)"><mat-icon>add_circle_outline</mat-icon></button>
<button 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">
<mat-form-field>
<input matInput id="floorspace" name="{{key}}1" type='text'
minlength="1"
required
[(ngModel)]="element.name">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="flow">
<th mat-header-cell *matHeaderCellDef>工艺流程</th>
<th mat-header-cell *matHeaderCellDef>工艺流程<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{key}}2" type='text'
minlength="1"
required
[(ngModel)]="element.flow">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="danger">
<th mat-header-cell *matHeaderCellDef>火灾危险性</th>
<th mat-header-cell *matHeaderCellDef>火灾危险性<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{key}}3" type='text'
minlength="1"
required
[(ngModel)]="element.danger">
</mat-form-field>
</td>
@ -219,7 +216,7 @@
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{key}}4" type='text'
minlength="1"
[(ngModel)]="element.payattentionto">
</mat-form-field>
</td>
@ -230,11 +227,10 @@
</div>
<button type="button" mat-raised-button (click)="addtankbox(item,bigkey)" style="margin-top: 30px;">添加储罐</button>
<div class="tankinfo" *ngFor="let x of bigfor;let www = index">
<button type="button" mat-raised-button color="primary" (click)="addtankbox(item,bigkey)" style="margin-top: 30px;margin-right: 5px;">添加储罐</button>
<button type="button" mat-raised-button color="warn" (click)="removetankbox(item,bigkey)" style="margin-top: 30px;" matTooltip="会将此建筑处于末尾的储罐移除">移除末尾储罐</button>
<div class="tankinfo" *ngFor="let x of item.bigfor;let www = index">
<p>{{x[0].name}}</p>
<!-- <p>储罐信息</p> -->
<div class="basicinfobox">
<div class="houseinfoinput" *ngFor="let i of x[0].propertyInfos;let key = index">
<span>{{i.propertyName}}:</span>
@ -249,36 +245,36 @@
</div>
<p>{{x[1].name}}</p>
<!-- <p>储罐信息/罐区情况</p> -->
<!-- <div class="tankdetailinfo">
<table mat-table [dataSource]="dataSourceArr[www]" class="mat-elevation-z8" >
<ng-container matColumnDef="tank" >
<div class="tankdetailinfo">
<table #table mat-table [dataSource]="x[1].propertyInfos" class="mat-elevation-z8" >
<ng-container matColumnDef="tank">
<th mat-header-cell *matHeaderCellDef>
<button type="button" mat-icon-button class="adddeviceinfo" (click)="adddeviceinfo2(www)"><mat-icon>add_circle_outline</mat-icon></button>
罐区</th>
<button type="button" mat-icon-button class="adddeviceinfo" (click)="adddeviceinfo2(www,item)"><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>
罐区 <span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tank}}tank{{key}}" type='text'
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
required
[(ngModel)]="element.tank">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="tankid">
<th mat-header-cell *matHeaderCellDef>罐区编号</th>
<th mat-header-cell *matHeaderCellDef>罐区编号<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tankid}}tank{{key}}" type='text'
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankid">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="tankmedium">
<th mat-header-cell *matHeaderCellDef>储存介质</th>
<th mat-header-cell *matHeaderCellDef>储存介质<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tankmedium}}tank{{key}}" type='text'
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankmedium">
</mat-form-field>
@ -286,40 +282,40 @@
</ng-container>
<ng-container matColumnDef="tanktype">
<th mat-header-cell *matHeaderCellDef>储罐类型</th>
<th mat-header-cell *matHeaderCellDef>储罐类型<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tanktype}}tank{{key}}" type='text'
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
required
[(ngModel)]="element.tanktype">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="tankcapacity">
<th mat-header-cell *matHeaderCellDef>容量</th>
<th mat-header-cell *matHeaderCellDef>容量<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tankcapacity}}tank{{key}}" type='text'
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankcapacity">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="tankdiameter">
<th mat-header-cell *matHeaderCellDef>直径</th>
<th mat-header-cell *matHeaderCellDef>直径<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tankdiameter}}tank{{key}}" type='text'
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankdiameter">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="tankheight">
<th mat-header-cell *matHeaderCellDef>高度</th>
<th mat-header-cell *matHeaderCellDef>高度<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tankheight}}tank{{key}}" type='text'
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
required
[(ngModel)]="element.tankheight">
</mat-form-field>
@ -328,8 +324,8 @@
<ng-container matColumnDef="tanktectum">
<th mat-header-cell *matHeaderCellDef>顶盖形式</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tanktectum}}tank{{key}}" type='text'
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
[(ngModel)]="element.tanktectum">
</mat-form-field>
</td>
@ -337,8 +333,8 @@
<ng-container matColumnDef="tanktexture">
<th mat-header-cell *matHeaderCellDef>浮盘材质</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.tanktexture}}tank{{key}}" type='text'
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
[(ngModel)]="element.tanktexture">
</mat-form-field>
@ -347,8 +343,8 @@
<ng-container matColumnDef="platetype">
<th mat-header-cell *matHeaderCellDef>浮盘类型</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.platetype}}tank{{key}}" type='text'
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
[(ngModel)]="element.platetype">
</mat-form-field>
@ -357,8 +353,8 @@
<ng-container matColumnDef="foamgeneratorid">
<th mat-header-cell *matHeaderCellDef>泡沫产生器型号</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.foamgeneratorid}}tank{{key}}" type='text'
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
[(ngModel)]="element.foamgeneratorid">
</mat-form-field>
@ -367,8 +363,8 @@
<ng-container matColumnDef="foamgeneratortype">
<th mat-header-cell *matHeaderCellDef>泡沫产生器形式</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.foamgeneratortype}}tank{{key}}" type='text'
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
[(ngModel)]="element.foamgeneratortype">
</mat-form-field>
@ -377,40 +373,40 @@
<ng-container matColumnDef="isprotect">
<th mat-header-cell *matHeaderCellDef>是否设置氮封惰化保护装置</th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.isprotect}}tank{{key}}" type='text'
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
[(ngModel)]="element.isprotect">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="fendinggroyneheight">
<th mat-header-cell *matHeaderCellDef>防护堤高度</th>
<th mat-header-cell *matHeaderCellDef>防护堤高度<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.fendinggroyneheight}}tank{{key}}" type='text'
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
required
[(ngModel)]="element.fendinggroyneheight">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="portnum">
<th mat-header-cell *matHeaderCellDef>半固定泡沫灭火接口数量</th>
<th mat-header-cell *matHeaderCellDef>半固定泡沫灭火接口数量<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.portnum}}tank{{key}}" type='text'
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
required
[(ngModel)]="element.portnum">
</mat-form-field>
</td>
</ng-container>
<ng-container matColumnDef="else">
<th mat-header-cell *matHeaderCellDef>其他设施</th>
<th mat-header-cell *matHeaderCellDef>其他设施<span style="color: red;">*</span></th>
<td mat-cell *matCellDef="let element;let key = index">
<mat-form-field>
<input matInput id="floorspace" name="{{element.else}}tank{{key}}" type='text'
<mat-form-field class="tankinfo">
<input matInput id="floorspace" name="{{www}}tank{{key}}" type='text'
required
[(ngModel)]="element.else">
[(ngModel)]="element.else">
</mat-form-field>
</td>
</ng-container>
@ -419,19 +415,14 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns2"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns2;"></tr>
</table>
</div> -->
</div>
</div>
</div>
<!-- 地铁类 -->
<div class="highinfo" *ngIf="item.ditie">
<h1 class="infotitle">地铁信息</h1>
<p>基本信息</p>
<div class="subwayinfo">
<div class="houseinfoinput">
<span>建筑名称:</span>
@ -446,28 +437,29 @@
<span>建筑类型:</span>
<mat-form-field>
<mat-select required name="unittype" [(ngModel)]="item.buildtype">
<mat-option [value]="item.name" *ngFor="let item of allunittype">{{item.name}}</mat-option>
<mat-option [value]="n.name" *ngFor="let n of allunittype" (click)="templatebuildtype(n,item)">{{n.name}}</mat-option>
</mat-select>
</mat-form-field>
<span style="color: red;">*</span>
</div>
<p style="font-size: 22px;">{{item.buildingBasicGroups[0].name}}</p>
<div class="houseinfoinput" *ngFor="let i of item.buildingBasicGroups[0].propertyInfos;let key = index">
<span>{{i.propertyName}}:</span>
<mat-form-field>
<input matInput id="tunneltype" name="{{key}}" type='text'
<input matInput id="tunneltype" name="{{i.propertyName}}" type='text'
required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue">
</mat-form-field>
<span style="color: red;" *ngIf="i.required">*</span>
</div>
</div>
<p>基本信息/路线信息</p>
<p style="font-size: 22px;">{{item.buildingBasicGroups[1].name}}</p>
<!-- <button type="button" mat-raised-button (click)="addloadgroup()">增加线路分组</button> -->
<div class="roadinfo" *ngFor="let g of ggg">
<div class="houseinfoinput" *ngFor="let i of item.buildingBasicGroups[1].propertyInfos;let key = index">
<span>{{i.propertyName}}:</span>
<mat-form-field>
<input matInput id="tunneltype" name="{{key}}" type='text'
<input matInput id="tunneltype" name="{{i.propertyName}}" type='text'
required="{{ i.required==true ? 'true' : 'false' }}"
[(ngModel)]="i.propertyValue">
</mat-form-field>

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

@ -178,13 +178,20 @@
}
.roadinfo{
border-bottom: 1px solid black;;
// border-bottom: 1px solid black;
}
.deviceinfo{
border-bottom: 1px solid black;;
padding-bottom: 70px;
}
.tankdetailinfo{
border-bottom: 1px solid black;;
// border-bottom: 1px solid black;;
padding-bottom: 35px;
}
.tankinfo{
width: 98px;
}
.adddeviceinfo{
position: absolute;
left: 0px;
}

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

File diff suppressed because it is too large Load Diff

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

@ -1,207 +1,34 @@
<div class="tabbar">
<span style="margin:0 20px;">单位消防设施</span>
<button mat-raised-button color="primary">建筑一</button>
</div>
<div class="devicebox">
<div class="device">
<div class="content">
<mat-tab-group>
<mat-tab label="单位消防设施">
<div class="contentBox">
<div class="tablebox">
<div class="imagestitle">消防水源</div>
<div style="width: 80%;">
<mat-icon title="创建">add_circle_outline</mat-icon>
<mat-icon title="保存" style="margin-left: 25px;">description</mat-icon>
<mat-icon title="删除" style="margin-left: 25px;">delete</mat-icon>
</div>
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
<ng-container matColumnDef="checked">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<mat-checkbox></mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="project">
<th mat-header-cell *matHeaderCellDef>项目</th>
<td mat-cell *matCellDef="let element">{{element.name}}</td>
</ng-container>
<ng-container matColumnDef="phone">
<th mat-header-cell *matHeaderCellDef>照片</th>
<td mat-cell *matCellDef="let element" class="lookphone" (click)="lookphone()">查看照片</td>
</ng-container>
<ng-container matColumnDef="mainmsg">
<th mat-header-cell *matHeaderCellDef>主要情况</th>
<td mat-cell *matCellDef="let element">{{element.main}}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<h3 style="text-align: center;font-weight: 550;">消防水源</h3>
<div>
<mat-icon title="创建">add_circle_outline</mat-icon>
<mat-icon title="保存" style="margin-left: 25px;">description</mat-icon>
<mat-icon title="删除" style="margin-left: 25px;">delete</mat-icon>
</div>
<div class="tablebox">
<div class="imagestitle">安全疏散设施</div>
<div style="width: 80%;">
<mat-icon title="创建">add_circle_outline</mat-icon>
<mat-icon title="保存" style="margin-left: 25px;">description</mat-icon>
<mat-icon title="删除" style="margin-left: 25px;">delete</mat-icon>
</div>
<table mat-table [dataSource]="dataSource2" class="mat-elevation-z8">
<ng-container matColumnDef="checked">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<mat-checkbox></mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="project">
<th mat-header-cell *matHeaderCellDef>项目</th>
<td mat-cell *matCellDef="let element">{{element.name}}</td>
</ng-container>
<ng-container matColumnDef="phone">
<th mat-header-cell *matHeaderCellDef>照片</th>
<td mat-cell *matCellDef="let element" class="lookphone" (click)="lookphone()">查看照片</td>
</ng-container>
<ng-container matColumnDef="mainmsg">
<th mat-header-cell *matHeaderCellDef>主要情况</th>
<td mat-cell *matCellDef="let element">{{element.main}}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<div>
<div class="flexBox">
<p></p>
<p>项目</p>
<p>照片</p>
<p>主要情况</p>
</div>
<div class="flexBox">
<p></p>
<p></p>
<p></p>
<p></p>
</div>
</div>
<div class="tablebox">
<div class="imagestitle">消防水系统</div>
<div style="width: 80%;">
<mat-icon title="创建">add_circle_outline</mat-icon>
<mat-icon title="保存" style="margin-left: 25px;">description</mat-icon>
<mat-icon title="删除" style="margin-left: 25px;">delete</mat-icon>
</div>
<table mat-table [dataSource]="dataSource3" class="mat-elevation-z8">
<ng-container matColumnDef="checked">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let element">
<mat-checkbox></mat-checkbox>
</td>
</ng-container>
<ng-container matColumnDef="project" >
<th mat-header-cell *matHeaderCellDef>项目</th>
<td mat-cell *matCellDef="let element">{{element.name}}</td>
</ng-container>
<ng-container matColumnDef="phone">
<th mat-header-cell *matHeaderCellDef>照片</th>
<td mat-cell *matCellDef="let element" class="lookphone" (click)="lookphone()">查看照片</td>
</ng-container>
<ng-container matColumnDef="mainmsg">
<th mat-header-cell *matHeaderCellDef>主要情况</th>
<td mat-cell *matCellDef="let element">{{element.main}}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</div>
</div>
</mat-tab>
<div class="insidebox">
<div class="inside">
<div class="insidetitle">内部力量</div>
<div class="insidemsg">
<div class="insidemsgitem">
<span>消防队地址:</span>
<span class="insidemsgitemdata"></span>
</div>
<div class="insidemsgitem">
<span>负责人:</span>
<span class="insidemsgitemdata"></span>
</div>
<div class="insidemsgitem">
<span>联系电话:</span>
<span class="insidemsgitemdata"></span>
</div>
<div class="insidemsgitem">
<span>消防员数量:</span>
<span class="insidemsgitemdata"></span>
</div>
<div class="insidemsgitem">
<span>消防车数量:</span>
<span class="insidemsgitemdata"></span>
</div>
<div class="insidemsgitem">
<span>其他装备:</span>
<span class="insidemsgitemdata"></span>
</div>
<div class="insidemsgitem">
<span>灭火剂储存量:</span>
<span class="insidemsgitemdata"></span>
</div>
<div class="insidemsgitem">
<span>消防性质:</span>
<mat-radio-group required name="nature" ngModel #nature="ngModel" style="margin-left: 95px;">
<mat-radio-button value="1" style="margin-left: 10px;">专职队</mat-radio-button>
<mat-radio-button value="0" style="margin-left: 40px;">微型站</mat-radio-button>
</mat-radio-group>
</div>
</div>
</div>
</div>
<mat-tab label="建筑消防设施">
</mat-tab>
<div class="insidebox">
<div class="inside">
<div class="insidetitle">其他</div>
<div class="insidemsg">
<div class="otheritem">
<span class="otheritemdataname">消防控制室:</span>
<span class="otheritemdata" style="margin-left: 20px;"></span>
</div>
<div class="otheritem">
<span class="otheritemdataname">防火卷帘分割:</span>
<span class="otheritemdata" style="margin-left: 4px;"></span>
</div>
<div class="radiobox">
<div class="radioitem">
<span>自动报警系统:</span>
<mat-radio-group required name="callpolice " ngModel #callpolice="ngModel">
<mat-radio-button value="1"></mat-radio-button>
<mat-radio-button value="0"></mat-radio-button>
</mat-radio-group>
</div>
<div class="radioitem">
<span>自动喷水系统:</span>
<mat-radio-group required name="water " ngModel #water="ngModel">
<mat-radio-button value="1"></mat-radio-button>
<mat-radio-button value="0"></mat-radio-button>
</mat-radio-group>
</div>
<div class="radioitem">
<span>应急广播系统:</span>
<mat-radio-group required name="broadcast " ngModel #broadcast="ngModel">
<mat-radio-button value="1"></mat-radio-button>
<mat-radio-button value="0"></mat-radio-button>
</mat-radio-group>
</div>
<div class="radioitem">
<span>防排烟系统:</span>
<mat-radio-group required name="smog " ngModel #smog="ngModel">
<mat-radio-button value="1"></mat-radio-button>
<mat-radio-button value="0"></mat-radio-button>
</mat-radio-group>
</div>
</div>
</div>
</div>
</div>
</div>
</mat-tab-group>
</div>

224
src/app/ui/fire-fighting-device/fire-fighting-device.component.scss

@ -1,211 +1,21 @@
.tabbar{
height: 60px;
line-height: 60px;
margin-bottom: 20px;
border-bottom: 1px solid black;;
}
.devicebox{
height: 100%;
width: 100%;
.device{
width:96%;
height: 80%;
// background-color: skyblue;
overflow: auto;
margin: 0 30px;
border: 6px solid #cccccc;
.tablebox{
display: flex;
flex-direction:column ;
align-items:center;
.imagestitle{
text-align: center;
height: 80px;
line-height: 80px;
font-size: 26px;
}
.mat-elevation-z8{
width: 80%;
margin: 10px 0;
}
.mat-column-project{
width: 15%;
text-align: center;
}
.mat-column-phone{
width: 15%;
text-align: center;
}
.mat-column-mainmsg{
width: 70%;
text-align: center;
}
.lookphone{
cursor: pointer;
color: blue;;
}
}
.insidebox{
width:100%;
height: 300px;
display: flex;
justify-content: center;
margin-top: 40px;
.insidetitle{
text-align: center;
height: 80px;
line-height: 80px;
font-size: 26px;
}
.inside{
width: 80%;
border: 1px solid black;
.insidemsg{
.insidemsgitem{
width: 50%;
height: 43px;
line-height:43px;
float: left;
span{
display: block;
float: left;
margin-left: 60px;
}
.insidemsgitemdata{
float: right;
width: 330px;
height: 30px;
line-height: 30px;
border: 1px solid black;
margin-right: 70px;
}
}
.otheritem{
height: 50px;
line-height: 50px;
width: 100%;
span{
display: block;
float: left;
}
.otheritemdataname{
margin-left: 210px;
}
.otheritemdata{
border: 1px solid black;
height:40px;
width:715px ;
}
}
.radiobox{
display: flex;
justify-content: space-around;
margin-top: 38px;
}
}
}
}
}
}
.imagesdialog{
text-align: center;
.imagesbox{
width:99%;
height: 755px;
border: 6px solid #cccccc;
display: flex;
justify-content: space-around;
flex-flow:wrap;
overflow: auto;
.imgitem{
width: 300px;
height: 200px;
float: left;
margin-top:70px;
.img{
width: 300px;
height: 180px;
img{
width: 300px;
height: 160px;
cursor: pointer;
}
p{
width: 300px;
height: 20px;
margin-top: 20px;
}
}
}
}
}
//icon统一样式
.mat-icon {
cursor:pointer;
}
table {
.content {
width: 100%;
text-align: center;
.cdk-header-cell {
text-align: center;
height: 100%;
padding: 10px;
.contentBox {
width: 75%;
height: 100%;
margin: 0 auto;
}
}
//图片详情弹出框样式
.imgdialog{
position: relative;
.imagestitle{
width: 100%;
}
.imagesbox{
width: 1500px;
height: 700px;
text-align: center;
line-height: 700px;
img{
height: 100%;
// width: 1280px;
}
.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%;
}
}
.detailbtn{
height: 50px;
width: 100%;
text-align: center;
margin-top: 20px;;
button{
margin: 0 20px;
}
}
}
//每一行 flex布局
.flexBox {
display: flex;
text-align: center;
border: 1px solid black;
:first-child{flex: 5%}
:nth-child(2) {flex: 15%}
:nth-child(3) {flex: 15%}
:last-child {flex: 65%}
}

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

@ -1,11 +1,7 @@
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import {HttpClient} from '@angular/common/http'
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatPaginator } from '@angular/material/paginator';
import { MatTableDataSource } from '@angular/material/table';
import { FlatTreeControl } from '@angular/cdk/tree';
import { MatTreeFlattener, MatTreeFlatDataSource } from '@angular/material/tree';
import { PageEvent } from '@angular/material/paginator';
import { ImagesData } from './imagesdata.component'
@ -21,46 +17,10 @@ export class FireFightingDeviceComponent implements OnInit {
displayedColumns: string[] = ['checked','project', 'phone', 'mainmsg'];
dataSource:any=[{name:"消防水池",main:""}]; //消防水源table
dataSource2:any=[ //安全疏散设施table
{name:"疏散楼梯",main:""},
{name:"消防电梯",main:""},
{name:"避难设施",main:""},
{name:"安全出口",main:""}];
dataSource3:any=[ //消防水系统tbale
{name:"室外消火栓",main:""},
{name:"室内消火栓",main:""},
{name:"供水管网",main:""},
{name:"湿式自动喷淋系统",main:""},
{name:"水幕系统",main:""},
{name:"消防泵房",main:""},
{name:"水泵接合器",main:""}
];
selectWater:any=[]; //选中的消防水源
selectFacilities:any=[]; //选中的安全疏散设施
selectWaterSystem:any=[]; //选中的消防水系统
ngOnInit(): void {
}
//预览照片
lookphone(){
const dialogRef = this.dialog.open(ImagesData, {//调用open方法打开对话框并且携带参数过去
width: '1600px',
height:'900px',
data: {}
});
dialogRef.afterClosed().subscribe(
data=>{
}
);
}
}

13
src/app/ui/fire-fighting-device/imagesdata.component.html

@ -1,13 +0,0 @@
<div class="imagesdialog">
<div mat-dialog-title class="imagestitle">消防水源</div>
<div class="imagesbox">
<div class="imgitem" *ngFor="let item of xxx">
<div class="img">
<img [src]="defaultimg" alt="" title="查看大图" (click)="imgdetails()">
<p>建筑物图片</p>
</div>
</div>
</div>
</div>

46
src/app/ui/fire-fighting-device/imagesdata.component.ts

@ -1,44 +1,24 @@
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';
import { ImgsDataDetail } from './imgsdatadetail.component'
@Component({
selector: 'imagesdata',
templateUrl: './imagesdata.component.html',
styleUrls: ['./fire-fighting-device.component.scss']
})
export class ImagesData {
myControl = new FormControl();
//注入MatDialogRef,可以用来关闭对话框
//要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌
constructor(private http: HttpClient,public dialogRef: MatDialogRef<ImagesData>,@Inject(MAT_DIALOG_DATA) public data,public dialog: MatDialog) {}
xxx = [1,2,3,4,5,6,7,8,9,10,11]
defaultimg = "../../../assets/images/upload.jpg"
onNoClick(): void {
this.dialogRef.close();
}
ngOnInit(): void {
}
//图片查看大图
imgdetails(){
const dialogRef = this.dialog.open(ImgsDataDetail, {//调用open方法打开对话框并且携带参数过去
width: '1600px',
height:'900px',
data: {}
});
dialogRef.afterClosed().subscribe(
data=>{
}
);
}
onSubmit(value){
}
export class ImagesData {
constructor(private http: HttpClient,public dialogRef: MatDialogRef<ImagesData>,@Inject(MAT_DIALOG_DATA) public data,public dialog: MatDialog) {}
ngOnInit(): void {
}
}

24
src/app/ui/fire-fighting-device/imgsdatadetail.component.html

@ -1,24 +0,0 @@
<div class="imgdialog">
<div mat-dialog-title class="imagestitle ">图片详情</div>
<!-- <div class="swiper-container swiper-no-swiping"> -->
<div class="swiper-container swiper-no-swiping">
<div class="swiper-wrapper ">
<div class="swiper-slide imagesbox"><img class="imgitemdefault" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1583660754310&di=782b4fc4e7186c8db2fa6dfe5e0760f4&imgtype=0&src=http%3A%2F%2Ffile06.16sucai.com%2F2016%2F0704%2F04e855314b2e0b342a949fd9f8698e97.jpg" alt=""></div>
<div class="swiper-slide imagesbox"><img class="imgitemdefault" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" src="https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1804916093,12959926&fm=26&gp=0.jpg" alt=""></div>
<div class="swiper-slide imagesbox"><img class="imgitemdefault" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2496032502,3509277120&fm=26&gp=0.jpg" alt=""></div>
<div class="swiper-slide imagesbox"><img class="imgitemdefault" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" src="../../../assets/images/xxx.jpg" alt=""></div>
<div class="swiper-slide imagesbox"><img class="imgitemdefault" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" src="../../../assets/images/fengjing.jpg" alt=""></div>
</div>
<!-- 如果需要导航按钮 -->
<div class="swiper-button-prev" (click)="defaultrotateA()"></div>
<div class="swiper-button-next" (click)="defaultrotateA()"></div>
</div>
<div class="detailbtn">
<button type="button" mat-icon-button (click)="rotate()"><mat-icon>refresh</mat-icon></button>
<button type="button" mat-icon-button><mat-icon>vertical_align_bottom</mat-icon></button>
</div>
</div>

102
src/app/ui/fire-fighting-device/imgsdatadetail.component.ts

@ -1,99 +1,29 @@
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';
import Swiper from 'swiper';
@Component({
selector: 'imgsdatadetail',
templateUrl: './imgsdatadetail.component.html',
styleUrls: ['./fire-fighting-device.component.scss']
})
export class ImgsDataDetail {
myControl = new FormControl();
//注入MatDialogRef,可以用来关闭对话框
//要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌
constructor(private http: HttpClient,public dialogRef: MatDialogRef<ImgsDataDetail>,@Inject(MAT_DIALOG_DATA) public data) {}
allunittype:any
onNoClick(): void {
this.dialogRef.close();
}
defaultavtimgindex:any
avtimgindex:any//当前轮播图显示的下标
isheng:any
ngOnInit(): void {
setTimeout(() => {
var mySwiper:any = new Swiper ('.swiper-container', {
// 如果需要前进后退按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
}
})
mySwiper.on('slideChangeTransitionEnd', ()=>{
this.avtimgindex = mySwiper.activeIndex
});
this.defaultavtimgindex =mySwiper.activeIndex
export class ImgsDataDetail {
constructor(private http: HttpClient,public dialogRef: MatDialogRef<ImgsDataDetail>,@Inject(MAT_DIALOG_DATA) public data) {}
ngOnInit(): void {
},1);
}
ngAfterViewInit(): void{
}
//点击旋转按钮时
rotateA = 0
rotateB = 0
rotate(){
if(this.avtimgindex){//如果已经点击过切换图片按钮时
var w= document.getElementsByClassName("imgitemdefault")[this.avtimgindex]['naturalWidth'];
var h = document.getElementsByClassName("imgitemdefault")[this.avtimgindex]['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
}
}
}else{//如果想要直接旋转打开图片时
var w= document.getElementsByClassName("imgitemdefault")[this.defaultavtimgindex]['naturalWidth'];
var h = document.getElementsByClassName("imgitemdefault")[this.defaultavtimgindex]['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
}
}
}
}
defaultrotateA(){
this.rotateA = 0
}
onSubmit(value){
}
}
ngAfterViewInit(): void{
}
}

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

@ -6,12 +6,12 @@
<mat-tab-group class="tableContent">
<mat-tab label="单位功能分区">
<div style="margin: 30px 0 25px 50px;">
<div style="margin: 30px 0 25px 5%;">
<mat-icon title="创建" (click)='addCompany()'>add_circle_outline</mat-icon>
<mat-icon title="保存" style="margin-left: 25px;" (click)='preservation()'>description</mat-icon>
<mat-icon title="删除" style="margin-left: 25px;" (click)='delete()'>delete</mat-icon>
</div>
<table mat-table [dataSource]="companyFunctionalZoning" style="margin-left: 50px;">
<table mat-table [dataSource]="companyFunctionalZoning">
<ng-container matColumnDef="checked">
<th mat-header-cell *matHeaderCellDef></th>
@ -24,7 +24,7 @@
<th mat-header-cell *matHeaderCellDef>区域</th>
<td mat-cell *matCellDef="let element">
<mat-form-field class="example-full-width">
<input matInput [(ngModel)]="element.region">
<input matInput [(ngModel)]="element.region" type="text" maxlength="20">
</mat-form-field>
</td>
</ng-container>
@ -41,25 +41,23 @@
<ng-container matColumnDef="situation">
<th mat-header-cell *matHeaderCellDef>基本情况</th>
<td mat-cell *matCellDef="let element">
<mat-form-field class="example-full-width">
<input matInput [(ngModel)]="element.details">
</mat-form-field>
<textarea [(ngModel)]="element.details"></textarea>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<h3 style="width: 80%; margin: 30px 0 0 50px; text-align: center;" *ngIf="!companyFunctionalZoning.length">暂无数据</h3>
<p style="width: 80%; margin-top: 30px; text-align: center;" *ngIf="!companyFunctionalZoning.length">暂无数据</p>
</mat-tab>
<mat-tab label="{{item.name}}" *ngFor="let item of allBuildingFunctionalZoning;let key = index">
<div style="margin: 30px 0 25px 50px;">
<div style="margin: 30px 0 25px 5%;">
<mat-icon title="创建" (click)='addBuilding(item,key)'>add_circle_outline</mat-icon>
<mat-icon title="保存" (click)='preservationBuilding(item,key)' style="margin-left: 25px;">description</mat-icon>
<mat-icon title="删除" (click)='deleteBuilding(item,key)' style="margin-left: 25px;">delete</mat-icon>
</div>
<table mat-table [dataSource]="item.functionalZoning" style="margin-left: 50px;">
<table mat-table [dataSource]="item.functionalZoning">
<ng-container matColumnDef="checked">
<th mat-header-cell *matHeaderCellDef></th>
@ -72,7 +70,7 @@
<th mat-header-cell *matHeaderCellDef>区域</th>
<td mat-cell *matCellDef="let element">
<mat-form-field class="example-full-width">
<input matInput [(ngModel)]="element.region">
<input matInput [(ngModel)]="element.region" type="text" maxlength="20">
</mat-form-field>
</td>
</ng-container>
@ -89,9 +87,7 @@
<ng-container matColumnDef="situation">
<th mat-header-cell *matHeaderCellDef>基本情况</th>
<td mat-cell *matCellDef="let element">
<mat-form-field class="example-full-width">
<input matInput [(ngModel)]="element.details">
</mat-form-field>
<textarea [(ngModel)]="element.details"></textarea>
</td>
</ng-container>

10
src/app/ui/function-division/function-division.component.scss

@ -9,11 +9,19 @@
width: 100%;
height: 100%;
table {
width: 80%;
width: 90%;
text-align: center;
margin: 0 auto;
.cdk-header-cell {
text-align: center;
}
textarea {
border-radius: 5px;
padding: 5px;
width: 80%;
height: 30px;
resize: none;
}
}
}

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

@ -42,9 +42,15 @@ export class FunctionDivisionComponent implements OnInit {
//保存单位功能分区属性
preservation () {
this.http.post('/api/CompanyAccount/CompanyFunctionalDivisions/Batch',this.companyFunctionalZoning).subscribe(data=>{
this.getAllCompany()
})
if (this.companyFunctionalZoning.length) {
this.http.post('/api/CompanyAccount/CompanyFunctionalDivisions/Batch',this.companyFunctionalZoning).subscribe(data=>{
this.getAllCompany()
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
})
}
}
//单位功能分区checked选择
@ -67,6 +73,10 @@ export class FunctionDivisionComponent implements OnInit {
body:this.selectFunctionalZoning}
this.http.delete(`/api/CompanyAccount/CompanyFunctionalDivisions/Batch`,options).subscribe(data=>{
this.getAllCompany()
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
})
})
}
@ -121,6 +131,10 @@ export class FunctionDivisionComponent implements OnInit {
this.http.get(`/api/CompanyAccount/BuildingFunctionalDivisions`,{params:data}).subscribe((data:any)=>{
this.selectBuildingFunctionalZoning[index] = []
this.allBuildingFunctionalZoning[index].functionalZoning = data
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
})
}
@ -156,7 +170,6 @@ export class FunctionDivisionComponent implements OnInit {
} else {
this.selectBuildingFunctionalZoning[index].splice(this.selectBuildingFunctionalZoning[index].findIndex(item => item === ele.id), 1)
}
console.log(this.selectBuildingFunctionalZoning)
}
//删除建筑功能分区

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

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

259
src/app/ui/key-site/key-site.component.scss

@ -1,230 +1,55 @@
.tabbar{
height: 60px;
// background: yellow;
line-height: 60px;
margin-bottom: 20px;
border-bottom: 1px solid black;;
}
.devicebox{
.content {
width: 100%;
height: 100%;
padding: 10px;
.contentBox{
width: 75%;
height: 100%;
width: 100%;
.device{
width:96%;
height: 80%;
// background-color: skyblue;
overflow: auto;
margin: 0 30px;
border: 6px solid #cccccc;
.tablebox{
display: flex;
flex-direction:column ;
align-items:center;
margin-bottom: 60px;
margin-top: 70px;
.imagestitle{
text-align: center;
height: 80px;
line-height: 80px;
font-size: 26px;
}
.mat-elevation-z8{
width: 80%;
margin: 10px 0;
}
.mat-column-project{
width: 15%;
text-align: center;
}
.mat-column-phone{
width: 15%;
text-align: center;
}
.mat-column-mainmsg{
width: 70%;
text-align: center;
}
.lookphone{
cursor: pointer;
color: blue;;
}
}
.insidebox{
width:100%;
height: 300px;
display: flex;
justify-content: center;
margin-top: 40px;
.insidetitle{
text-align: center;
height: 80px;
line-height: 80px;
font-size: 26px;
}
.inside{
width: 80%;
border: 1px solid black;
.insidemsg{
.insidemsgitem{
width: 50%;
height: 43px;
line-height:43px;
float: left;
span{
display: block;
float: left;
margin-left: 60px;
}
.insidemsgitemdata{
float: right;
width: 330px;
height: 30px;
line-height: 30px;
border: 1px solid black;
margin-right: 70px;
}
}
.otheritem{
height: 50px;
line-height: 50px;
width: 100%;
span{
display: block;
float: left;
}
.otheritemdataname{
margin-left: 210px;
}
.otheritemdata{
border: 1px solid black;
height:40px;
width:715px ;
}
}
.radiobox{
display: flex;
justify-content: space-around;
margin-top: 38px;
}
}
}
}
.bigbox{
// margin-top: 100px;
.bigboxtitle{
text-align: center;
height: 80px;
line-height: 80px;
font-size: 26px;
}
.hintbox{
width: 100%;
height: 300px;
display: flex;
justify-content: center;
.hint{
width: 60%;
height: 200px;
border: 1px solid black;
}
}
}
}
margin: 0 auto;
}
}
table {
width: 100%;
margin: 15px auto;
text-align: center;
.cdk-header-cell {
text-align: center;
}
}
.imagesdialog{
text-align: center;
.imagesbox{
width:99%;
height: 755px;
border: 6px solid #cccccc;
display: flex;
justify-content: space-around;
flex-flow:wrap;
overflow: auto;
.imgitem{
width: 300px;
height: 200px;
float: left;
margin-top:70px;
.img{
width: 300px;
height: 180px;
img{
width: 300px;
height: 160px;
cursor: pointer;
}
p{
width: 300px;
height: 20px;
margin-top: 20px;
}
}
}
}
//重点提示
.tips{
width: 85%;
height: 150px;
border: 1px solid black;
border-radius: 5px;
margin: 15px auto;
text-align: center;
padding: 25px;
textarea {
resize: none;
width: 100%;
height: 100%;
}
}
//图片详情弹出框样式
.imgdialog{
position: relative;
.imagestitle{
width: 100%;
}
.imagesbox{
width: 1500px;
height: 700px;
text-align: center;
line-height: 700px;
img{
height: 100%;
// width: 1280px;
}
.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%;
}
}
.detailbtn{
height: 50px;
width: 100%;
text-align: center;
margin-top: 20px;;
button{
margin: 0 20px;
}
}
//预览图片旋转角度
.rotateA {transform: rotate(90deg) scale(0.75);}
.rotateB {transform: rotate(180deg)}
.rotateC {transform: rotate(270deg) scale(0.75);}
//预览图片
.previewImgBox {
width: 1500px;
height: 700px;
text-align: center;
img{
width: auto;
height: auto;
max-width: 100%;
height: 100%;}
}
.previewImgBottom {
text-align: center;
height: 30px;
margin: 20px auto;
}

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

@ -1,12 +1,11 @@
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import {HttpClient} from '@angular/common/http'
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatPaginator } from '@angular/material/paginator';
import { MatTableDataSource } from '@angular/material/table';
import { FlatTreeControl } from '@angular/cdk/tree';
import { MatTreeFlattener, MatTreeFlatDataSource } from '@angular/material/tree';
import { PageEvent } from '@angular/material/paginator';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { KeySiteImgs } from './keysiteimgs.component'
@Component({
selector: 'app-key-site',
templateUrl: './key-site.component.html',
@ -14,22 +13,157 @@ import { KeySiteImgs } from './keysiteimgs.component'
})
export class KeySiteComponent implements OnInit {
constructor(public http: HttpClient,public dialog: MatDialog) { }
constructor(public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
displayedColumns: string[] = ['mainname', 'position', 'construction', 'nature', 'danger', 'img'];
dataSource:any; //所有用户
ngOnInit(): void {
this.dataSource = [{mainname:"xxx",position:"xxxx",construction:'xxxxx',nature:"asasa",danger:"uuuu"}]
this.getCompanyPostion()
this.getCompanyTips()
this.getAllBuilding()
}
lookphone(){
const dialogRef = this.dialog.open(KeySiteImgs, {//调用open方法打开对话框并且携带参数过去
width: '1600px',
height:'900px',
data: {}
});
dialogRef.afterClosed().subscribe(
data=>{
allCompanyPosition:any = []; //所有单位重点部位
companyTips:any; //所有单位重点提示
companyInput:any; //单位重点提示数据
allBuilding:any = []; //所有建筑 + 建筑重点部位 + 建筑重点提示
//获取单位重点部位
getCompanyPostion () {
this.http.get('/api/CompanyAccount/CompanyImportantLocations').subscribe(data=>{
this.allCompanyPosition = data
})
}
//获取单位重点提示
getCompanyTips () {
this.http.get('/api/CompanyAccount/CompanyImportantTips').subscribe((data:any)=>{
if (data) {
this.companyTips = data
this.companyInput = data.details}
})
}
//获取所有建筑
getAllBuilding () {
this.http.get('/api/CompanyAccount/Buildings').subscribe((data:any)=>{
if (data.length) {
this.allBuilding = data
this.allBuilding.forEach(element => {
element.position = [] //建筑重点部位
element.tips = null //建筑重点提示
element.companyInput = null }) //建筑重点提示数据
this.getAllBuildingPositon()
this.getAllBuildingTips()
}
);
})
}
//获取所有建筑重点部位
getAllBuildingPositon () {
this.allBuilding.forEach(element => {
let id = {buildingId:element.id}
this.http.get('/api/CompanyAccount/BuildingImportantLocations',{params:id}).subscribe(data=>{
element.position = data
})
});
}
//获取所有建筑重点提示
getAllBuildingTips () {
this.allBuilding.forEach(element => {
let id = {buildingId:element.id}
this.http.get('/api/CompanyAccount/BuildingImportantTips',{params:id}).subscribe((data:any)=>{
if (data) {
element.tips = data
element.companyInput = data.details}
})
});
}
//保存单位重点提示
Preservation () {
if (this.companyTips) { //编辑单位重点提示
let data = {
companyId: this.companyTips.companyId,
id: this.companyTips.id,
details: this.companyInput}
this.http.put(`/api/CompanyAccount/CompanyImportantTips/${this.companyTips.id}`,data).subscribe(data=>{
this.getCompanyTips()
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据修改成功','确定',config);
})
} else { //新增单位重点提示
let data = {
companyId: sessionStorage.getItem('companyId'),
id : "",
details: this.companyInput || ""}
this.http.post('/api/CompanyAccount/CompanyImportantTips',data).subscribe(data=>{
this.getCompanyTips()
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据修改成功','确定',config);
})
}
}
//保存建筑重点提示
PreservationBuilding (e) {
if (e.tips) { //编辑建筑重点提示
let data = {
buildingId: e.id,
id: e.tips.id,
details: e.companyInput}
this.http.put(`/api/CompanyAccount/BuildingImportantTips/${e.tips.id}`,data).subscribe(data=>{
this.toUpdate(e)
})
} else { //新增重点单位提示
let data = {
buildingId: e.id,
details: e.companyInput || ""}
this.http.post('/api/CompanyAccount/BuildingImportantTips',data).subscribe(data=>{
this.toUpdate(e)
})
}
}
//查看图片
seeImg (e) {
if (e.length) {
let data = e
const dialogRef = this.dialog.open(KeySiteImgs, {//调用open方法打开对话框并且携带参数过去
width: '1600px',
height:'900px',data});
dialogRef.afterClosed().subscribe();
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无图片数据','确定',config);
}
}
//封装方法获取更新当前tab页重点提示
toUpdate (e) {
let id = {buildingId:e.id}
this.http.get('/api/CompanyAccount/BuildingImportantTips',{params:id}).subscribe((data:any)=>{
if (data) {
this.allBuilding.forEach(element => {
if (element.id === e.id) {
element.tips = data
element.companyInput = data.details}
});
} // if
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据修改成功','确定',config);
})
}
}

23
src/app/ui/key-site/keyimgdetail.component.html

@ -1,23 +0,0 @@
<div class="imgdialog">
<div mat-dialog-title class="imagestitle">图片详情</div>
<!-- <div class="swiper-container swiper-no-swiping"> -->
<div class="swiper-container swiper-no-swiping">
<div class="swiper-wrapper ">
<div class="swiper-slide imagesbox"><img class="imgitemdefault" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1583660754310&di=782b4fc4e7186c8db2fa6dfe5e0760f4&imgtype=0&src=http%3A%2F%2Ffile06.16sucai.com%2F2016%2F0704%2F04e855314b2e0b342a949fd9f8698e97.jpg" alt=""></div>
<div class="swiper-slide imagesbox"><img class="imgitemdefault" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" src="https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1804916093,12959926&fm=26&gp=0.jpg" alt=""></div>
<div class="swiper-slide imagesbox"><img class="imgitemdefault" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2496032502,3509277120&fm=26&gp=0.jpg" alt=""></div>
<div class="swiper-slide imagesbox"><img class="imgitemdefault" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" src="../../../assets/images/xxx.jpg" alt=""></div>
<div class="swiper-slide imagesbox"><img class="imgitemdefault" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" src="../../../assets/images/fengjing.jpg" alt=""></div>
</div>
<!-- 如果需要导航按钮 -->
<div class="swiper-button-prev" (click)="defaultrotateA()"></div>
<div class="swiper-button-next" (click)="defaultrotateA()"></div>
</div>
<div class="detailbtn">
<button type="button" mat-icon-button (click)="rotate()"><mat-icon>refresh</mat-icon></button>
<button type="button" mat-icon-button><mat-icon>vertical_align_bottom</mat-icon></button>
</div>
</div>

93
src/app/ui/key-site/keyimgdetail.component.ts

@ -1,98 +1,17 @@
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';
import Swiper from 'swiper';
@Component({
selector: 'keyimgdetail',
templateUrl: './keyimgdetail.component.html',
styleUrls: ['./key-site.component.scss']
})
export class KeyImgDetail {
myControl = new FormControl();
//注入MatDialogRef,可以用来关闭对话框
//要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌
constructor(private http: HttpClient,public dialogRef: MatDialogRef<KeyImgDetail>,@Inject(MAT_DIALOG_DATA) public data) {}
allunittype:any
onNoClick(): void {
this.dialogRef.close();
}
defaultavtimgindex:any
avtimgindex:any//当前轮播图显示的下标
isheng:any
ngOnInit(): void {
setTimeout(() => {
var mySwiper:any = new Swiper ('.swiper-container', {
// 如果需要前进后退按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
}
})
mySwiper.on('slideChangeTransitionEnd', ()=>{
this.avtimgindex = mySwiper.activeIndex
});
this.defaultavtimgindex =mySwiper.activeIndex
},1);
}
ngAfterViewInit(): void{
}
//点击旋转按钮时
rotateA = 0
rotateB = 0
rotate(){
if(this.avtimgindex){//如果已经点击过切换图片按钮时
var w= document.getElementsByClassName("imgitemdefault")[this.avtimgindex]['naturalWidth'];
var h = document.getElementsByClassName("imgitemdefault")[this.avtimgindex]['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
}
}
}else{//如果想要直接旋转打开图片时
var w= document.getElementsByClassName("imgitemdefault")[this.defaultavtimgindex]['naturalWidth'];
var h = document.getElementsByClassName("imgitemdefault")[this.defaultavtimgindex]['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
}
}
}
}
defaultrotateA(){
this.rotateA = 0
}
onSubmit(value){
}
}
export class KeyImgDetail {
}

30
src/app/ui/key-site/keysiteimgs.component.html

@ -1,20 +1,16 @@
<div class="imagesdialog">
<div mat-dialog-title class="imagestitle">消防水源</div>
<div class="imagesbox">
<div class="imgitem" *ngFor="let item of xxx">
<div class="img">
<img [src]="defaultimg" alt="" title="查看大图" (click)="imgdetails()">
<p>建筑物图片</p>
</div>
<div mat-dialog-title>图片详情</div>
<div class="swiper-container">
<div class="swiper-wrapper">
<div *ngFor="let item of allImages" class="swiper-slide previewImgBox">
<img [ngClass]="{'rotateA':rotationAngle==90,'rotateB':rotationAngle==180,'rotateC':rotationAngle==270}" [src]="item">
</div>
<mat-paginator
[length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="yyy()">
</mat-paginator>
</div>
<!-- 如果需要导航按钮 -->
<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>

87
src/app/ui/key-site/keysiteimgs.component.ts

@ -1,56 +1,49 @@
import { Component, OnInit, Inject ,ViewChild} 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';
import { KeyImgDetail } from './keyimgdetail.component'
import { MatPaginator } from '@angular/material/paginator';
import { PageEvent } from '@angular/material/paginator';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import Swiper from 'swiper';
@Component({
selector: 'keysiteimgs',
templateUrl: './keysiteimgs.component.html',
styleUrls: ['./key-site.component.scss']
})
export class KeySiteImgs {
myControl = new FormControl();
//注入MatDialogRef,可以用来关闭对话框
//要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌
constructor(private http: HttpClient,public dialogRef: MatDialogRef<KeySiteImgs>,@Inject(MAT_DIALOG_DATA) public data,public dialog: MatDialog) {}
xxx:any = [{name:1},{name:12},{name:13},{name:14},{name:15},{name:16},{name:17},{name:18},{name:19},{name:111}]
defaultimg = "../../../assets/images/upload.jpg"
length = 11;
pageSize = 8;
pageSizeOptions: number[] = [5, 10, 25, 100];
pageEvent: PageEvent;
// @ViewChild(MatPaginator, {static: true})
// paginator: MatPaginator;
yyy(){
}
onNoClick(): void {
this.dialogRef.close();
}
ngOnInit(): void {
// this.xxx.paginator = this.paginator;
}
//图片查看大图
imgdetails(){
const dialogRef = this.dialog.open(KeyImgDetail, {//调用open方法打开对话框并且携带参数过去
width: '1600px',
height:'900px',
data: {}
});
dialogRef.afterClosed().subscribe(
data=>{
}
);
}
onSubmit(value){
}
export class KeySiteImgs {
constructor(private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef<KeySiteImgs>,
@Inject(MAT_DIALOG_DATA) public data) { }
testSwiper: Swiper;
ngOnInit(): void {
this.allImages = this.data
}
ngAfterViewInit() {
this.testSwiper = new Swiper('.swiper-container', {
direction: 'horizontal',
loop: false,
// 如果需要前进后退按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
}
});
}
allImages:any; //展示所有的图片
rotationAngle:number=0; //旋转角度
//旋转图片
rotate () {
this.rotationAngle = this.rotationAngle+90
if (this.rotationAngle === 360) {this.rotationAngle = 0}
}
}

2
src/app/ui/realistic-picture/addRealPicture.html

@ -3,7 +3,7 @@
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<mat-form-field>
<input matInput placeholder="请输入实景图分组名称" required ngModel name="name">
<input matInput placeholder="请输入实景图分组名称" required ngModel name="name" maxlength="20">
</mat-form-field>
<div mat-dialog-actions>

2
src/app/ui/realistic-picture/editRealPicture.html

@ -3,7 +3,7 @@
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<mat-form-field>
<input matInput placeholder="实景图分组名称" required [(ngModel)]="name" name="name">
<input matInput placeholder="实景图分组名称" required [(ngModel)]="name" name="name" maxlength="20">
</mat-form-field>
<div mat-dialog-actions>

1
src/app/ui/realistic-picture/previewImg.html

@ -13,5 +13,4 @@
<div class="previewImgBottom">
<button type="button" mat-icon-button (click)='rotate()'><mat-icon>refresh</mat-icon></button>
<button type="button" mat-icon-button><mat-icon>vertical_align_bottom</mat-icon></button>
</div>

8
src/app/ui/realistic-picture/realistic-picture.component.html

@ -11,10 +11,10 @@
<div>
<div *ngFor="let item of allRealPicture,let key=index" class="material"
[ngClass]="{'leftFile': selectRealIndex===key}" (click)="changeReal(item,key)">
<mat-icon class="btn">folder</mat-icon><span class="matname">{{item.name}}</span>
<mat-icon class="btn">folder</mat-icon><span>{{item.name}}</span>
</div>
<div class="material" *ngIf="!allRealPicture.length">
<span class="matname">暂无数据</span>
<span>暂无数据</span>
</div>
</div>
</div>
@ -41,12 +41,12 @@
<mat-icon class="checkedImg" *ngIf="item.checked">check_circle</mat-icon>
<div class="fixedImg"><img [src]="item.newImageUrl" (click)='operation(item,key)' [ngClass]="{'selectImg': item.checked}"></div>
<label style="margin-left: 5px;">图片名称:</label>
<input type="text" style="margin-left: 10px;" [(ngModel)]="item.nameStart">
<input type="text" style="margin-left: 10px;" [(ngModel)]="item.nameStart" maxlength="20">
<a href="javascript:" style="margin-left: 5px;" (click)='preservationImg(item)'>保存</a>
<a href="javascript:" style="margin-left: 5px;" (click)="deleteImg(item)">删除</a>
</div>
<p style="width: 70px;margin: 30px auto;" *ngIf="!allImages.length">暂无数据</p>
<p style="width: 100px;margin: 30px auto;" *ngIf="!allImages.length">暂无数据</p>
</div>
<mat-paginator [length]="length"
[pageSize]='pageSize'

8
src/app/ui/realistic-picture/realistic-picture.component.scss

@ -52,6 +52,13 @@
font-size: 16px;
margin-top: 10px;
padding-left: 15px;
span {
max-width: 200px;
display: inline-block;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.btn {
color: #FFC122;
}
@ -162,5 +169,4 @@
text-align: center;
height: 30px;
margin: 20px auto;
:first-child {margin-right: 20px;}
}

40
src/app/ui/realistic-picture/realistic-picture.component.ts

@ -3,6 +3,7 @@ import { HttpClient } from '@angular/common/http';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { FileUploader } from 'ng2-file-upload';
import { MatPaginator } from '@angular/material/paginator';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import Swiper from 'swiper';
@ -22,7 +23,7 @@ export class RealisticPictureComponent implements OnInit {
removeAfterUpload:true,
});
constructor(private http:HttpClient,public dialog: MatDialog) { }
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.companyId = sessionStorage.getItem('companyId')
@ -92,6 +93,7 @@ export class RealisticPictureComponent implements OnInit {
if (this.selectRealIndex != index) {
this.selectReal = e
this.selectRealIndex = index
this.isDownload = false
this.downloadList = []
this.getAllRealPicture()
}
@ -101,9 +103,7 @@ export class RealisticPictureComponent implements OnInit {
download () {
this.isDownload = !this.isDownload
if (!this.isDownload) { //取消批量下载时数组清空
this.allImages.forEach(element => {
element.checked = false
});
this.allImages.forEach(element => {element.checked = false});
this.downloadList = []
}
}
@ -114,7 +114,6 @@ export class RealisticPictureComponent implements OnInit {
e.checked = !e.checked
if (e.checked==true) {this.downloadList.push(e)}
else {this.downloadList.splice(this.downloadList.findIndex(item => item.id === e.id), 1)}
console.log(this.downloadList)
} else { //预览图片
let data = {
allImages:this.allImages,
@ -152,7 +151,12 @@ export class RealisticPictureComponent implements OnInit {
let isDelete = confirm('您确定要删除吗')
if (isDelete) {
this.http.delete(`/api/CompanyAccount/RealityImageGroups/${this.selectReal.id}`).subscribe(data=>{
this.getAllGrouping()
this.http.get('/api/CompanyAccount/RealityImageGroups').subscribe((data:any)=>{
this.allRealPicture = data
this.selectReal = data[this.selectRealIndex]
this.allImages = []
this.getAllRealPicture()
})
})
}
}
@ -170,6 +174,10 @@ export class RealisticPictureComponent implements OnInit {
}
this.http.put(`/api/CompanyAccount/RealityImages/${e.id}`,data).subscribe(data=>{
this.getAllRealPicture()
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('图片修改成功','确定',config);
})
}
@ -200,7 +208,10 @@ export class RealisticPictureComponent implements OnInit {
this.file = e.target.files[0] || null //上传的文件
if (this.file) {this.startUploading()}
} else {
alert('请选择或创建实景图文件夹')
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择或创建实景图文件夹','确定',config);
}
}
@ -285,7 +296,10 @@ export class RealisticPictureComponent implements OnInit {
}
this.http.post('/api/CompanyAccount/RealityImages',data).subscribe(data=>{
this.getAllRealPicture()
alert('图片上传成功')
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('图片上传成功','确定',config);
})
}
@ -310,10 +324,16 @@ export class RealisticPictureComponent implements OnInit {
})
if(i == this.downloadList.length-1) { //判断是否下载完毕
this.isLoading = false
console.log('下载完毕'+result)}
this.isDownload = false
this.allImages.forEach(element => {element.checked = false});
this.downloadList = []}
} //for循环
} else {alert('请选择图片')}
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择图片','确定',config);}
}

2
src/app/ui/uploading-cad/editFile.html

@ -2,7 +2,7 @@
<div>
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<mat-form-field>
<input matInput placeholder="请输入CAD图纸名称" required [(ngModel)]="CADname" name="name">
<input matInput placeholder="请输入CAD图纸名称" required [(ngModel)]="CADname" name="name" maxlength="20">
</mat-form-field>
<p style="font-size: 14px; color: red; margin-bottom: 15px;">*注: XX建筑-XX系统-XX某层</p>

2
src/app/ui/uploading-cad/readFile.html

@ -2,7 +2,7 @@
<div>
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container">
<mat-form-field>
<input matInput placeholder="请输入CAD图纸名称" required ngModel name="name">
<input matInput placeholder="请输入CAD图纸名称" required ngModel name="name" maxlength="20">
</mat-form-field>
<p style="font-size: 14px; color: red; margin-bottom: 15px;">*注: XX建筑-XX系统-XX某层</p>
<div>

2
src/app/ui/uploading-cad/uploading-cad.component.html

@ -59,4 +59,4 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<h3 style="width: 100px; margin: 30px auto; text-align: center;" *ngIf="!CADList.length">暂无数据</h3>
<p style="width: 100px; margin: 30px auto; text-align: center;" *ngIf="!CADList.length">暂无数据</p>

26
src/app/ui/uploading-cad/uploading-cad.component.ts

@ -1,6 +1,7 @@
import { Component, OnInit, Inject } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { MatDialog, MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
@ -11,7 +12,7 @@ import { MatDialog, MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dial
})
export class UploadingCADComponent implements OnInit {
constructor(private http:HttpClient,public dialog: MatDialog) { }
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.companyId = sessionStorage.getItem('companyId')
@ -64,7 +65,10 @@ export class UploadingCADComponent implements OnInit {
if (data) {this.getAllCAD()}
});
} else if (this.selectCAD.length>1) {
alert('不支持批量编辑')
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('不支持批量编辑','确定',config);
}
}
@ -175,7 +179,10 @@ export class UploadingCADComponent implements OnInit {
this.uploadProgress = 0;
this.uploadisLoading= false
this.PartNumberETag =[] //清空保存返回的信息
alert('取消上传成功!')
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('取消上传成功!','确定',config);
})
}
@ -211,7 +218,11 @@ export class UploadingCADComponent implements OnInit {
this.download = data
this.downloadFile()
})
} else if (this.selectCAD.length>1) {alert('暂时不支持批量下载')}
} else if (this.selectCAD.length>1) {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂时不支持批量下载','确定',config)}
}
//初始化下载
@ -309,7 +320,7 @@ export class UploadingCADComponent implements OnInit {
export class readFile {
constructor(private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef<readFile>,
@Inject(MAT_DIALOG_DATA) public data) { }
@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) { }
ngOnInit(): void {
@ -330,7 +341,10 @@ export class readFile {
file: this.file}
this.dialogRef.close(data);
} else {
alert('请选择CAD图纸')
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择CAD图纸','确定',config);
}
}

6
src/styles.scss

@ -3,10 +3,9 @@
@import './app/theme.scss';
html,body,ul,ol,dl,li,dt,dd,p,form,input,h1,h2,h3,h4,h5,h6,section,article,aside,header,footer,nav,figure,time,mark,main,canvas{
height:100%;
height: 100%;
margin:0;
padding:0;
}
body{
margin: 0 auto;
@ -54,6 +53,9 @@ table th.mat-header-cell:last-of-type,table td.mat-cell:last-of-type,
table td.mat-footer-cell:last-of-type{
padding-right: 0px;
}
.mat-tab-body{
height: 100%;
}
//x轴滚动条隐藏
.example-sidenav-content {

Loading…
Cancel
Save