From 05e65ed9b710a09eba1fe00f621c94be35046204 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Fri, 4 Jun 2021 15:09:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=20=E9=99=90=E5=88=B6?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collection-tools.component.ts | 7 +++++++ .../ui/collection-tools-plan/collection-tools.component.ts | 7 +++++++ src/app/ui/collection-tools-plan/leftFunctionalDomain.ts | 7 +++++++ src/app/ui/collection-tools/collection-tools.component.ts | 7 +++++++ src/app/ui/collection-tools/leftFunctionalDomain.ts | 7 +++++++ 5 files changed, 35 insertions(+) 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 7e0ec8b..9c95c63 100644 --- a/src/app/ui/collection-tools-plan/collection-tools.component.ts +++ b/src/app/ui/collection-tools-plan/collection-tools.component.ts @@ -2019,6 +2019,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 4fc836d..0a0a338 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 { From 61282794708f805390fc199e181ce882ee5be5b2 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Mon, 7 Jun 2021 13:46:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=20=E5=88=86=E6=95=B0?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=A0=B7=E5=BC=8F=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../key-unit/edit-plan-info/edit-plan-info.component.scss | 5 ++++- .../view-unit-details/view-unit-details.component.scss | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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;