Browse Source

[完善]完善重点部位查看图片

master
邵佳豪 4 years ago
parent
commit
4698be63a8
  1. 10
      src/app/key-unit/key-site/key-site.component.html
  2. 23
      src/app/key-unit/key-site/key-site.component.scss
  3. 17
      src/app/key-unit/key-site/key-site.component.ts

10
src/app/key-unit/key-site/key-site.component.html

@ -96,11 +96,11 @@
</ng-container> </ng-container>
<ng-container matColumnDef="img"> <ng-container matColumnDef="img">
<th mat-header-cell *matHeaderCellDef>图片</th> <th mat-header-cell *matHeaderCellDef>图片</th>
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element;let x = index">
<a href="javascript:void(0);" (click)='seeImg(element.imageUrls,key)' style="color: blue;">查看图片</a> <a href="javascript:void(0);" style="color: blue;" (click)='seeImg(element.imageUrls)'>查看图片</a>
<div id="viewerjs{{key}}" style="display: none;" > <!-- <div id="viewerjs{{key}}" style="display: none;" >
<img *ngFor="let i of element.imageUrls" [src]="i" alt=""(click)="xxx()"> <img *ngFor="let i of element.imageUrls" [src]="i" alt="">
</div> </div> -->
</td> </td>
</ng-container> </ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>

23
src/app/key-unit/key-site/key-site.component.scss

@ -42,8 +42,8 @@ table {
.rotateC {transform: rotate(270deg) scale(0.75);} .rotateC {transform: rotate(270deg) scale(0.75);}
//预览图片 //预览图片
.previewImgBox { .previewImgBox {
width: 800px; width: 6.835938rem;
height: 650px; height: 5.566406rem;
text-align: center; text-align: center;
img{ img{
width: auto; width: auto;
@ -51,12 +51,13 @@ table {
max-width: 100%; max-width: 100%;
max-height: 100%;} max-height: 100%;}
} }
.previewImgBottom { .previewImgBottom {
text-align: center; text-align: center;
height: 30px; height: 30px;
margin: 20px auto; margin: 20px auto;
} }
.imgdialog{ .imgdialog{
width: 800px; width: 6.835938rem;
height: 650px; height: 5.859375rem;
} overflow-y: auto;
}

17
src/app/key-unit/key-site/key-site.component.ts

@ -148,16 +148,15 @@ export class KeySiteComponent implements OnInit {
} }
//查看图片 //查看图片
seeImg (e,key) { seeImg (e) {
if (e.length) { if (e.length) {
// let data = e let data = e
// const dialogRef = this.dialog.open(KeySiteImgs, {//调用open方法打开对话框并且携带参数过去 const dialogRef = this.dialog.open(KeySiteImgs, {//调用open方法打开对话框并且携带参数过去
// width: '820px', data});
// height:'670px',data}); dialogRef.afterClosed().subscribe();
// dialogRef.afterClosed().subscribe(); // var image = new Viewer(document.getElementById(`viewerjs${key}`),{
var image = new Viewer(document.getElementById(`viewerjs${key}`),{ // url: 'data-original'
url: 'data-original' // });
});
// document.getElementById('viewerjs').click(); // document.getElementById('viewerjs').click();
this.xxx() this.xxx()
} else { } else {

Loading…
Cancel
Save