Files
bbq/src/app/shared/components/imagelist/imagelist.component.ts
Taric Xin ab6f1c6865 edit
2022-03-02 14:30:37 +08:00

40 lines
1.3 KiB
TypeScript

/*
* @Author: your name
* @Date: 2021-12-09 17:36:13
* @LastEditTime: 2021-12-10 14:12:24
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\shared\components\imagelist\imagelist.component.ts
*/
import { Component, Input, OnInit } from '@angular/core';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { NzImageService } from 'ng-zorro-antd/image';
import { NzMessageService } from 'ng-zorro-antd/message';
import { ImageViewComponent } from './imageview/imageview.component';
@Component({
selector: 'app-imagelist',
templateUrl: './imagelist.component.html',
styleUrls: ['./imagelist.less']
})
export class ImageListComponent implements OnInit {
@Input() imgList: any = [];
constructor(
private modal: ModalHelper,
public msgSrv: NzMessageService,
public http: _HttpClient,
private nzImageService: NzImageService
) {}
ngOnInit(): void {}
showImg(index: any) {
const params = {
imgList: this.imgList,
index
};
const images = this.imgList.map((url: string) => ({ src: url }));
this.nzImageService.preview(images);
// this.modal.create(ImageViewComponent, { params }).subscribe(res => {});
}
}