This commit is contained in:
潘晓云
2022-04-29 14:18:46 +08:00
parent f83ab482a8
commit b213aa4f91
7 changed files with 283 additions and 219 deletions

View File

@ -1,5 +1,5 @@
<!--
* @Description :
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-03-23 14:24:05
@ -11,10 +11,10 @@
<div class="imgBox">
<ng-container *ngFor="let item of imgList; let i = index">
<ng-container *ngIf="item;">
<img nz-image [nzSrc]="item" />
<img [style]="style" nz-image [nzSrc]="item" />
</ng-container>
<ng-template #elseTemplate>
<div style="background-color: darkgrey;border-radius: 5px;width: 200px;height: 160px;" class="mr-sm"></div>
<div style="background-color: darkgrey;border-radius: 5px;width: 120px;height: 120px;" class="mr-sm"></div>
</ng-template>
</ng-container>
</div>
</div>

View File

@ -19,15 +19,16 @@ import { ImageViewComponent } from './imageview/imageview.component';
})
export class ImageListComponent implements OnInit {
@Input() imgList: any = [];
@Input() style = '';
constructor(
private modal: ModalHelper,
public msgSrv: NzMessageService,
public http: _HttpClient,
private nzImageService: NzImageService
) {}
) { }
ngOnInit(): void {
this.style = this.style || '';
}
showImg(index: any) {
const params = {
@ -35,7 +36,7 @@ export class ImageListComponent implements OnInit {
index
};
const images = this.imgList.map((url: string) => {
if(url) {
if (url) {
console.log(url);
({ src: url })
}