Browse Source

[完善] 完善取消按钮逻辑

develop
陈鹏飞 4 years ago
parent
commit
60de5a58a2
  1. 2
      src/app/ui/collection-tools/collection-tools.component.ts
  2. 2
      src/app/ui/collection-tools/editPlaneFigure.html
  3. 16
      src/app/ui/collection-tools/leftFunctionalDomain.ts

2
src/app/ui/collection-tools/collection-tools.component.ts

@ -1451,6 +1451,8 @@ export class CollectionToolsComponent implements OnInit {
isSuccess.then(res=>{ isSuccess.then(res=>{
this.canvas.refreshBackgroundImage() this.canvas.refreshBackgroundImage()
}) })
}else if (data == '更新背景图') {
this.canvas.refreshBackgroundImage()
} }
}) })
} }

2
src/app/ui/collection-tools/editPlaneFigure.html

@ -42,7 +42,7 @@
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid"> <button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid">
确定 确定
</button> </button>
<button mat-raised-button mat-dialog-close>取消</button> <button mat-raised-button (click)='close()'>取消</button>
</div> </div>
</form> </form>

16
src/app/ui/collection-tools/leftFunctionalDomain.ts

@ -73,6 +73,8 @@ export class editPlaneFigureComponent implements OnInit {
this.details = this.data.buildingData.details || '' this.details = this.data.buildingData.details || ''
this.imgWidth = this.data.buildingData.imageWidth || 0 this.imgWidth = this.data.buildingData.imageWidth || 0
this.imgHeight = this.data.buildingData.imageHeight || 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) { if (this.imgWidth==0 && this.imgHeight==0 && this.data.buildingData.imageUrl) {
let that = this let that = this
let img = new Image() let img = new Image()
@ -93,6 +95,9 @@ export class editPlaneFigureComponent implements OnInit {
}); });
} }
oldWidth:number; //原图片宽
oldHeight:number; //原图片高
name:any; //name name:any; //name
checked:boolean = false;//是否为避难层 checked:boolean = false;//是否为避难层
area:number; //面积 area:number; //面积
@ -126,6 +131,17 @@ export class editPlaneFigureComponent implements OnInit {
e.checked? this.imgScale = Number((this.imgWidth/this.imgHeight)) : null 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) { onSubmit (e) {
if (!this.data.isBuilding) { //总平面图 修改平面图 if (!this.data.isBuilding) { //总平面图 修改平面图

Loading…
Cancel
Save