Browse Source

[新建]编写消防设施和重点部位基本布局功能

develop
邵佳豪 5 years ago
parent
commit
f6fbd9204c
  1. 6
      angular.json
  2. 4
      package.json
  3. 14
      src/app/tabbar/tabbar.component.html
  4. 3
      src/app/ui/allaround/allaround.component.html
  5. 4
      src/app/ui/allaround/allaround.component.scss
  6. 16
      src/app/ui/allaround/imgdetails.component.html
  7. 20
      src/app/ui/allaround/imgdetails.component.ts
  8. 2
      src/app/ui/basicinfo/basicinfo.component.html
  9. 61
      src/app/ui/basicinfo/basicinfo.component.ts
  10. 170
      src/app/ui/fire-fighting-device/fire-fighting-device.component.html
  11. 186
      src/app/ui/fire-fighting-device/fire-fighting-device.component.scss
  12. 30
      src/app/ui/fire-fighting-device/fire-fighting-device.component.ts
  13. 13
      src/app/ui/fire-fighting-device/imagesdata.component.html
  14. 44
      src/app/ui/fire-fighting-device/imagesdata.component.ts
  15. 22
      src/app/ui/fire-fighting-device/imgsdatadetail.component.html
  16. 54
      src/app/ui/fire-fighting-device/imgsdatadetail.component.ts
  17. 58
      src/app/ui/key-site/key-site.component.html
  18. 208
      src/app/ui/key-site/key-site.component.scss
  19. 30
      src/app/ui/key-site/key-site.component.ts
  20. 22
      src/app/ui/key-site/keyimgdetail.component.html
  21. 54
      src/app/ui/key-site/keyimgdetail.component.ts
  22. 13
      src/app/ui/key-site/keysiteimgs.component.html
  23. 44
      src/app/ui/key-site/keysiteimgs.component.ts
  24. 6
      src/app/ui/ui.module.ts
  25. 1
      src/app/ui/uploading-cad/uploading-cad.component.html
  26. 3
      src/app/ui/uploading-cad/uploading-cad.component.ts
  27. 13
      src/assets/swiper.min.css
  28. 14
      src/assets/swiper.min.js
  29. 2
      src/index.html

6
angular.json

@ -29,10 +29,12 @@
"src/assets"
],
"styles": [
"src/styles.scss"
"src/styles.scss",
"./node_modules/swiper/css/swiper.min.css"
],
"scripts": [
"node_modules/echarts/dist/echarts.js"
"node_modules/echarts/dist/echarts.js",
"./node_modules/swiper/js/swiper.min.js"
]
},
"configurations": {

4
package.json

@ -23,6 +23,7 @@
"@angular/platform-browser-dynamic": "~9.0.0",
"@angular/router": "~9.0.0",
"@types/cesium": "^1.59.5",
"@types/swiper": "^5.2.1",
"angular-calendar": "^0.28.2",
"cesium": "^1.64.0",
"date-fns": "^2.9.0",
@ -33,10 +34,10 @@
"ngx-echarts": "^4.2.2",
"ngx-perfect-scrollbar": "^8.0.0",
"rxjs": "~6.5.4",
"swiper": "^5.3.6",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.900.1",
"@angular/cli": "~9.0.1",
@ -58,5 +59,4 @@
"tslint": "~5.15.0",
"typescript": "~3.7.5"
}
}

14
src/app/tabbar/tabbar.component.html

