19 changed files with 498 additions and 177 deletions
@ -1,26 +0,0 @@ |
|||||||
<div mat-dialog-title>单位照片</div> |
|
||||||
<div> |
|
||||||
<div> |
|
||||||
<ng-container *ngIf="isshowimg; else elseTemplate"> |
|
||||||
<div class="imgbox"> |
|
||||||
<img class="imgitemdefault" [src]="ImgUrl"> |
|
||||||
<!-- <img class="imgitemdefault" [src]="ImgUrl" [ngClass]="{'img1': rotateA==90,'img2': rotateA==180,'img3': rotateA==270,'img4': rotateB==10,'img5': rotateB==20,'img6': rotateB==30}" > --> |
|
||||||
</div> |
|
||||||
</ng-container> |
|
||||||
<ng-template #elseTemplate > |
|
||||||
<p style="text-align: center;">暂无单位图片,请先上传</p> |
|
||||||
</ng-template> |
|
||||||
</div> |
|
||||||
|
|
||||||
|
|
||||||
</div> |
|
||||||
<!-- |
|
||||||
<div class="swiper-button-prev"></div> |
|
||||||
<div class="swiper-button-next"></div> --> |
|
||||||
|
|
||||||
|
|
||||||
<!-- <div class="previewImgBottom"> |
|
||||||
<button type="button" mat-icon-button (click)='rotate()'><mat-icon>refresh</mat-icon></button> |
|
||||||
</div> --> |
|
||||||
|
|
||||||
|
|
@ -1,66 +0,0 @@ |
|||||||
import { Component, OnInit, Inject } from '@angular/core'; |
|
||||||
import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; |
|
||||||
import {FlatTreeControl} from '@angular/cdk/tree'; |
|
||||||
import { HttpClient } from '@angular/common/http'; |
|
||||||
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; |
|
||||||
import {FormControl} from '@angular/forms'; |
|
||||||
import { MatSnackBar } from '@angular/material/snack-bar'; |
|
||||||
|
|
||||||
@Component({ |
|
||||||
selector: 'lookmaster', |
|
||||||
templateUrl: './lookmaster.component.html', |
|
||||||
styleUrls: ['./basicinfo.component.scss'] |
|
||||||
}) |
|
||||||
export class LookMaster2 { |
|
||||||
// myControl = new FormControl();
|
|
||||||
//注入MatDialogRef,可以用来关闭对话框
|
|
||||||
//要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌
|
|
||||||
constructor(private http: HttpClient,public dialogRef: MatDialogRef<LookMaster2>,@Inject(MAT_DIALOG_DATA) public data) {} |
|
||||||
allunittype:any |
|
||||||
ImgUrl:string |
|
||||||
rotationAngle=0 |
|
||||||
isheng:any |
|
||||||
isshowimg:boolean |
|
||||||
onNoClick(): void { |
|
||||||
this.dialogRef.close(); |
|
||||||
} |
|
||||||
ngOnInit(): void { |
|
||||||
if(this.data.img.indexOf('?') == -1){ |
|
||||||
this.isshowimg = false |
|
||||||
}else{ |
|
||||||
this.isshowimg = true |
|
||||||
var imgurl = this.data.img.split("?") |
|
||||||
this.ImgUrl = imgurl[0] |
|
||||||
}
|
|
||||||
|
|
||||||
} |
|
||||||
//点击旋转按钮时
|
|
||||||
rotateA = 0 |
|
||||||
rotateB = 0 |
|
||||||
rotate(){ |
|
||||||
var w= document.getElementsByClassName("imgitemdefault")[0]['naturalWidth']; |
|
||||||
var h = document.getElementsByClassName("imgitemdefault")[0]['naturalHeight']; |
|
||||||
|
|
||||||
if(w > h){ |
|
||||||
this.isheng = true |
|
||||||
}else{ |
|
||||||
this.isheng = false |
|
||||||
} |
|
||||||
if(this.isheng){ |
|
||||||
this.rotateA += 90 |
|
||||||
if(this.rotateA == 360){ |
|
||||||
this.rotateA = 0 |
|
||||||
} |
|
||||||
}else{ |
|
||||||
this.rotateB += 10 |
|
||||||
if(this.rotateB == 40){ |
|
||||||
this.rotateB = 0 |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} |
|
||||||
|
|
Loading…
Reference in new issue