|
|
@@ -120,15 +120,16 @@ const clearData = () => {
|
|
|
uploadRef.value.clearFiles()
|
|
|
}
|
|
|
const beforeAvatarUpload = (rawFile: any) => {
|
|
|
+ console.log(rawFile.type, '类型')
|
|
|
if (
|
|
|
![
|
|
|
- 'application/pdf'
|
|
|
- // 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
|
- // 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
|
+ 'application/pdf',
|
|
|
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
|
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
|
].includes(rawFile.type)
|
|
|
) {
|
|
|
// , DOCX, and XLSX
|
|
|
- ElMessage.error('The file types allowed for upload are: PDF.')
|
|
|
+ ElMessage.error('The file types allowed for upload are: PDF, XLSX and DOCX.')
|
|
|
return false
|
|
|
} else if (rawFile.size / 1024 / 1024 > 5) {
|
|
|
ElMessage.error('File size must not exceed 5MB!')
|
|
|
@@ -165,7 +166,7 @@ const disableUpload = ref(false)
|
|
|
ref="uploadRef"
|
|
|
drag
|
|
|
:limit="5"
|
|
|
- :accept="'application/pdf'"
|
|
|
+ :accept="'.pdf,.xlsx,.docx,.doc,.xls'"
|
|
|
:show-file-list="false"
|
|
|
:action="url"
|
|
|
:auto-upload="false"
|
|
|
@@ -183,7 +184,7 @@ const disableUpload = ref(false)
|
|
|
<div class="label">
|
|
|
<span class="font_family icon-icon_info_b" style="vertical-align: baseline"></span>
|
|
|
<!-- , docx, xlsx -->
|
|
|
- <span>Supported formats: pdf ; </span>
|
|
|
+ <span>Supported formats: .pdf, .xlsx, .docx </span>
|
|
|
</div>
|
|
|
<span>Maximum Size: 5MB; </span>
|
|
|
<span>Maximum Number: 5 files</span>
|