@ -3,21 +3,21 @@
<h1>{{companyName}}</h1>
<!-- 全屏 -->
<button mat-button (click)="!isfullscreen?fullscreenToggle():closefullscreen()" class="fullscreen">
<!-- <button mat-button (click)="!isfullscreen?fullscreenToggle():closefullscreen()" class="fullscreen">
<ng-container *ngIf="!isfullscreen; else elseTemplate">
<mat-icon *ngIf="!isfullscreen">fullscreen</mat-icon>
</ng-container>
<ng-template #elseTemplate>
<mat-icon else>fullscreen_exit</mat-icon>
</ng-template>
</button>
</button> -->
<!-- 黑夜模式开关 -->
<mat-slide-toggle (change)='onChange($event.checked)' class="darktheme"></mat-slide-toggle>
<!-- <mat-slide-toggle (change)='onChange($event.checked)' class="darktheme"></mat-slide-toggle> -->
<!-- 锁屏按钮 -->
<button mat-button class="lockscreen" [routerLink]="['/lockscreen']" routerLinkActive="router-link-active" >
<!-- <button mat-button class="lockscreen" [routerLink]="['/lockscreen']" routerLinkActive="router-link-active" >
<mat-icon>screen_lock_landscape</mat-icon>
</button>
</button> -->
<!-- 登录信息按钮 -->
<button mat-icon-button [matMenuTriggerFor]="appMenu" class="login">
@ -39,7 +39,7 @@
</mat-menu>
<!-- 设置按钮 -->
<button mat-icon-button [matMenuTriggerFor]="appSet" class="setting">
<!-- <button mat-icon-button [matMenuTriggerFor]="appSet" class="setting">
<mat-icon>settings</mat-icon>
</button>
<mat-menu #appSet="matMenu" yPosition="below" xPosition="after">
@ -59,5 +59,5 @@
<mat-icon>laptop</mat-icon>
<span>盒子模式</span>
</button>
</mat-menu>
</mat-menu> -->
</mat-toolbar>

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

@ -1,5 +1,6 @@
<div class="tabbar">
<span>单位毗邻</span>
<span style="margin:0 20px;">单位毗邻</span>
<button mat-raised-button color="primary">建筑一</button>
</div>
<div class="aroundimagebox">
<div class="aroundimage">

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

@ -63,12 +63,10 @@
.imagesbox{
width: 1500px;
height: 700px;
border: 6px solid #cccccc;
margin-left: -10px;
text-align: center;
img{
height: 100%;
width: 1280px;
}
.img1{
transform:rotate(90deg) scale(0.55);

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

@ -1,7 +1,19 @@
<div class="imgdialog">
<div mat-dialog-title class="imagestitle">图片详情</div>
<div class="imagesbox">
<img [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270}" 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 class="swiper-container swiper-no-swiping"> -->
<div class="swiper-container">
<div class="swiper-wrapper ">
<div class="swiper-slide imagesbox"><img [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270}" 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 [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270}" src="https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1804916093,12959926&fm=26&gp=0.jpg" alt=""></div>
<div class="swiper-slide imagesbox"><img [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270}" src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2496032502,3509277120&fm=26&gp=0.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>

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

@ -5,7 +5,7 @@ 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',
@ -21,7 +21,20 @@ import { MatSnackBar } from '@angular/material/snack-bar';
this.dialogRef.close();
}
ngOnInit(): void {
setTimeout(() => {
var mySwiper:any = new Swiper ('.swiper-container', {
initialSlide :2,
// 如果需要前进后退按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
}
})
// mySwiper.slideTo(2,0);
},1);
}
ngAfterViewInit(): void{
}
//旋转图片角度
rotateA = 0
@ -31,6 +44,9 @@ import { MatSnackBar } from '@angular/material/snack-bar';
this.rotateA = 0
}
}
defaultrotateA(){
this.rotateA = 0
}
onSubmit(value){
}

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

@ -78,7 +78,7 @@
<div class="uploadimg" >
<span>单位照片:</span>
<div class="uploadingimg">
<img src="../../../assets/images/upload.jpg" alt="" style="width: 299px; height: 170px;" >
<img [src]="imgsrc" alt="" style="width: 299px; height: 170px;" >
</div>

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

@ -41,8 +41,7 @@ export class BasicinfoComponent implements OnInit {
treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children);
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
myControl = new FormControl();
imgsrc = ""
imgUrl = ""//返回来的图片地址后缀
allunittype:any //所有单位类型
isorganizationbox = false//控制辖区中队框的显示隐藏
selectedorganization:any//所选的辖区中队
@ -157,20 +156,50 @@ export class BasicinfoComponent implements OnInit {
hasChild = (_: number, node: any) => node.expandable;
filechange(e){
const file = e.srcElement.files[0]; // 获取图片这里只操作一张图片
var reader = new FileReader();
reader.readAsDataURL(file);
var image:any = new Image();
reader.onload = function(){
image.src = reader.result
var upfilesize = file.size/1048576 //上传照片大小MB
if(upfilesize <= 5){//如果想要上传照片小于5MB,则走正常上传流程
this.upload()
}
setTimeout(() => {
if(image.width!=128 && image.height!=128){
var obj = document.getElementById('selectedfile') ;
obj.outerHTML=obj.outerHTML;
alert("请选择分辨率为128*128的图片")
}
}, 100);
if(upfilesize > 5 && upfilesize <= 20){//如果想要上传照片在5-20之间则采用分块上传
var bytesPerPiece = 1024 * 1024 * 5;// 每个文件切片大小定为 5 Mb
var totalPieces;//一共有多少块
var blob = e.srcElement.files[0];//想要上传的整体文件
var start = 0;
var end;
var index = 0;
var filesize = blob.size;//上传文件的大小
var filename = blob.name;//上传文件的名字
totalPieces = Math.ceil(filesize / bytesPerPiece);//------计算需要分为多少段
this.http.post(`/api/Objects/PlanPlatform/${filename}?uploads`,{}).subscribe(data=>{
console.log(data)
})
// while(start < filesize){
// end = start + bytesPerPiece;
// if(end > filesize) {
// end = filesize;
// }
// var chunk = blob.slice(start,end);//切割文件
// var sliceIndex= blob.name + index;//分块编号
// var formData = new FormData();
// formData.append("file", chunk, filename);
// this.blockupload()
// start = end;
// index++;
// }
// this.blockupload()
}
if(upfilesize > 20){//如果想要上传照片大于20MB
alert("上传照片应小于20MB")
}
}
imgsrc = "../../../assets/images/upload.jpg"
imgUrl = ""//返回来的图片地址后缀
upload(){
if(!this.uploader.queue[0]){
alert("请选择文件")
@ -194,7 +223,11 @@ export class BasicinfoComponent implements OnInit {
}
};
}
}
blockupload(){//分块上传
}
onSubmit(value){

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

@ -1 +1,169 @@
<p>fire-fighting-device works!</p>
<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">
<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="tablebox">
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
<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">{{element.realName}}</td>
</ng-container>
<ng-container matColumnDef="mainmsg">
<th mat-header-cell *matHeaderCellDef>主要情况</th>
<td mat-cell *matCellDef="let element">{{element.organizationName}}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</div>
<div class="tablebox">
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
<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">查看照片</td>
</ng-container>
<ng-container matColumnDef="mainmsg">
<th mat-header-cell *matHeaderCellDef>主要情况</th>
<td mat-cell *matCellDef="let element">{{element.organizationName}}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</div>
<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>
<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>
</div>

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

@ -0,0 +1,186 @@
.tabbar{
height: 60px;
background: yellow;
line-height: 60px;
margin-bottom: 20px;
}
.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;
}
}
}
}
}
//图片详情弹出框样式
.imgdialog{
position: relative;
.imagestitle{
width: 100%;
}
.imagesbox{
width: 1500px;
height: 700px;
text-align: center;
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%;
}
}
.detailbtn{
height: 50px;
width: 100%;
text-align: center;
margin-top: 20px;;
button{
margin: 0 20px;
}
}
}

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

@ -1,5 +1,12 @@
import { Component, OnInit } from '@angular/core';
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'
@Component({
selector: 'app-fire-fighting-device',
templateUrl: './fire-fighting-device.component.html',
@ -7,9 +14,22 @@ import { Component, OnInit } from '@angular/core';
})
export class FireFightingDeviceComponent implements OnInit {
constructor() { }
constructor(public http: HttpClient,public dialog: MatDialog) { }
displayedColumns: string[] = ['project', 'phone', 'mainmsg'];
dataSource:any; //所有用户
ngOnInit(): void {
this.dataSource = [{name:"xxx",main:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}]
}
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

@ -0,0 +1,13 @@
<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>

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

@ -0,0 +1,44 @@
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){
}
}

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

