|
|
@ -2086,7 +2086,7 @@ export class CollectionToolsBuildingComponent implements OnInit { |
|
|
|
let file = e.target.files[0] || null //获取上传的文件
|
|
|
|
let file = e.target.files[0] || null //获取上传的文件
|
|
|
|
let fileSize = file.size || null //上传文件的总大小
|
|
|
|
let fileSize = file.size || null //上传文件的总大小
|
|
|
|
let maxSize = 5 * 1024 * 1024 //5MB一个分片
|
|
|
|
let maxSize = 5 * 1024 * 1024 //5MB一个分片
|
|
|
|
let tenSize = 10 * 1024 * 1024 //10MB限制
|
|
|
|
let tenSize = 100 * 1024 * 1024 //100MB限制
|
|
|
|
if (file && file.name.toLowerCase().indexOf('png') == -1 && file.name.toLowerCase().indexOf('jpg') == -1 && file.name.toLowerCase().indexOf('jpeg') == -1) { |
|
|
|
if (file && file.name.toLowerCase().indexOf('png') == -1 && file.name.toLowerCase().indexOf('jpg') == -1 && file.name.toLowerCase().indexOf('jpeg') == -1) { |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
config.verticalPosition = 'top'; |
|
|
|
config.verticalPosition = 'top'; |
|
|
@ -2101,14 +2101,14 @@ export class CollectionToolsBuildingComponent implements OnInit { |
|
|
|
this.http.post(`/api/Objects/WebPlan2D/${sessionStorage.getItem('companyId')}`, formData).subscribe((data: any) => { |
|
|
|
this.http.post(`/api/Objects/WebPlan2D/${sessionStorage.getItem('companyId')}`, formData).subscribe((data: any) => { |
|
|
|
this.renovateBaseMap('/api/Objects/WebPlan2D/' + data.objectName, item) |
|
|
|
this.renovateBaseMap('/api/Objects/WebPlan2D/' + data.objectName, item) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else if (file && fileSize > maxSize && fileSize < tenSize) { //上传文件>10MB时
|
|
|
|
} else if (file && fileSize > maxSize && fileSize < tenSize) { //上传文件>100MB时
|
|
|
|
let upload = this.canvasData.sectionUpload(sessionStorage.getItem('companyId'), file) |
|
|
|
let upload = this.canvasData.sectionUpload(sessionStorage.getItem('companyId'), file) |
|
|
|
upload.then(res => { this.renovateBaseMap('/api/Objects/PlanPlatform/' + res, item) }) |
|
|
|
upload.then(res => { this.renovateBaseMap('/api/Objects/PlanPlatform/' + res, item) }) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
config.verticalPosition = 'top'; |
|
|
|
config.verticalPosition = 'top'; |
|
|
|
config.duration = 3000 |
|
|
|
config.duration = 3000 |
|
|
|
this.snackBar.open('上传底图需小于10MB', '确定', config); |
|
|
|
this.snackBar.open('上传底图需小于100MB', '确定', config); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|