Преглед изворни кода

前端: 上传文件、图片 不再限制仅图片格式,不再限制最小数,最大限制为10MB

baichengfei пре 5 година
родитељ
комит
50b9dd42ce

+ 1 - 1
src/dashoo.cn/frontend_web/src/components/oilsupplier/auditfilelist.vue

@@ -427,7 +427,7 @@
         }
         _this.doclist.push(params)
       },
-      fileurlcut (val,index) {
+      fileurlcut (val, index) {
         let fileurlall = val.split('$')[index]
         let fileurl = fileurlall.split('|')
         let retUrl = fileurl[0]

+ 4 - 4
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodsinfo.vue

@@ -1507,11 +1507,11 @@ export default {
       return true
     },
     beforeAvatarUpload (file) {
-      /* let isLt512K = file.size / 1024 < 512
-      if (isLt512K) {
-        this.$message.error('上传文件大小不能小于 512KB!')
+      let isLt100M = file.size / 1024 / 1024 / 100 < 1
+      if (!isLt100M) {
+        this.$message.error('上传文件大小不能超过 100MB!')
         return false
-      } */
+      }
     },
     uploadrequest (option) {
       let _this = this

+ 4 - 14
src/dashoo.cn/frontend_web/src/components/oilsupplier/subfilelist2.vue

@@ -94,7 +94,7 @@
                 :limit="5"
                 :on-exceed="uploadExceed">
                 <i class="el-icon-plus"></i>
-                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">请上传图片(大小为512KB-5MB),最多可上传五张图片
+                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">请上传图片(最大可上传 10MB),最多可上传五张图片
                 </div>
                 <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType ==yasuoname">请上传压缩文件
                 </div>
@@ -606,20 +606,10 @@
       },
       beforeAvatarUpload (file) {
         console.log(file, '=====')
-        let isLt512K = file.size / 1024 < 512
-        if (isLt512K) {
-          this.$message.error('上传文件大小不能小于 512KB!')
-          return false
-        }
-
         if (this.SubfileForm.NeedFileType != this.yasuoname) {
-          if (file.type.indexOf('image') < 0) {
-            this.$message.error('请上传图片!')
-            return false
-          }
-          let isLt50m = file.size / 1024 / 1024 / 5 < 1
-          if (!isLt50m) {
-            this.$message.error('上传文件大小不能超过 5MB!')
+          let isLt10m = file.size / 1024 / 1024 / 10 < 1
+          if (!isLt10m) {
+            this.$message.error('上传文件大小不能超过 10MB!')
             return false
           }
           return true

+ 4 - 4
src/dashoo.cn/frontend_web/src/components/oilsupplierstore/goodsinfo.vue

@@ -1299,11 +1299,11 @@
         return true
       },
       beforeAvatarUpload (file) {
-        /* let isLt512K = file.size / 1024 < 512
-        if (isLt512K) {
-          this.$message.error('上传文件大小不能小于 512KB!')
+        let isLt10m = file.size / 1024 / 1024 / 10 < 1
+        if (!isLt10m) {
+          this.$message.error('上传文件大小不能超过 10MB!')
           return false
-        } */
+        }
       },
       uploadrequest (option) {
         let _this = this

+ 2 - 2
src/dashoo.cn/frontend_web/src/components/samples/maintainlogdialog.vue

@@ -141,7 +141,7 @@
             })
           })
       },
