压缩包
This commit is contained in:
parent
535fea46d8
commit
4157a5ca10
|
|
@ -97,15 +97,14 @@ export default {
|
|||
const hasImage = fileList.some(f => this.isImageFile(f.name));
|
||||
const hasZip = fileList.some(f => this.isCompressedFile(f.name));
|
||||
|
||||
// 如果当前上传的是压缩包,但已有图片或其他压缩包
|
||||
if (isZip && (hasImage || hasZip)) {
|
||||
this.$message.warning('不能同时上传图片和压缩包');
|
||||
// 修改后的判断逻辑
|
||||
if (isZip && hasImage) {
|
||||
this.$message.warning('不能同时上传压缩包');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 如果当前上传的是图片,但已有压缩包
|
||||
if (this.isImageFile(file.name) && hasZip) {
|
||||
this.$message.warning('不能同时上传图片和压缩包');
|
||||
this.$message.warning('不能同时上传图片');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -93,15 +93,14 @@ export default {
|
|||
const hasImage = fileList.some(f => this.isImageFile(f.name));
|
||||
const hasZip = fileList.some(f => this.isCompressedFile(f.name));
|
||||
|
||||
// 如果当前上传的是压缩包,但已有图片或其他压缩包
|
||||
if (isZip && (hasImage || hasZip)) {
|
||||
this.$message.warning('不能同时上传图片和压缩包');
|
||||
// 修改后的判断逻辑
|
||||
if (isZip && hasImage) {
|
||||
this.$message.warning('不能同时上传压缩包');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 如果当前上传的是图片,但已有压缩包
|
||||
if (this.isImageFile(file.name) && hasZip) {
|
||||
this.$message.warning('不能同时上传图片和压缩包');
|
||||
this.$message.warning('不能同时上传图片');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue