+
diff --git a/src/app/ui/fire-fighting-device/imgsdatadetail.component.ts b/src/app/ui/fire-fighting-device/imgsdatadetail.component.ts
index d616a07..2f901d8 100644
--- a/src/app/ui/fire-fighting-device/imgsdatadetail.component.ts
+++ b/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(){
- this.rotateA += 90
- if(this.rotateA == 360){
- this.rotateA = 0
+ 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
diff --git a/src/app/ui/key-site/key-site.component.scss b/src/app/ui/key-site/key-site.component.scss
index 6c86ed3..2bce7a2 100644
--- a/src/app/ui/key-site/key-site.component.scss
+++ b/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{
diff --git a/src/app/ui/key-site/keyimgdetail.component.html b/src/app/ui/key-site/keyimgdetail.component.html
index 52a4a47..f040b7a 100644
--- a/src/app/ui/key-site/keyimgdetail.component.html
+++ b/src/app/ui/key-site/keyimgdetail.component.html
@@ -1,13 +1,14 @@
图片详情
-
+
-
diff --git a/src/app/ui/key-site/keyimgdetail.component.ts b/src/app/ui/key-site/keyimgdetail.component.ts
index 8fdba37..5aaa734 100644
--- a/src/app/ui/key-site/keyimgdetail.component.ts
+++ b/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(){
- this.rotateA += 90
- if(this.rotateA == 360){
- this.rotateA = 0
+ 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
diff --git a/src/app/ui/key-site/keysiteimgs.component.html b/src/app/ui/key-site/keysiteimgs.component.html
index 1315938..96de3bf 100644
--- a/src/app/ui/key-site/keysiteimgs.component.html
+++ b/src/app/ui/key-site/keysiteimgs.component.html
@@ -8,6 +8,13 @@
建筑物图片
+
+
+
diff --git a/src/app/ui/key-site/keysiteimgs.component.ts b/src/app/ui/key-site/keysiteimgs.component.ts
index eb42d67..c99d6ba 100644
--- a/src/app/ui/key-site/keysiteimgs.component.ts
+++ b/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
,@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(){
diff --git a/src/app/ui/uploading-cad/uploading-cad.component.html b/src/app/ui/uploading-cad/uploading-cad.component.html
index c19ea56..3adccb5 100644
--- a/src/app/ui/uploading-cad/uploading-cad.component.html
+++ b/src/app/ui/uploading-cad/uploading-cad.component.html
@@ -4,6 +4,7 @@