|
|
|
@ -655,11 +655,30 @@ export class BasicinfoComponent implements OnInit {
|
|
|
|
|
image.src = reader.result |
|
|
|
|
} |
|
|
|
|
setTimeout(() => { |
|
|
|
|
if(image.width>=4096 || image.height>=5000 ){
|
|
|
|
|
if(this.file.type.indexOf('image') == -1){ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('请上传图片','确定',config); |
|
|
|
|
if((<HTMLInputElement>document.getElementById('selectedfile'))){ |
|
|
|
|
(<HTMLInputElement>document.getElementById('selectedfile')).value = null //清空input框缓存
|
|
|
|
|
} |
|
|
|
|
}else if(this.file.name.toLowerCase().indexOf('png') == -1 && this.file.name.toLowerCase().indexOf('jpg') == -1 && this.file.name.toLowerCase().indexOf('jpeg') == -1){ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('请上传图片后缀为png,jpg,jpeg的文件','确定',config); |
|
|
|
|
if((<HTMLInputElement>document.getElementById('selectedfile'))){ |
|
|
|
|
(<HTMLInputElement>document.getElementById('selectedfile')).value = null //清空input框缓存
|
|
|
|
|
}
|
|
|
|
|
}else if(image.width>=4096 || image.height>=5000 ){
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('请选择分辨率小于4096*5000的图片','确定',config); |
|
|
|
|
if((<HTMLInputElement>document.getElementById('selectedfile'))){ |
|
|
|
|
(<HTMLInputElement>document.getElementById('selectedfile')).value = null //清空input框缓存
|
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
if(this.file){ |
|
|
|
|
this.startUploading() |
|
|
|
|