Procházet zdrojové kódy

Merge branch 'master' of http://git.fmode.cn:3000/bin/edu-textbook

ryanemax před 2 měsíci
rodič
revize
d86a62106c

+ 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 });
     }
   };
 }