@ -0,0 +1,22 @@
<div class="imgdialog">
<div mat-dialog-title class="imagestitle">图片详情</div>
<!-- <div class="swiper-container swiper-no-swiping"> -->
<div class="swiper-container">
<div class="swiper-wrapper ">
<div class="swiper-slide imagesbox"><img [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270}" 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 [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270}" src="https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1804916093,12959926&fm=26&gp=0.jpg" alt=""></div>
<div class="swiper-slide imagesbox"><img [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270}" src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2496032502,3509277120&fm=26&gp=0.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>

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

@ -0,0 +1,54 @@
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();
}
ngOnInit(): void {
setTimeout(() => {
var mySwiper:any = new Swiper ('.swiper-container', {
// 如果需要前进后退按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
}
})
},1);
}
ngAfterViewInit(): void{
}
//旋转图片角度
rotateA = 0
rotate(){
this.rotateA += 90
if(this.rotateA == 360){
this.rotateA = 0
}
}
defaultrotateA(){
this.rotateA = 0
}
onSubmit(value){
}
}

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

@ -1 +1,57 @@
<p>key-site works!</p>
<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">
<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>
<div class="bigbox">
<div class="bigboxtitle">重点提示</div>
<div class="hintbox">
<div class="hint">
</div>
</div>
</div>
</div>
</div>

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

@ -0,0 +1,208 @@
.tabbar{
height: 60px;
background: yellow;
line-height: 60px;
margin-bottom: 20px;
}
.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;
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;
}
}
}
}
}
.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;
}
}
}
}
}
//图片详情弹出框样式
.imgdialog{
position: relative;
.imagestitle{
width: 100%;
}
.imagesbox{
width: 1500px;
height: 700px;
text-align: center;
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%;
}
}
.detailbtn{
height: 50px;
width: 100%;
text-align: center;
margin-top: 20px;;
button{
margin: 0 20px;
}
}
}

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

@ -1,5 +1,12 @@
import { Component, OnInit } from '@angular/core';
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 { KeySiteImgs } from './keysiteimgs.component'
@Component({
selector: 'app-key-site',
templateUrl: './key-site.component.html',
@ -7,9 +14,22 @@ import { Component, OnInit } from '@angular/core';
})
export class KeySiteComponent implements OnInit {
constructor() { }
constructor(public http: HttpClient,public dialog: MatDialog) { }
displayedColumns: string[] = ['mainname', 'position', 'construction', 'nature', 'danger', 'img'];
dataSource:any; //所有用户
ngOnInit(): void {
this.dataSource = [{mainname:"xxx",position:"xxxx",construction:'xxxxx',nature:"asasa",danger:"uuuu"}]
}
lookphone(){
const dialogRef = this.dialog.open(KeySiteImgs, {//调用open方法打开对话框并且携带参数过去
width: '1600px',
height:'900px',
data: {}
});
dialogRef.afterClosed().subscribe(
data=>{
}
);
}
}

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

@ -0,0 +1,22 @@
<div class="imgdialog">
<div mat-dialog-title class="imagestitle">图片详情</div>
<!-- <div class="swiper-container swiper-no-swiping"> -->
<div class="swiper-container">
<div class="swiper-wrapper ">
<div class="swiper-slide imagesbox"><img [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270}" 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 [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270}" src="https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1804916093,12959926&fm=26&gp=0.jpg" alt=""></div>
<div class="swiper-slide imagesbox"><img [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270}" src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2496032502,3509277120&fm=26&gp=0.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>

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

@ -0,0 +1,54 @@
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();
}
ngOnInit(): void {
setTimeout(() => {
var mySwiper:any = new Swiper ('.swiper-container', {
// 如果需要前进后退按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
}
})
},1);
}
ngAfterViewInit(): void{
}
//旋转图片角度
rotateA = 0
rotate(){
this.rotateA += 90
if(this.rotateA == 360){
this.rotateA = 0
}
}
defaultrotateA(){
this.rotateA = 0
}
onSubmit(value){
}
}

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

@ -0,0 +1,13 @@
<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>

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

