diff --git a/src/app/key-unit/edit-plan-info/edit-plan-info.component.scss b/src/app/key-unit/edit-plan-info/edit-plan-info.component.scss index e411244..2896172 100644 --- a/src/app/key-unit/edit-plan-info/edit-plan-info.component.scss +++ b/src/app/key-unit/edit-plan-info/edit-plan-info.component.scss @@ -6,9 +6,12 @@ width: 100%; height: 0px; .scorePrompt { - width: 100%; + width: 300px; + height: 0px; text-align: center; position: absolute; + left: 50%; + margin-left: -150px; top: 88px; font-size: 15px; z-index: 111; diff --git a/src/app/key-unit/view-unit-details/view-unit-details.component.scss b/src/app/key-unit/view-unit-details/view-unit-details.component.scss index 01a9116..1eb53a5 100644 --- a/src/app/key-unit/view-unit-details/view-unit-details.component.scss +++ b/src/app/key-unit/view-unit-details/view-unit-details.component.scss @@ -6,9 +6,12 @@ width: 100%; height: 0px; .scorePrompt { - width: 100%; + width: 300px; + height: 0px; text-align: center; position: absolute; + left: 50%; + margin-left: -150px; top: 88px; font-size: 15px; z-index: 111; diff --git a/src/app/ui/collection-tools-building/collection-tools.component.ts b/src/app/ui/collection-tools-building/collection-tools.component.ts index 1ce5d4a..134dff5 100644 --- a/src/app/ui/collection-tools-building/collection-tools.component.ts +++ b/src/app/ui/collection-tools-building/collection-tools.component.ts @@ -2087,6 +2087,13 @@ export class CollectionToolsBuildingComponent implements OnInit { let fileSize = file.size || null //上传文件的总大小 let maxSize = 5 * 1024 * 1024 //5MB一个分片 let tenSize = 10 * 1024 * 1024 //10MB限制 + if (file && file.name.toLowerCase().indexOf('png') == -1 && file.name.toLowerCase().indexOf('jpg') == -1 && file.name.toLowerCase().indexOf('jpeg') == -1) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('请上传图片后缀为png,jpg,jpeg的文件', '确定', config); + return + } if (file && fileSize <= maxSize) { //上传文件<=5MB时 let formData = new FormData() diff --git a/src/app/ui/collection-tools-plan/collection-tools.component.ts b/src/app/ui/collection-tools-plan/collection-tools.component.ts index 6444352..bd0195a 100644 --- a/src/app/ui/collection-tools-plan/collection-tools.component.ts +++ b/src/app/ui/collection-tools-plan/collection-tools.component.ts @@ -2031,6 +2031,13 @@ export class CollectionToolsPlanComponent implements OnInit { let fileSize = file.size || null //上传文件的总大小 let maxSize = 5 * 1024 * 1024 //5MB一个分片 let tenSize = 10 * 1024 * 1024 //10MB限制 +    if (file && file.name.toLowerCase().indexOf('png') == -1 && file.name.toLowerCase().indexOf('jpg') == -1 && file.name.toLowerCase().indexOf('jpeg') == -1) { +      const config = new MatSnackBarConfig(); +      config.verticalPosition = 'top'; +      config.duration = 3000 +      this.snackBar.open('请上传图片后缀为png,jpg,jpeg的文件', '确定', config); +      return +    } if (file && fileSize <= maxSize) { //上传文件<=5MB时 let formData = new FormData() diff --git a/src/app/ui/collection-tools-plan/leftFunctionalDomain.ts b/src/app/ui/collection-tools-plan/leftFunctionalDomain.ts index 0e720da..2f25aa7 100644 --- a/src/app/ui/collection-tools-plan/leftFunctionalDomain.ts +++ b/src/app/ui/collection-tools-plan/leftFunctionalDomain.ts @@ -60,6 +60,13 @@ export class leftFunctionalDomainComponentPlan implements OnInit { //提交表单创建平面图 onSubmit (e) { if (this.file && this.selectedType == 'image') { +     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); +       return +   } this.maskLayerService.sendMessage(true) if (this.file.size<=5*1024*1024) { //小于5MB let formData = new FormData() diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index 52129a7..7281f41 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -2156,6 +2156,13 @@ export class CollectionToolsComponent implements OnInit { let fileSize = file.size || null //上传文件的总大小 let maxSize = 5 * 1024 * 1024 //5MB一个分片 let tenSize = 10 * 1024 * 1024 //10MB限制 + if (file && file.name.toLowerCase().indexOf('png') == -1 && file.name.toLowerCase().indexOf('jpg') == -1 && file.name.toLowerCase().indexOf('jpeg') == -1) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('请上传图片后缀为png,jpg,jpeg的文件', '确定', config); + return + } if (file && fileSize <= maxSize) { //上传文件<=5MB时 let formData = new FormData() diff --git a/src/app/ui/collection-tools/leftFunctionalDomain.ts b/src/app/ui/collection-tools/leftFunctionalDomain.ts index b13a965..3570e0a 100644 --- a/src/app/ui/collection-tools/leftFunctionalDomain.ts +++ b/src/app/ui/collection-tools/leftFunctionalDomain.ts @@ -230,6 +230,13 @@ export class addBGCDisposalNodeComponent implements OnInit { //提交表单 onSubmit (e) { if (e.name && this.file) { +     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); +       return +     } e.file = this.file this.dialogRef.close(e); } else {