陈鹏飞 5 years ago
parent
commit
edb2477116
  1. 26
      src/app/ui/allaround/allaround.component.scss
  2. 2
      src/app/ui/allaround/allaround.component.ts
  3. 14
      src/app/ui/allaround/imgdetails.component.html
  4. 57
      src/app/ui/allaround/imgdetails.component.ts
  5. 5
      src/app/ui/basicinfo/basicinfo.component.html
  6. 5
      src/app/ui/basicinfo/basicinfo.component.scss
  7. 222
      src/app/ui/basicinfo/basicinfo.component.ts
  8. 14
      src/app/ui/fire-fighting-device/fire-fighting-device.component.html
  9. 21
      src/app/ui/fire-fighting-device/fire-fighting-device.component.scss
  10. 23
      src/app/ui/fire-fighting-device/fire-fighting-device.component.ts
  11. 10
      src/app/ui/fire-fighting-device/imgsdatadetail.component.html
  12. 47
      src/app/ui/fire-fighting-device/imgsdatadetail.component.ts
  13. 21
      src/app/ui/key-site/key-site.component.scss
  14. 11
      src/app/ui/key-site/keyimgdetail.component.html
  15. 48
      src/app/ui/key-site/keyimgdetail.component.ts
  16. 7
      src/app/ui/key-site/keysiteimgs.component.html
  17. 18
      src/app/ui/key-site/keysiteimgs.component.ts
  18. 1
      src/app/ui/uploading-cad/uploading-cad.component.html
  19. 9
      src/app/ui/uploading-cad/uploading-cad.component.scss
  20. 7
      src/app/ui/uploading-cad/uploading-cad.component.ts
  21. 2
      src/app/ui/usermanagement/usermanagement.component.ts

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

@ -1,8 +1,9 @@
.tabbar{
height: 60px;
background: yellow;
// background: yellow;
line-height: 60px;
margin-bottom: 20px;
border-bottom: 1px solid black;;
}
.aroundimagebox{
height: 100%;
@ -10,17 +11,14 @@
.aroundimage{
width:97%;
height: 80%;
background-color: skyblue;
// background-color: skyblue;
overflow: auto;
margin: 0 30px;
border: 6px solid #cccccc;
.imgitem{
position: relative;
float: left;
margin-bottom: 70px;
margin-right: 10px;
margin-top: 60px;
margin: 60px 10px 70px 98px;
img{
width: 299px;
height: 169px;
@ -64,9 +62,11 @@
width: 1500px;
height: 700px;
text-align: center;
line-height: 700px;
img{
height: 100%;
width: 1280px;
// width: 1280px;
}
.img1{
transform:rotate(90deg) scale(0.55);
@ -80,6 +80,18 @@
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{

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

@ -13,7 +13,7 @@ import { ImgDetails } from './imgdetails.component'
styleUrls: ['./allaround.component.scss']
})
export class AllaroundComponent implements OnInit {
yyy=false
constructor(private http: HttpClient,public dialog: MatDialog) { }
defaultimg = "../../../assets/images/upload.jpg"
xxx = [1,2,3,4,5,6,7,8]

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

@ -1,17 +1,19 @@
<div class="imgdialog">
<div mat-dialog-title class="imagestitle ">图片详情</div>
<!-- <div class="swiper-container swiper-no-swiping"> -->
<div class="swiper-container">
<div class="swiper-container swiper-no-swiping">
<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 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 class="swiper-button-prev" (click)="defaultrotateA($event)"></div>
<div class="swiper-button-next" (click)="defaultrotateA($event)"></div>
</div>

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

@ -1,4 +1,4 @@
import { Component, OnInit, Inject } from '@angular/core';
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';
@ -20,8 +20,11 @@ import Swiper from 'swiper';
onNoClick(): void {
this.dialogRef.close();
}
defaultavtimgindex:any
avtimgindex:any//当前轮播图显示的下标
isheng:any
ngOnInit(): void {
setTimeout(() => {
var mySwiper:any = new Swiper ('.swiper-container', {
initialSlide :2,
// 如果需要前进后退按钮
@ -30,23 +33,65 @@ import Swiper from 'swiper';
prevEl: '.swiper-button-prev',
}
})
// mySwiper.slideTo(2,0);
},1);
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
}
defaultrotateA(){
}
}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){
}

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

@ -80,9 +80,8 @@
<div class="uploadingimg">
<img [src]="imgsrc" alt="" style="width: 299px; height: 170px;" >
</div>
<mat-spinner *ngIf="isspinner"></mat-spinner>
<!-- <mat-progress-bar mode="determinate" [value]="p" *ngIf="p == 0 || p ==100"></mat-progress-bar> -->
</div>
<div class="image" (click)="closeorganizationbox()">

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

@ -146,4 +146,7 @@
margin: 0 8px;
}
}
.mat-spinner{
margin-top: 34px;
margin-left: 178px;
}

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