@ -0,0 +1,44 @@
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 { KeyImgDetail } from './keyimgdetail.component'
@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 = [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(KeyImgDetail, {//调用open方法打开对话框并且携带参数过去
width: '1600px',
height:'900px',
data: {}
});
dialogRef.afterClosed().subscribe(
data=>{
}
);
}
onSubmit(value){
}
}

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

@ -90,9 +90,13 @@ import { RealisticPictureComponent } from './realistic-picture/realistic-picture
import { UploadingCADComponent } from './uploading-cad/uploading-cad.component';
import { AddHouseInfo } from './basicinfo/addhouseinfo.component';
import { ImgDetails } from './allaround/imgdetails.component';
import { ImagesData } from './fire-fighting-device/imagesdata.component';
import { ImgsDataDetail } from './fire-fighting-device/imgsdatadetail.component';
import { KeySiteImgs } from './key-site/keysiteimgs.component';
import { KeyImgDetail } from './key-site/keyimgdetail.component';
@NgModule({
declarations: [UiComponent, CardComponent, StepperComponent, TabgroupComponent, ProgressComponent, SnackbarComponent,PersonaldataComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent,IsnoPipe,ConfirmpswDirective,DialogOverviewExampleDialog,CreateAuthority,CreateRole,EditRole,TimePipe,CreateNewUser,EditNewUser,allRoles,SharePower,CreateOrganization,EditOrganization,seeInformation,EditUser,editorialUnit,FireProtectionElementsComponent,Establish,EditingFireControl,FireFightingTemplateComponent, NavmenusComponent,CreateMenus,EditMenus,NewFireFighting,EditFireClassification, MaterialBankComponent, UnitInformationComponent,AddMatLibrary,EditMatLibrary,attributeComponent,AddOriginalCopy,addAttributeComponent,editAttribute,EditOriginalCopy,SelectOriginalCopy,EditUnitInfo,AddUnitInfo,AddGroups,EditGroup, BasicinfoComponent, PlanComponent, AllaroundComponent, FireFightingDeviceComponent, KeySiteComponent, FunctionDivisionComponent, RealisticPictureComponent, UploadingCADComponent,AddHouseInfo,ImgDetails],
declarations: [UiComponent, CardComponent, StepperComponent, TabgroupComponent, ProgressComponent, SnackbarComponent,PersonaldataComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent,IsnoPipe,ConfirmpswDirective,DialogOverviewExampleDialog,CreateAuthority,CreateRole,EditRole,TimePipe,CreateNewUser,EditNewUser,allRoles,SharePower,CreateOrganization,EditOrganization,seeInformation,EditUser,editorialUnit,FireProtectionElementsComponent,Establish,EditingFireControl,FireFightingTemplateComponent, NavmenusComponent,CreateMenus,EditMenus,NewFireFighting,EditFireClassification, MaterialBankComponent, UnitInformationComponent,AddMatLibrary,EditMatLibrary,attributeComponent,AddOriginalCopy,addAttributeComponent,editAttribute,EditOriginalCopy,SelectOriginalCopy,EditUnitInfo,AddUnitInfo,AddGroups,EditGroup, BasicinfoComponent, PlanComponent, AllaroundComponent, FireFightingDeviceComponent, KeySiteComponent, FunctionDivisionComponent, RealisticPictureComponent, UploadingCADComponent,AddHouseInfo,ImgDetails,ImagesData,ImgsDataDetail,KeySiteImgs,KeyImgDetail],
imports: [
CommonModule,

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

@ -1 +0,0 @@
<p>uploading-cad works!</p>

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

@ -1,5 +1,4 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-uploading-cad',
templateUrl: './uploading-cad.component.html',
@ -10,6 +9,8 @@ export class UploadingCADComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

13
src/assets/swiper.min.css vendored

File diff suppressed because one or more lines are too long

14
src/assets/swiper.min.js vendored

File diff suppressed because one or more lines are too long

2
src/index.html

@ -7,10 +7,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="./assets/swiper.min.css">
</head>
<body>
<app-root></app-root>
</body>
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=04743eb4bbbdf60376851bb776c3dcdc"></script>
<script type="text/javascript" src="./assets/swiper.min.js"></script>
</html>

Loading…
Cancel
Save