From a6d9f9f4f4a161c857c4258d9623b5e0933f8d1b Mon Sep 17 00:00:00 2001 From: username <1105965053@qq.com> Date: Tue, 22 Sep 2020 10:14:53 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=20=E7=B1=BB=E4=BC=BC?= =?UTF-8?q?=E9=A2=84=E6=A1=88UI=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collection-tools.component.html | 2 +- .../collection-tools.component.ts | 16 +++++++--------- src/app/working-area/working-area.component.ts | 3 ++- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/app/ui/collection-tools/collection-tools.component.html b/src/app/ui/collection-tools/collection-tools.component.html index 47af34f..0e3b5fb 100644 --- a/src/app/ui/collection-tools/collection-tools.component.html +++ b/src/app/ui/collection-tools/collection-tools.component.html @@ -231,7 +231,7 @@ -
+
keyboard_arrow_up keyboard_arrow_down diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index e0429f7..a0539e7 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -1077,24 +1077,21 @@ export class CollectionToolsComponent implements OnInit { //计算 可视区域内宽度, 是否缩放背景图 backGroundScale () { let that = this - let dad = document.querySelector('.functionalDomainContent').clientWidth - let dadHeight = document.querySelector('.functionalDomainContent').clientHeight - let left = document.querySelector('.functionalDomainLeft').clientWidth - let right = document.querySelector('.functionalDomainRight').clientWidth - let imgWidth = dad - left - right//可视区域内 宽度 + let dadWidth = document.querySelector('.canvas').clientWidth + let dadHeight = document.querySelector('.canvas').clientHeight let img = new Image() img.src = this.selectingSitePlan.imageUrl; img.onload = function(){ - if (img.height > dadHeight && img.width > imgWidth) { - let width = imgWidth/img.width + if (img.height > dadHeight && img.width > dadWidth) { + let width = dadWidth/img.width let height = dadHeight/img.height that.canvas.setBackgroundScale((width>height? height : width)-0.005) return } else if (img.height > dadHeight) { that.canvas.setBackgroundScale((dadHeight/img.height)-0.005) return - } else if (img.width > imgWidth) { - that.canvas.setBackgroundScale((imgWidth/img.width)-0.005) + } else if (img.width > dadWidth) { + that.canvas.setBackgroundScale((dadWidth/img.width)-0.005) return } }; @@ -1674,6 +1671,7 @@ export class CollectionToolsComponent implements OnInit { let params = {componentId: sessionStorage.getItem('planId')} this.http.get('/api/Disasters',{params:params}).subscribe((data:any)=>{ this.allFirePlan = data + this.getDisposalNode() if (!data.length) { let msg = { name: '灾情', diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 3027b2f..1c9b6ee 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -121,6 +121,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV // 是否登录 public verificationURL = '/ui/plan'; // 验证url地址是否为验证页面 + public verificationURLTwo = '/ui/similarPlans'; // 验证url地址是否为验证页面 count = 0; isLogin() { const token = sessionStorage.getItem('token'); // 判断 是否登录状态 @@ -241,7 +242,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.content.nativeElement.appendChild(this.app.view); const url = this.router.url; // tslint:disable-next-line: no-unused-expression - url === this.verificationURL ? this.isLogin() : null; + url === this.verificationURL || url === this.verificationURLTwo ? this.isLogin() : null; this.createBackgroundImage(); // this.createPreviewSinglePointIcon();