-      beforeAvatarUpload(file) {
+      beforeAvatarUpload (file) {
         let isLt50m = file.size / 1024 / 1024 / 50 < 1
         if (!isLt50m) {
           this.$message.error('上传文件大小不能超过 50MB!')
@@ -150,7 +150,7 @@
         return true
       },
       // 判断附件是否上传成功
-      attachissuccess() {
+      attachissuccess () {
         if (this.$refs.refmaintainlogattach.uploadFiles && this.$refs.refmaintainlogattach.uploadFiles.length > 0) {
           for (let i = 0; i < this.$refs.refmaintainlogattach.uploadFiles.length; i++) {
             if (this.$refs.refmaintainlogattach.uploadFiles[i].status !== 'success') {

+ 8 - 26
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/bassicoperation.vue

@@ -887,7 +887,7 @@
               <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
                          :on-remove="filremove" :file-list="fileList" :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
                 <i class="el-icon-plus attach-uploader-icon"></i>
-                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">大小为512KB-5MB
+                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">最大可上传 10MB
                 </div>
               </el-upload>
             </el-form-item>
@@ -928,7 +928,7 @@
               <el-upload multiple style="margin-top: 10px;" action="" ref="newrefuploadattach"
                          :http-request="uploadrequest" class="attach-uploader" :before-upload="newbeforeAvatarUpload">
                 <i class="el-icon-plus attach-uploader-icon"></i>
-                <div slot="tip" class="el-upload__tip">大小为512KB-5MB
+                <div slot="tip" class="el-upload__tip">最大可上传 10MB
                 </div>
               </el-upload>
             </el-form-item>
@@ -1725,19 +1725,10 @@ import apiCert from '@/api/oilsupplier/suppliercert'
         })
       },
       newbeforeAvatarUpload (file) {
-        let isLt512K = file.size / 1024 < 512
-        if (isLt512K) {
-          this.$message.error('上传文件大小不能小于 512KB!')
-          return false
-        }
         if (this.newSubfileForm.NeedFileType != this.yasuoname) {
-          if (file.type.indexOf('image') < 0) {
-            this.$message.error('请上传图片!')
-            return false
-          }
-          let isLt50m = file.size / 1024 / 1024 / 5 < 1
-          if (!isLt50m) {
-            this.$message.error('上传文件大小不能超过 5MB!')
+          let isLt10m = file.size / 1024 / 1024 / 10 < 1
+          if (!isLt10m) {
+            this.$message.error('上传文件大小不能超过 10MB!')
             return false
           }
           return true
@@ -2008,19 +1999,10 @@ import apiCert from '@/api/oilsupplier/suppliercert'
         }
       },
       beforeAvatarUpload (file) {
-        let isLt512K = file.size / 1024 < 512
-        if (isLt512K) {
-          this.$message.error('上传文件大小不能小于 512KB!')
-          return false
-        }
         if (this.SubfileForm.NeedFileType !== this.yasuoname) {
-          if (file.type.indexOf('image') < 0) {
-            this.$message.error('请上传图片!')
-            return false
-          }
-          let isLt50m = file.size / 1024 / 1024 / 5 < 1
-          if (!isLt50m) {
-            this.$message.error('上传文件大小不能超过 5MB!')
+          let isLt10m = file.size / 1024 / 1024 / 10 < 1
+          if (!isLt10m) {
+            this.$message.error('上传文件大小不能超过 10MB!')
             return false
           }
           return true

+ 8 - 26
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/goodsoperation.vue

@@ -999,7 +999,7 @@
               <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
                          :on-remove="filremove" :file-list="fileList" :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
                 <i class="el-icon-plus attach-uploader-icon"></i>
-                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">大小为512KB-5MB
+                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">最大可上传 10MB
                 </div>
               </el-upload>
             </el-form-item>
@@ -1039,7 +1039,7 @@
               <el-upload multiple style="margin-top: 10px;" action="" ref="newrefuploadattach"
                          :http-request="uploadrequest" class="attach-uploader" :before-upload="newbeforeAvatarUpload">
                 <i class="el-icon-plus attach-uploader-icon"></i>
-                <div slot="tip" class="el-upload__tip">大小为512KB-5MB
+                <div slot="tip" class="el-upload__tip">最大可上传 10MB
                 </div>
               </el-upload>
             </el-form-item>
@@ -1856,19 +1856,10 @@
         })
       },
       newbeforeAvatarUpload (file) {
-        let isLt512K = file.size / 1024 < 512
-        if (isLt512K) {
-          this.$message.error('上传文件大小不能小于 512KB!')
-          return false
-        }
         if (this.newSubfileForm.NeedFileType != this.yasuoname) {
-          if (file.type.indexOf('image') < 0) {
-            this.$message.error('请上传图片!')
-            return false
-          }
-          let isLt50m = file.size / 1024 / 1024 / 5 < 1
-          if (!isLt50m) {
-            this.$message.error('上传文件大小不能超过 5MB!')
+          let isLt10m = file.size / 1024 / 1024 / 10 < 1
+          if (!isLt10m) {
+            this.$message.error('上传文件大小不能超过 10MB!')
             return false
           }
           return true
@@ -2143,19 +2134,10 @@
         }
       },
       beforeAvatarUpload (file) {
-        let isLt512K = file.size / 1024 < 512
-        if (isLt512K) {
-          this.$message.error('上传文件大小不能小于 512KB!')
-          return false
-        }
         if (this.SubfileForm.NeedFileType !== this.yasuoname) {
-          if (file.type.indexOf('image') < 0) {
-            this.$message.error('请上传图片!')
-            return false
-          }
-          let isLt50m = file.size / 1024 / 1024 / 5 < 1
-          if (!isLt50m) {
-            this.$message.error('上传文件大小不能超过 5MB!')
+          let isLt10m = file.size / 1024 / 1024 / 10 < 1
+          if (!isLt10m) {
+            this.$message.error('上传文件大小不能超过 10MB!')
             return false
           }
           return true

+ 8 - 26
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/operation.vue

@@ -804,7 +804,7 @@
               <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
                          :on-remove="filremove" :file-list="fileList" :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
                 <i class="el-icon-plus attach-uploader-icon"></i>
-                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">大小为512KB-5MB
+                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">最大可上传 10MB
                 </div>
               </el-upload>
             </el-form-item>
@@ -845,7 +845,7 @@
               <el-upload multiple style="margin-top: 10px;" action="" ref="newrefuploadattach"
                          :http-request="uploadrequest" class="attach-uploader" :before-upload="newbeforeAvatarUpload">
                 <i class="el-icon-plus attach-uploader-icon"></i>
-                <div slot="tip" class="el-upload__tip">大小为512KB-5MB
+                <div slot="tip" class="el-upload__tip">最大可上传 10MB
                 </div>
               </el-upload>
             </el-form-item>
@@ -1633,19 +1633,10 @@ import Viewer from 'v-viewer'
         })
       },
       newbeforeAvatarUpload (file) {
-        let isLt512K = file.size / 1024 < 512
-        if (isLt512K) {
-          this.$message.error('上传文件大小不能小于 512KB!')
-          return false
-        }
         if (this.newSubfileForm.NeedFileType != this.yasuoname) {
-          if (file.type.indexOf('image') < 0) {
-            this.$message.error('请上传图片!')
-            return false
-          }
-          let isLt50m = file.size / 1024 / 1024 / 5 < 1
-          if (!isLt50m) {
-            this.$message.error('上传文件大小不能超过 5MB!')
+          let isLt10m = file.size / 1024 / 1024 / 10 < 1
+          if (!isLt10m) {
+            this.$message.error('上传文件大小不能超过 10MB!')
             return false
           }
           return true
@@ -1943,19 +1934,10 @@ import Viewer from 'v-viewer'
         }
       },
       beforeAvatarUpload (file) {
-        let isLt512K = file.size / 1024 < 512
-        if (isLt512K) {
-          this.$message.error('上传文件大小不能小于 512KB!')
-          return false
-        }
         if (this.SubfileForm.NeedFileType !== this.yasuoname) {
-          if (file.type.indexOf('image') < 0) {
-            this.$message.error('请上传图片!')
-            return false
-          }
-          let isLt50m = file.size / 1024 / 1024 / 5 < 1
-          if (!isLt50m) {
-            this.$message.error('上传文件大小不能超过 5MB!')
+          let isLt10m = file.size / 1024 / 1024 / 10 < 1
+          if (!isLt10m) {
+            this.$message.error('上传文件大小不能超过 10MB!')
             return false
           }
           return true

+ 4 - 13
src/dashoo.cn/frontend_web/src/pages/oilsupplier/infochangech/_opera/operation.vue

@@ -789,7 +789,7 @@
               <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
                          :on-remove="filremove" :file-list="fileList" :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
                 <i class="el-icon-plus attach-uploader-icon"></i>
-                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">大小为512KB-5MB
+                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">最大可上传 10MB
                 </div>
               </el-upload>
             </el-form-item>
@@ -2364,19 +2364,10 @@
         this.fileList = files
       },
       beforeAvatarUpload (file) {
-        let isLt512K = file.size / 1024 < 512
-        if (isLt512K) {
-          this.$message.error('上传文件大小不能小于 512KB!')
-          return false
-        }
         if (this.SubfileForm.NeedFileType !== this.yasuoname) {
-          if (file.type.indexOf('image') < 0) {
-            this.$message.error('请上传图片!')
-            return false
-          }
-          let isLt50m = file.size / 1024 / 1024 / 5 < 1
-          if (!isLt50m) {
-            this.$message.error('上传文件大小不能超过 5MB!')
+          let isLt10m = file.size / 1024 / 1024 / 10 < 1
+          if (!isLt10m) {
+            this.$message.error('上传文件大小不能超过 10MB!')
             return false
           }
           return true

+ 3 - 12
src/dashoo.cn/frontend_web/src/pages/oilsupplier/qualchange/_opera/operation.vue

@@ -123,7 +123,7 @@
                 <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
                   :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
                   <i class="el-icon-plus attach-uploader-icon"></i>
-                  <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">大小为512KB-5MB</div>
+                  <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">最大可上传 10MB</div>
                 </el-upload>
                 <!-- <el-upload style="margin-top: 10px;" action="" ref="refuploadattach" :http-request="uploadrequest"
                   class="attach-uploader" :before-upload="beforeAvatarUpload">
@@ -468,19 +468,10 @@
       },
 
       beforeAvatarUpload (file) {
-        let isLt512K = file.size / 1024 < 512
-        if (isLt512K) {
-          this.$message.error('上传文件大小不能小于 512KB!')
-          return false
-        }
         if (this.SubfileForm.NeedFileType != this.yasuoname) {
-          if (file.type.indexOf('image') < 0) {
-            this.$message.error('上传图片!')
-            return false
-          }
-          let isLt50m = file.size / 1024 / 1024 / 5 < 1
+          let isLt50m = file.size / 1024 / 1024 / 10 < 1
           if (!isLt50m) {
-            this.$message.error('上传文件大小不能超过 5MB!')
+            this.$message.error('上传文件大小不能超过 10MB!')
             return false
           }
           return true

+ 8 - 26
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/basisdataopera.vue

@@ -623,7 +623,7 @@
               <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
                          :on-remove="filremove" :file-list="fileList" :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
                 <i class="el-icon-plus attach-uploader-icon"></i>
-                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">大小为512KB-5MB</div>
+                <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">最大可上传 10MB</div>
               </el-upload>
             </el-form-item>
           </el-col>
@@ -846,7 +846,7 @@
               <el-upload multiple style="margin-top: 10px;" action="" ref="newrefuploadattach"
                          :http-request="uploadrequest" class="attach-uploader" :before-upload="newbeforeAvatarUpload">
                 <i class="el-icon-plus attach-uploader-icon"></i>
-                <div slot="tip" class="el-upload__tip">大小为512KB-5MB
+                <div slot="tip" class="el-upload__tip">最大可上传 10MB
                 </div>
               </el-upload>
             </el-form-item>
@@ -2190,19 +2190,10 @@
         this.fileList = files
       },
       beforeAvatarUpload (file) {
-        let isLt512K = file.size / 1024 < 512
-        if (isLt512K) {
-          this.$message.error('上传文件大小不能小于 512KB!')
-          return false
-        }
         if (this.SubfileForm.NeedFileType != this.yasuoname) {
-          if (file.type.indexOf('image') < 0) {
-            this.$message.error('请上传图片!')
-            return false
-          }
-          let isLt50m = file.size / 1024 / 1024 / 5 < 1
-          if (!isLt50m) {
-            this.$message.error('上传文件大小不能超过 5MB!')
+          let isLt10m = file.size / 1024 / 1024 / 10 < 1
+          if (!isLt10m) {
+            this.$message.error('上传文件大小不能超过 10MB!')
             return false
           }
           return true
@@ -2215,19 +2206,10 @@
         }
       },
       newbeforeAvatarUpload (file) {
-        let isLt512K = file.size / 1024 < 512
-        if (isLt512K) {
-          this.$message.error('上传文件大小不能小于 512KB!')
-          return false
-        }
         if (this.newSubfileForm.NeedFileType != this.yasuoname) {
-          if (file.type.indexOf('image') < 0) {
-            this.$message.error('请上传图片!')
-            return false
-          }
-          let isLt50m = file.size / 1024 / 1024 / 5 < 1
-          if (!isLt50m) {
-            this.$message.error('上传文件大小不能超过 5MB!')
+          let isLt10m = file.size / 1024 / 1024 / 10 < 1
+          if (!isLt10m) {
+            this.$message.error('上传文件大小不能超过 10MB!')
             return false
           }
           return true

+ 5 - 14
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/goodsdataopera.vue

@@ -706,12 +706,12 @@
               <!--<el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"-->
               <!--:http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">-->
               <!--<i class="el-icon-plus attach-uploader-icon"></i>-->
-              <!--<div slot="tip" class="el-upload__tip">大小为512KB-5MB</div>-->
+              <!--<div slot="tip" class="el-upload__tip">最大可上传 10MB</div>-->
               <!--</el-upload>-->
               <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
                          :on-remove="filremove" :file-list="fileList" :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
                 <i class="el-icon-plus attach-uploader-icon"></i>
-                <div slot="tip" class="el-upload__tip">大小为512KB-5MB</div>
+                <div slot="tip" class="el-upload__tip">最大可上传 10MB</div>
               </el-upload>
             </el-form-item>
           </el-col>
@@ -1090,7 +1090,7 @@
               <el-upload multiple style="margin-top: 10px;" action="" ref="newrefuploadattach"
                 :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
                 <i class="el-icon-plus attach-uploader-icon"></i>
-                <div slot="tip" class="el-upload__tip">大小为512KB-5MB
+                <div slot="tip" class="el-upload__tip">最大可上传 10MB
                 </div>
               </el-upload>
             </el-form-item>
@@ -2794,18 +2794,9 @@
         this.fileList = files
       },
       beforeAvatarUpload (file) {
-        if (file.type.indexOf('image') < 0) {
-          this.$message.error('请上传图片!')
-          return false
-        }
-        let isLt512K = file.size / 1024 < 512
-        if (isLt512K) {
-          this.$message.error('上传文件大小不能小于 512KB!')
-          return false
-        }
-        let isLt50m = file.size / 1024 / 1024 / 5 < 1
+        let isLt50m = file.size / 1024 / 1024 / 10 < 1 // 改为限制10M
         if (!isLt50m) {
-          this.$message.error('上传文件大小不能超过 5MB!')
+          this.$message.error('上传文件大小不能超过 10MB!')
           return false
         }
         return true

+ 6 - 15
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/techdataopera.vue

@@ -619,12 +619,12 @@
               <!--<el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"-->
                 <!--:http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">-->
                 <!--<i class="el-icon-plus attach-uploader-icon"></i>-->
-                <!--<div slot="tip" class="el-upload__tip">大小为512KB-5MB</div>-->
+                <!--<div slot="tip" class="el-upload__tip">最大可上传 10MB</div>-->
               <!--</el-upload>-->
               <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach" :http-request="uploadrequest"
                          :on-remove="filremove" :file-list="fileList" class="attach-uploader" :before-upload="beforeAvatarUpload">
                 <i class="el-icon-plus attach-uploader-icon"></i>
-                <div slot="tip" class="el-upload__tip">大小为512KB-5MB</div>
+                <div slot="tip" class="el-upload__tip">最大可上传 10MB</div>
               </el-upload>
             </el-form-item>
           </el-col>
@@ -847,7 +847,7 @@
               <el-upload multiple style="margin-top: 10px;" action="" ref="newrefuploadattach"
                          :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
                 <i class="el-icon-plus attach-uploader-icon"></i>
-                <div slot="tip" class="el-upload__tip">大小为512KB-5MB
+                <div slot="tip" class="el-upload__tip">最大可上传 10MB
                 </div>
               </el-upload>
             </el-form-item>
@@ -2643,18 +2643,9 @@
         this.fileList = files
       },
       beforeAvatarUpload (file) {
-        if (file.type.indexOf('image') < 0) {
-          this.$message.error('请上传图片!')
-          return false
-        }
-        let isLt512K = file.size / 1024 < 512
-        if (isLt512K) {
-          this.$message.error('上传文件大小不能小于 512KB!')
-          return false
-        }
-        let isLt50m = file.size / 1024 / 1024 / 5 < 1
-        if (!isLt50m) {
-          this.$message.error('上传文件大小不能超过 5MB!')
+        let isLt10m = file.size / 1024 / 1024 / 10 < 1
+        if (!isLt10m) {
+          this.$message.error('上传文件大小不能超过 10MB!')
           return false
         }
         return true