From 0f3dc476ff45f5149b2c6055feb8fdd1e7be9731 Mon Sep 17 00:00:00 2001 From: chenjingyu Date: Mon, 29 Mar 2021 13:46:13 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E5=BB=BA=E7=AD=91=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E7=BB=9F=E8=AE=A1=E9=A6=96=E9=A1=B5=E5=8D=8E=E4=B8=BA?= =?UTF-8?q?pad=E8=87=AA=E9=80=82=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../building-type-one.component.ts | 14 ++++++++++---- .../building-type-two-reverse.component.ts | 13 ++++++++++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts b/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts index 2768d0c..42c8ee2 100644 --- a/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts +++ b/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts @@ -14,7 +14,12 @@ export class BuildingTypeOneComponent implements OnInit { constructor(private http:HttpClient,private router: Router,public echartsData:EchartsDataService) { } ngOnInit(): void { - + if(window.matchMedia("(max-width: 1300px)").matches&&window.matchMedia("(max-height: 700px)").matches){ + this.padHw=true + //this.padjt= + }else{ + this.padHw=false + } this.echartsData.getData(null,`/api/StatisticsAnalysis/BuildingTypes`) window.setTimeout(()=>{ this.initCharts() @@ -26,6 +31,7 @@ export class BuildingTypeOneComponent implements OnInit { } /* 首页饼状图 */ indexBzt + padHw lengthdata=[]//提示数据 count=0//总数 indexData=[]//所有数据 @@ -65,8 +71,8 @@ export class BuildingTypeOneComponent implements OnInit { }, legend: { orient: 'vertical', - right: 150, - top:80, + right: this.padHw?150:250, + top:60, textStyle:{ fontSize:18, color:"#000000" @@ -75,7 +81,7 @@ export class BuildingTypeOneComponent implements OnInit { }, series: [ { - //top:'15%', + top:this.padHw?'15%':'0', name: '访问来源', type: 'pie', radius: '60%', diff --git a/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts b/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts index 3c59913..490c9b9 100644 --- a/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts +++ b/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts @@ -20,7 +20,14 @@ export class BuildingTypeTwoReverseComponent implements OnInit { } headname//标题 buildId//建筑id + padHw//是否是华为pad ngOnInit(): void { + if(window.matchMedia("(max-width: 1300px)").matches&&window.matchMedia("(max-height: 700px)").matches){ + this.padHw=true + //this.padjt= + }else{ + this.padHw=false + } if(sessionStorage.getItem('refresh') === 'true') { sessionStorage.removeItem('refresh'); location.reload(); @@ -263,15 +270,15 @@ export class BuildingTypeTwoReverseComponent implements OnInit { title: { text: this.headname+this.tabledata[0].totalCount, left: "center", - //top: "12", - bottom: '510', + top:this.padHw?"18":"0", + bottom:this.padHw?"0":'510', textStyle: { fontSize: 30 } }, grid: { top: 90, - bottom: 30 + bottom: 30, }, xAxis: { id:this.organizationId,