| | |
| | | // 上传前校检格式和大小 |
| | | function handleBeforeUpload(file) { |
| | | // 校检文件类型 |
| | | if (props.fileType.length) { |
| | | const fileName = file.name.split('.') |
| | | const fileExt = fileName[fileName.length - 1] |
| | | const isTypeOk = props.fileType.indexOf(fileExt) >= 0 |
| | | if (!isTypeOk) { |
| | | proxy.$modal.msgError(`文件格式不正确,请上传${props.fileType.join("/")}格式文件!`) |
| | | return false |
| | | } |
| | | } |
| | | // if (props.fileType.length) { |
| | | // const fileName = file.name.split('.') |
| | | // const fileExt = fileName[fileName.length - 1] |
| | | // const isTypeOk = props.fileType.indexOf(fileExt) >= 0 |
| | | // if (!isTypeOk) { |
| | | // proxy.$modal.msgError(`文件格式不正确,请上传${props.fileType.join("/")}格式文件!`) |
| | | // return false |
| | | // } |
| | | // } |
| | | // 校检文件名是否包含特殊字符 |
| | | if (file.name.includes(',')) { |
| | | proxy.$modal.msgError('文件名不正确,不能包含英文逗号!') |
| | |
| | | .upload-file-uploader { |
| | | margin-bottom: 5px; |
| | | } |
| | | .upload-file-list { |
| | | margin-top: 10px; |
| | | max-height: 150px; |
| | | overflow-y: auto; |
| | | } |
| | | .upload-file-list .el-upload-list__item { |
| | | border: 1px solid #e4e7ed; |
| | | line-height: 2; |
| | |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | color: inherit; |
| | | max-height: 20px; |
| | | } |
| | | .ele-upload-list__item-content-action .el-link { |
| | | margin-right: 10px; |
| | | } |
| | | .el-icon-document{ |
| | | padding-left: 10px; |
| | | } |
| | | </style> |