2 İşlemeler a1e56d9619 ... 55b484caa6

Yazar SHA1 Mesaj Tarih
  warrior 55b484caa6 Merge branch 'master' of http://git.fmode.cn:3000/bin/edu-textbook 2 hafta önce
  warrior 1c0c9abb4d 优化上传后展示文件 2 hafta önce

+ 8 - 7
projects/textbook/src/app/comp-upload/comp-upload.component.ts

@@ -145,14 +145,15 @@ export class CompUploadComponent implements OnInit {
   }
   /**预览图片 */
   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 {
-      this.nzImageService.preview([{ src: file }], { nzZoom: 1, nzRotate: 0 });
+      this.nzImageService.preview([{ src: url }], { nzZoom: 1, nzRotate: 0 });
     }
   };
 }