|
@@ -145,14 +145,15 @@ export class CompUploadComponent implements OnInit {
|
|
}
|
|
}
|
|
/**预览图片 */
|
|
/**预览图片 */
|
|
preview = async (e: any): Promise<void> => {
|
|
preview = async (e: any): Promise<void> => {
|
|
- let index = this.Previewfilelist.findIndex(
|
|
|
|
- (item: any) => item.uid == e.uid
|
|
|
|
- );
|
|
|
|
- let file = this.Previewfilelist[index]?.url;
|
|
|
|
- if (!/\.(jpg|jpeg|png|GIF|JPG|PNG)$/.test(file)) {
|
|
|
|
- window.open(file);
|
|
|
|
|
|
+ // let index = this.Previewfilelist.findIndex(
|
|
|
|
+ // (item: any) => item.url == e.url
|
|
|
|
+ // );
|
|
|
|
+ // let file = this.Previewfilelist[index]?.url;
|
|
|
|
+ let url = e?.url
|
|
|
|
+ if (!/\.(jpg|jpeg|png|GIF|JPG|PNG)$/.test(url)) {
|
|
|
|
+ window.open(url);
|
|
} else {
|
|
} else {
|
|
- this.nzImageService.preview([{ src: file }], { nzZoom: 1, nzRotate: 0 });
|
|
|
|
|
|
+ this.nzImageService.preview([{ src: url }], { nzZoom: 1, nzRotate: 0 });
|
|
}
|
|
}
|
|
};
|
|
};
|
|
}
|
|
}
|