@ -1,20 +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 { HttpClient,HttpHeaders, HttpEventType } 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 { TreeService } from '../../http-interceptors/tree.service'
import { FileUploader } from 'ng2-file-upload'
import { FileUploader, FileItem } from 'ng2-file-upload'
import { House } from '../../interface'
import { AddHouseInfo } from './addhouseinfo.component'
import { DomSanitizer } from '@angular/platform-browser'
interface newHouse extends House{
gaoceng?:boolean
huo?:boolean
lei?:boolean
import { Injectable } from "@angular/core"
import { filter } from 'rxjs/operators';
import { async } from '@angular/core/testing';
export interface UploadResult {
name: string;
type: string;
size: number;
url: string;
}
@Component({
selector: 'app-basicinfo',
@ -22,11 +26,18 @@ interface newHouse extends House{
styleUrls: ['./basicinfo.component.scss']
})
export class BasicinfoComponent implements OnInit {
xxxx: any
blockdata: any//将每次的分块数据存储到这个变量
blockdataindex: any//将每次的分块数据的编号存储到这个变量
kkkk: any
initializedata: any //初始化分块事件返回的对象名以及唯一id
uploader:FileUploader = new FileUploader({
url: "/api/Objects/PlanPlatform",
method: "POST",
itemAlias: "uploadedfile"
});
private _transformer = (node, level: number) => {
return {
expandable: !!node.children && node.children.length > 0,
@ -68,9 +79,22 @@ export class BasicinfoComponent implements OnInit {
//选择单位类型,使底下表单跟着变化
newHouses = []
ngOnInit(): void {
this.getallunittype()
this.getorganization()
// this.getallunittype()
// this.getorganization()
this.inithosue()
async function testAsync() {
return "hello ddddddddddddddddd";
}
const result = testAsync();
console.log(1111,result);
testAsync().then(()=>{
setTimeout(()=>{
console.log(2222)
},3000)
console.log(3333)
})
}
//初始化建筑信息数组
inithosue() {
@ -121,23 +145,23 @@ export class BasicinfoComponent implements OnInit {
}
selecttab(node) {
console.log(1111,node)
}
//获得所有单位类型
getallunittype(){
this.http.get("/api/BuildingTypes").subscribe(data=>{
this.allunittype = data
})
}
// getallunittype() {
// this.http.get("/api/BuildingTypes").subscribe(data => {
// this.allunittype = data
// })
// }
//获得所有组织机构
getorganization(){
this.http.get('/api/Organizations').subscribe(
(data:any)=>{
this.dataSource.data = this.tree.toTree(data);
}
)
}
// getorganization() {
// this.http.get('/api/Organizations').subscribe(
// (data: any) => {
// this.dataSource.data = this.tree.toTree(data);
// }
// )
// }
add(node) {
@ -154,80 +178,164 @@ export class BasicinfoComponent implements OnInit {
this.isorganizationbox = true
}
hasChild = (_: number, node: any) => node.expandable;
filechange(e){
const file = e.srcElement.files[0]; // 获取图片这里只操作一张图片
var upfilesize = file.size/1048576 //上传照片大小MB
if(upfilesize <= 5){//如果想要上传照片小于5MB,则走正常上传流程
this.upload()
}
// filechange(e){
// const file = e.srcElement.files[0]; // 获取图片这里只操作一张图片
// var upfilesize = file.size/1048576 //上传照片大小MB
// if(upfilesize <= 5){//如果想要上传照片小于5MB,则走正常上传流程
// this.upload()
// }
// if(upfilesize > 5 && upfilesize <= 20){//如果想要上传照片在5-20之间则采用分块上传
// var bytesPerPiece = 1024 * 1024 * 5;// 每个文件切片大小定为 5 Mb
// var blob = e.srcElement.files[0];//想要上传的整体文件
// var start = 0;
// var end;
// var index = 1;
// var filesize = blob.size;//上传文件的大小
// var filename = blob.name;//上传文件 原始名字
// this.http.post("/api/NewMultipartUpload/PlanPlatform/ceshi",{},{
// params: {
// filename:filename,
// }
// }).subscribe((data:any)=>{
// this.initializedata = data
// var totalPieces;//一共有多少块
// totalPieces = Math.ceil(filesize / bytesPerPiece);//------计算需要分为多少段
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()
// var sliceIndex= index;//分块编号
// this.blockdataindex = sliceIndex
// this.blockdata = chunk
// this.blockdata.name = filename
// this.uploader.setOptions({ url:`/api/MultipartUpload/PlanPlatform/${this.initializedata.objectName}?uploadId=${this.initializedata.uploadId}&partNumber=${this.blockdataindex}`});
// this.upload()
// start = end;
// index++;
// }
// this.blockupload()
}
// })
if(upfilesize > 20){//如果想要上传照片大于20MB
alert("上传照片应小于20MB")
}
// }
// if(upfilesize > 20){//如果想要上传照片大于20MB
// alert("上传照片应小于20MB")
// }
// }
}
imgsrc = "../../../assets/images/upload.jpg"
imgUrl = ""//返回来的图片地址后缀
file: any; //上传的文件
objectName: any; //上传对象名
uploadId: any; //上传分块上传事件编号
//change选择文件
filechange(e) {
this.file = e.target.files[0] || null //上传的文件
this.startUploading()
}
isspinner:boolean=false
//上传文件
startUploading() {
this.isspinner = true
let file = this.file || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB一个分片
if (file && fileSize <= shardSize) { //上传文件<=5MB时
this.upload()
} else if (file && fileSize >= shardSize) { //上传文件>5MB时,分块上传
let data = { filename: file.name }
this.http.post(`/api/NewMultipartUpload/PlanPlatform/HHH`, {}, { params: data }).subscribe((data: any) => { //初始化分段上传
this.objectName = data.objectName
this.uploadId = data.uploadId
this.subsectionUploading()
})
}
}
//小于5MB不需要分块上传
upload(){
if(!this.uploader.queue[0]){
alert("请选择文件")
}else{
this.uploader.queue[0].upload();//开始上传
this.uploader.queue[0].onSuccess = (response, status, headers) => {
// 上传文件成功
if (status == 201) {
// 上传文件后获取服务器返回的数据
alert("上传成功")
this.isspinner = false
let tempRes = JSON.parse(response);
this.imgUrl = tempRes.objectName
this.imgsrc = '/api/Objects/PlanPlatform/' + this.imgUrl
this.imgsrc = `/api/Objects/PlanPlatform/${this.imgUrl}?x-oss-process=image/resize,m_fill,h_100,w_100`
}else {
// 上传文件后获取服务器返回的数据错误
}
};
this.uploader.queue[0].onError = (response, status, headers) => {
if (status == 401) {
alert("无权限上传")
alert("上传失败")
}
};
}
}
PartNumberETag: any = []; //分块上传每次返回需要保存的信息
flag = true
//开始分块上传
async subsectionUploading () {
let file = this.file || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB一个分片
let allSlice = Math.ceil(fileSize / shardSize) //总文件/5MB===共分多少段
blockupload(){//分块上传
for (let i = 0;i < allSlice;i++) { //循环分段上传
let start = i * shardSize //切割文件开始位置
let end = Math.min(fileSize, start + shardSize); //切割文件结束位置
let formData = new FormData()
formData.append("file",file.slice(start, end))
// 同步写法实现异步调用
let result = await new Promise((resolve, reject) => {
// await 需要后面返回一个 promise 对象
this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i+1}`,formData).subscribe((data:any)=>{
let msg = {
"partNumber":data.partNumber || null,
"eTag": data.eTag || null
}
resolve(msg) // 调用 promise 内置方法处理成功
})
});
this.PartNumberETag.push(result)
if (this.PartNumberETag.length === allSlice) {
this.endUploading()
}
}
}
//完成分块上传
endUploading() {
let data = this.PartNumberETag
let paramsData = { uploadId: this.uploadId }
this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`, data, { params: paramsData }).subscribe(data => {
this.imgsrc = `/api/Objects/PlanPlatform/${this.objectName}?x-oss-process=image/resize,m_fill,h_100,w_100`
this.isspinner = false
this.PartNumberETag = []
this.file = null
})
}
onSubmit(value) {

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

@ -29,7 +29,8 @@
</table>
</div>
<div class="tablebox">
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
<div class="imagestitle">安全疏散设施</div>
<table mat-table [dataSource]="dataSource2" class="mat-elevation-z8">
<ng-container matColumnDef="project">
<th mat-header-cell *matHeaderCellDef>项目</th>
@ -38,12 +39,12 @@
<ng-container matColumnDef="phone">
<th mat-header-cell *matHeaderCellDef>照片</th>
<td mat-cell *matCellDef="let element">{{element.realName}}</td>
<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.organizationName}}</td>
<td mat-cell *matCellDef="let element">{{element.main}}</td>
</ng-container>
@ -52,7 +53,8 @@
</table>
</div>
<div class="tablebox">
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
<div class="imagestitle">消防水系统</div>
<table mat-table [dataSource]="dataSource3" class="mat-elevation-z8">
<ng-container matColumnDef="project" >
<th mat-header-cell *matHeaderCellDef>项目</th>
@ -61,12 +63,12 @@
<ng-container matColumnDef="phone">
<th mat-header-cell *matHeaderCellDef>照片</th>
<td mat-cell *matCellDef="let element">查看照片</td>
<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.organizationName}}</td>
<td mat-cell *matCellDef="let element">{{element.main}}</td>
</ng-container>

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

@ -1,8 +1,9 @@
.tabbar{
height: 60px;
background: yellow;
// background: yellow;
line-height: 60px;
margin-bottom: 20px;
border-bottom: 1px solid black;;
}
.devicebox{
height: 100%;
@ -10,7 +11,7 @@
.device{
width:96%;
height: 80%;
background-color: skyblue;
// background-color: skyblue;
overflow: auto;
margin: 0 30px;
border: 6px solid #cccccc;
@ -155,9 +156,11 @@
width: 1500px;
height: 700px;
text-align: center;
line-height: 700px;
img{
height: 100%;
width: 1280px;
// width: 1280px;
}
.img1{
transform:rotate(90deg) scale(0.55);
@ -171,6 +174,18 @@
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{

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

@ -16,9 +16,28 @@ export class FireFightingDeviceComponent implements OnInit {
constructor(public http: HttpClient,public dialog: MatDialog) { }
displayedColumns: string[] = ['project', 'phone', 'mainmsg'];
dataSource:any; //所有用户
dataSource:any;
dataSource2:any;
dataSource3:any;
ngOnInit(): void {
this.dataSource = [{name:"xxx",main:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}]
this.dataSource = [
{name:"消防水池",main:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
]
this.dataSource2 = [
{name:"疏散楼梯",main:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"},
{name:"消防电梯",main:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"},
{name:"避难设施",main:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"},
{name:"安全出口",main:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
]
this.dataSource3 = [
{name:"室外消火栓",main:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"},
{name:"室内消火栓",main:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"},
{name:"供水管网",main:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"},
{name:"湿式自动喷淋系统",main:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"},
{name:"水幕系统",main:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"},
{name:"消防泵房",main:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"},
{name:"水泵接合器",main:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
]
}
lookphone(){
const dialogRef = this.dialog.open(ImagesData, {//调用open方法打开对话框并且携带参数过去

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

@ -1,11 +1,13 @@
<div class="imgdialog">
<div mat-dialog-title class="imagestitle ">图片详情</div>
<!-- <div class="swiper-container swiper-no-swiping"> -->
<div class="swiper-container">
<div class="swiper-container swiper-no-swiping">
<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 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>

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

@ -20,6 +20,9 @@ import Swiper from 'swiper';
onNoClick(): void {
this.dialogRef.close();
}
defaultavtimgindex:any
avtimgindex:any//当前轮播图显示的下标
isheng:any
ngOnInit(): void {
setTimeout(() => {
var mySwiper:any = new Swiper ('.swiper-container', {
@ -30,19 +33,61 @@ import Swiper from 'swiper';
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

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

@ -1,8 +1,9 @@
.tabbar{
height: 60px;
background: yellow;
// background: yellow;
line-height: 60px;
margin-bottom: 20px;
border-bottom: 1px solid black;;
}
.devicebox{
height: 100%;
@ -10,7 +11,7 @@
.device{
width:96%;
height: 80%;
background-color: skyblue;
// background-color: skyblue;
overflow: auto;
margin: 0 30px;
border: 6px solid #cccccc;
@ -177,9 +178,11 @@
width: 1500px;
height: 700px;
text-align: center;
line-height: 700px;
img{
height: 100%;
width: 1280px;
// width: 1280px;
}
.img1{
transform:rotate(90deg) scale(0.55);
@ -193,6 +196,18 @@
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{

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

@ -1,14 +1,15 @@
<div class="imgdialog">
<div mat-dialog-title class="imagestitle">图片详情</div>
<!-- <div class="swiper-container swiper-no-swiping"> -->
<div class="swiper-container">
<div class="swiper-container swiper-no-swiping">
<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 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>

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

@ -20,6 +20,9 @@ import Swiper from 'swiper';
onNoClick(): void {
this.dialogRef.close();
}
defaultavtimgindex:any
avtimgindex:any//当前轮播图显示的下标
isheng:any
ngOnInit(): void {
setTimeout(() => {
var mySwiper:any = new Swiper ('.swiper-container', {
@ -30,19 +33,60 @@ import Swiper from 'swiper';
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

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

@ -8,6 +8,13 @@
<p>建筑物图片</p>
</div>
</div>
<mat-paginator
[length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="yyy()">
</mat-paginator>
</div>
</div>

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

@ -1,4 +1,4 @@
import { Component, OnInit, Inject } from '@angular/core';
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';
@ -6,6 +6,8 @@ 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';
@Component({
selector: 'keysiteimgs',
templateUrl: './keysiteimgs.component.html',
@ -16,13 +18,23 @@ import { KeyImgDetail } from './keyimgdetail.component'
//注入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]
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(){

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

@ -4,6 +4,7 @@
<button mat-raised-button color="primary">下载</button>
<button mat-raised-button color="primary">删除</button>
</div>
<input required id="selectedfile" type="file" ng2FileSelect [uploader]="uploader" (change)="filechange($event)" name="CADFile">
<div>
<span>已用/容量:</span>
<span style="color: red;"> 500MB/5G </span>

9
src/app/ui/uploading-cad/uploading-cad.component.scss

@ -3,6 +3,15 @@
margin: 10px;
:first-child{flex:88%}
:last-child{flex:12%}
position: relative;
#selectedfile{
width: 64px;
height: 34px;
position: absolute;
left: 15px;
opacity: 0;
}
.mat-raised-button {
margin-left: 15px;
}

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

@ -18,7 +18,12 @@ export class UploadingCADComponent implements OnInit {
displayedColumns: string[] = ['checked', 'name', 'time', 'state','size'];
dataSource:any; //所有CAD图
//选择文件
filechange(e){
}
//上传文件
uploader(){
}
}

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

@ -14,7 +14,7 @@ import { PageEvent } from '@angular/material/paginator';
export class UsermanagementComponent implements OnInit {
constructor(public http: HttpClient,public dialog: MatDialog) { }
pageEvent: PageEvent;
ViewChild: PageEvent;
ngOnInit() {
this.getUsers()

Loading…
Cancel
Save