Przeglądaj źródła

feat: 将文件类型限制为只能是pdf

zhouyuhao 10 miesięcy temu
rodzic
commit
56d90e6630

+ 7 - 5
src/views/Tracking/src/components/TrackingDetail/src/components/UploadFilesDialog.vue

@@ -117,9 +117,9 @@ const clearData = () => {
 const beforeAvatarUpload = (rawFile: any) => {
   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)
   ) {
     ElMessage.error('The file types allowed for upload are: PDF, DOCX, and XLSX.')
@@ -153,12 +153,13 @@ const disableUpload = ref(false)
           :value="item.file_type"
         ></el-option>
       </el-select>
+      <!-- ,.docx,.xlsx -->
       <el-upload
         class="upload-demo"
         ref="uploadRef"
         drag
         :limit="5"
-        :accept="'application/pdf,.docx,.xlsx'"
+        :accept="'application/pdf'"
         :show-file-list="false"
         :action="url"
         :auto-upload="false"
@@ -175,7 +176,8 @@ const disableUpload = ref(false)
         <div class="el-upload-tips">
           <div class="label">
             <span class="font_family icon-icon_info_b" style="vertical-align: baseline"></span>
-            <span>Supported formats: pdf, docx, xlsx ; </span>
+            <!-- , docx, xlsx  -->
+            <span>Supported formats: pdf ; </span>
           </div>
           <span>Maximum Size: 5MB; </span>
           <span>Maximum Number: 5 files</span>