From 4d90ba5f207252c5e29f1132df00bc175f816c41 Mon Sep 17 00:00:00 2001
From: sws <1141121512@qq.com>
Date: Fri, 16 Aug 2024 10:12:34 +0800
Subject: [PATCH] =?UTF-8?q?1.=E4=B8=8A=E4=BC=A0=E9=99=84=E4=BB=B6=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3=E8=81=94=E8=B0=83=20sws=202024-08-15?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/common/upload/index.ts | 54 +++++++++++++++++++
src/components/common/upload/index.vue | 53 +-----------------
src/components/common/upload/upload-model.vue | 35 +++++++++---
3 files changed, 83 insertions(+), 59 deletions(-)
create mode 100644 src/components/common/upload/index.ts
diff --git a/src/components/common/upload/index.ts b/src/components/common/upload/index.ts
new file mode 100644
index 00000000..7c819e06
--- /dev/null
+++ b/src/components/common/upload/index.ts
@@ -0,0 +1,54 @@
+// 文件后缀分类
+const ext_img_name_list = ref(['.png', '.jpg', '.jpeg', '.bmp', '.webp', '.gif']);
+const ext_video_name_list = ref(['.flv', '.swf', '.mkv', '.avi', '.rm', '.rmvb', '.mpeg', '.mpg', '.ogg', '.ogv', '.mov', '.wmv', '.mp4', '.webm']);
+const ext_file_name_list = ref(['.png', '.jpg', '.jpeg', '.bmp', '.webp', '.gif', '.flv', '.swf', '.mkv', '.avi', '.rm', '.rmvb', '.mpeg', '.mpg', '.ogg', '.ogv', '.mov', '.wmv', '.mp4', '.webm', '.mp3', '.csv', '.wav', '.mid', '.cab', '.iso', '.ofd', '.xml', '.rar', '.zip', '.tar', '.gz', '.7z', '.bz2', '.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.pdf', '.txt', '.md', '.vsd', '.sql']);
+const ext_file_name_list_map = ref([
+ { type: '.png', icon: 'error-img' },
+ { type: '.jpg', icon: 'error-img' },
+ { type: '.jpeg', icon: 'error-img' },
+ { type: '.bmp', icon: 'error-img' },
+ { type: '.webp', icon: 'error-img' },
+ { type: '.gif', icon: 'error-img' },
+ { type: '.flv', icon: 'video' },
+ { type: '.swf', icon: 'video' },
+ { type: '.mkv', icon: 'video' },
+ { type: '.avi', icon: 'video' },
+ { type: '.rm', icon: 'video' },
+ { type: '.rmvb', icon: 'video' },
+ { type: '.mpeg', icon: 'video' },
+ { type: '.mpg', icon: 'video' },
+ { type: '.ogg', icon: 'video' },
+ { type: '.ogv', icon: 'video' },
+ { type: '.mov', icon: 'video' },
+ { type: '.wmv', icon: 'video' },
+ { type: '.mp4', icon: 'video' },
+ { type: '.webm', icon: 'video' },
+ { type: '.mp3', icon: 'vf' },
+ { type: '.csv', icon: 'file' },
+ { type: '.wav', icon: 'file' },
+ { type: '.mid', icon: 'file' },
+ { type: '.cab', icon: 'file' },
+ { type: '.iso', icon: 'file' },
+ { type: '.ofd', icon: 'file' },
+ { type: '.xml', icon: 'file' },
+ { type: '.sql', icon: 'file' },
+ { type: '.rar', icon: 'zip' },
+ { type: '.zip', icon: 'zip' },
+ { type: '.tar', icon: 'zip' },
+ { type: '.gz', icon: 'zip' },
+ { type: '.7z', icon: 'zip' },
+ { type: '.bz2', icon: 'bz2' },
+ { type: '.doc', icon: 'word' },
+ { type: '.docx', icon: 'word' },
+ { type: '.xls', icon: 'excel' },
+ { type: '.xlsx', icon: 'excel' },
+ { type: '.ppt', icon: 'ppt' },
+ { type: '.pptx', icon: 'ppt' },
+ { type: '.pdf', icon: 'pdf' },
+ { type: '.txt', icon: 'txt' },
+ { type: '.md', icon: 'txt' },
+ { type: '.vsd', icon: 'vsd' },
+]);
+
+// 导出变量
+export { ext_img_name_list, ext_video_name_list, ext_file_name_list, ext_file_name_list_map };
diff --git a/src/components/common/upload/index.vue b/src/components/common/upload/index.vue
index 1898da15..b1c89797 100644
--- a/src/components/common/upload/index.vue
+++ b/src/components/common/upload/index.vue
@@ -185,6 +185,7 @@