diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index 52ec061..7e8064b 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -1451,6 +1451,8 @@ export class CollectionToolsComponent implements OnInit { isSuccess.then(res=>{ this.canvas.refreshBackgroundImage() }) + }else if (data == '更新背景图') { + this.canvas.refreshBackgroundImage() } }) } diff --git a/src/app/ui/collection-tools/editPlaneFigure.html b/src/app/ui/collection-tools/editPlaneFigure.html index bab09da..d21cbf3 100644 --- a/src/app/ui/collection-tools/editPlaneFigure.html +++ b/src/app/ui/collection-tools/editPlaneFigure.html @@ -42,7 +42,7 @@ - + diff --git a/src/app/ui/collection-tools/leftFunctionalDomain.ts b/src/app/ui/collection-tools/leftFunctionalDomain.ts index 92be8fb..079f199 100644 --- a/src/app/ui/collection-tools/leftFunctionalDomain.ts +++ b/src/app/ui/collection-tools/leftFunctionalDomain.ts @@ -73,6 +73,8 @@ export class editPlaneFigureComponent implements OnInit { this.details = this.data.buildingData.details || '' this.imgWidth = this.data.buildingData.imageWidth || 0 this.imgHeight = this.data.buildingData.imageHeight || 0 + this.oldWidth = JSON.parse(JSON.stringify(this.data.buildingData.imageWidth || 0)) + this.oldHeight = JSON.parse(JSON.stringify(this.data.buildingData.imageHeight || 0)) if (this.imgWidth==0 && this.imgHeight==0 && this.data.buildingData.imageUrl) { let that = this let img = new Image() @@ -93,6 +95,9 @@ export class editPlaneFigureComponent implements OnInit { }); } + oldWidth:number; //原图片宽 + oldHeight:number; //原图片高 + name:any; //name checked:boolean = false;//是否为避难层 area:number; //面积 @@ -126,6 +131,17 @@ export class editPlaneFigureComponent implements OnInit { e.checked? this.imgScale = Number((this.imgWidth/this.imgHeight)) : null } + //关闭 + close () { + if (this.oldWidth === this.imgWidth && this.oldHeight === this.imgHeight) { + this.dialogRef.close() + } else { + this.canvasData.selectStorey.imageWidth = this.oldWidth + this.canvasData.selectStorey.imageHeight = this.oldHeight + this.dialogRef.close('更新背景图'); + } + } + //提交表单修改平面图 onSubmit (e) { if (!this.data.isBuilding) { //总平面图 修改平面图