diff --git a/src/components/FileUpload/optimizeToolUpload.vue b/src/components/FileUpload/optimizeToolUpload.vue index a13e58a..8b8994c 100644 --- a/src/components/FileUpload/optimizeToolUpload.vue +++ b/src/components/FileUpload/optimizeToolUpload.vue @@ -18,6 +18,7 @@ +
只能上传{{acceptType}}格式
@@ -460,17 +461,28 @@ export default { async handleFolderUpload(event) { + let self = this const files = Array.from(event.target.files); this.totalFiles = files.length; this.uploadedCount = 0; this.progressFlag = true; let failCount = 0; for (let i = 0; i < files.length; i++) { + const file = files[i]; + const fileExtension = file.name.slice(file.name.lastIndexOf('.')).toLowerCase(); + + // 校验文件格式 + if (!self.acceptType.includes(fileExtension)) { + failCount++; + this.$message.error('文件格式不支持: ' + file.name); + continue; + } + try { await this.uploadFolderFile( { data: null, - file: files[i] + file: file } ); this.uploadedCount++; diff --git a/src/views/document/editDocument.vue b/src/views/document/editDocument.vue index 2451cfd..51a8b9b 100644 --- a/src/views/document/editDocument.vue +++ b/src/views/document/editDocument.vue @@ -355,7 +355,7 @@ deptOptions:[], uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址 fileData: null, - acceptType: ".txt,.doc,.docx,.pdf,.mp4,.zip,.rar,.7z,.png,.jpg,.jpeg", + acceptType: ".txt,.doc,.docx,.pdf,.mp4,.avi,.rmvb,.zip,.rar,.7z,.png,.jpg,.jpeg,.bmp", editStatus: true, toolDataInfo: [], dataFile: [], diff --git a/src/views/workflowList/addWorkflow/tool_release.vue b/src/views/workflowList/addWorkflow/tool_release.vue index f20ce98..9937bc0 100644 --- a/src/views/workflowList/addWorkflow/tool_release.vue +++ b/src/views/workflowList/addWorkflow/tool_release.vue @@ -464,7 +464,7 @@ export default { curDeptName: null, uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址 - acceptType: ".txt,.doc,.docx,.pdf,.mp4,.zip,.rar,.7z,.png,.jpg,.jpeg", + acceptType: ".txt,.doc,.docx,.pdf,.mp4,.avi,.rmvb,.zip,.rar,.7z,.png,.jpg,.jpeg,.bmp", dataFile: [], detailBoolean: false, attachmentList: [],