Jelajahi Sumber

修改文件图标

dusenyao 1 tahun lalu
induk
melakukan
9265926340
10 mengubah file dengan 13 tambahan dan 0 penghapusan
  1. TEMPAT SAMPAH
      src/assets/file/audio.png
  2. TEMPAT SAMPAH
      src/assets/file/execl-bc.png
  3. TEMPAT SAMPAH
      src/assets/file/pdf-bc.png
  4. TEMPAT SAMPAH
      src/assets/file/picture.png
  5. TEMPAT SAMPAH
      src/assets/file/ppt-bc.png
  6. TEMPAT SAMPAH
      src/assets/file/txt-bc.png
  7. TEMPAT SAMPAH
      src/assets/file/video.png
  8. TEMPAT SAMPAH
      src/assets/file/word-bc.png
  9. TEMPAT SAMPAH
      src/assets/file/zip.png
  10. 13 0
      src/utils/file.js

TEMPAT SAMPAH
src/assets/file/audio.png


TEMPAT SAMPAH
src/assets/file/execl-bc.png


TEMPAT SAMPAH
src/assets/file/pdf-bc.png


TEMPAT SAMPAH
src/assets/file/picture.png


TEMPAT SAMPAH
src/assets/file/ppt-bc.png


TEMPAT SAMPAH
src/assets/file/txt-bc.png


TEMPAT SAMPAH
src/assets/file/video.png


TEMPAT SAMPAH
src/assets/file/word-bc.png


TEMPAT SAMPAH
src/assets/file/zip.png


+ 13 - 0
src/utils/file.js

@@ -180,4 +180,17 @@ export function getFileImage(type) {
   if (/^docx?$/.test(type)) {
     return require('@/assets/file/word-bc.png');
   }
+  if (['mp3', 'wav', 'aac', 'ape', 'ogg'].includes(type)) {
+    return require('@/assets/file/audio.png');
+  }
+  if (['mp4', 'flv', 'webm', 'mpeg', 'mpg'].includes(type)) {
+    return require('@/assets/file/video.png');
+  }
+  if (['zip', 'rar', '7z'].includes(type)) {
+    return require('@/assets/file/zip.png');
+  }
+  if (['webp', 'jpg', 'jpeg', 'gif', 'png', 'tif'].includes(type)) {
+    return require('@/assets/file/picture.png');
+  }
+  return require('@/assets/file/word-bc.png');
 }