|
|
@@ -245,8 +245,8 @@ const acceptType = computed(() => {
|
|
|
if (type === 2) {
|
|
|
return 'video/*'; // 视频类型
|
|
|
} else if (type === 4) {
|
|
|
- // 文档类型:排除图片和视频,支持工程文件
|
|
|
- return '.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.rtf,.csv,.zip,.rar,.7z,.tar,.gz,.epub,.mobi,.json,.xml,.html,.css,.js,.ts,.java,.py,.php,.c,.cpp,.h,.hpp,.md,.log,.sql,.psd,.cdr,.ai,.sketch,.fig,.xd,.indd,.aep,.prproj,.fla,.dwg,.dxf,.step,.stp,.iges,.stl,.obj,.3ds,.max,.blend,.c4d';
|
|
|
+ // 文档类型:支持图片、视频及工程文件
|
|
|
+ return 'image/*,video/*,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.rtf,.csv,.zip,.rar,.7z,.tar,.gz,.epub,.mobi,.json,.xml,.html,.css,.js,.ts,.java,.py,.php,.c,.cpp,.h,.hpp,.md,.log,.sql,.psd,.cdr,.ai,.sketch,.fig,.xd,.indd,.aep,.prproj,.fla,.dwg,.dxf,.step,.stp,.iges,.stl,.obj,.3ds,.max,.blend,.c4d';
|
|
|
}
|
|
|
// 图片类型:仅允许上传常规的图片类型
|
|
|
return 'image/jpeg,image/jpg,image/png,image/gif,image/bmp,image/webp';
|
|
|
@@ -388,15 +388,7 @@ function beforeUpload(file) {
|
|
|
const type = Number(props.fileType);
|
|
|
const ext = file.name.toLowerCase().split('.').pop();
|
|
|
|
|
|
- // 文档类型(type === 4):禁止上传图片和视频
|
|
|
- if (type === 4) {
|
|
|
- const videoExts = ['mp4', 'webm', 'ogg', 'mov', 'avi', 'mkv', 'flv', 'wmv'];
|
|
|
- const imageExts = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg', 'ico', 'tif', 'tiff'];
|
|
|
- if (videoExts.includes(ext) || imageExts.includes(ext)) {
|
|
|
- utils.message({ code: 0 }, '文档管理不支持上传图片或视频文件');
|
|
|
- return false;
|
|
|
- }
|
|
|
- } else if (type === 1) {
|
|
|
+ if (type === 1) {
|
|
|
// 图片类型:仅允许上传常规的图片类型
|
|
|
const allowedImageExts = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'];
|
|
|
if (!allowedImageExts.includes(ext)) {
|