Browse Source

[修改]建筑类型统计首页华为pad自适应

zhuzhou
chenjingyu 4 years ago
parent
commit
0f3dc476ff
  1. 14
      src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts
  2. 13
      src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts

14
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) { } constructor(private http:HttpClient,private router: Router,public echartsData:EchartsDataService) { }
ngOnInit(): void { 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`) this.echartsData.getData(null,`/api/StatisticsAnalysis/BuildingTypes`)
window.setTimeout(()=>{ window.setTimeout(()=>{
this.initCharts() this.initCharts()
@ -26,6 +31,7 @@ export class BuildingTypeOneComponent implements OnInit {
} }
/* 首页饼状图 */ /* 首页饼状图 */
indexBzt indexBzt
padHw
lengthdata=[]//提示数据 lengthdata=[]//提示数据
count=0//总数 count=0//总数
indexData=[]//所有数据 indexData=[]//所有数据
@ -65,8 +71,8 @@ export class BuildingTypeOneComponent implements OnInit {
}, },
legend: { legend: {
orient: 'vertical', orient: 'vertical',
right: 150, right: this.padHw?150:250,
top:80, top:60,
textStyle:{ textStyle:{
fontSize:18, fontSize:18,
color:"#000000" color:"#000000"
@ -75,7 +81,7 @@ export class BuildingTypeOneComponent implements OnInit {
}, },
series: [ series: [
{ {
//top:'15%', top:this.padHw?'15%':'0',
name: '访问来源', name: '访问来源',
type: 'pie', type: 'pie',
radius: '60%', radius: '60%',

13
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//标题 headname//标题
buildId//建筑id buildId//建筑id
padHw//是否是华为pad
ngOnInit(): void { 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') { if(sessionStorage.getItem('refresh') === 'true') {
sessionStorage.removeItem('refresh'); sessionStorage.removeItem('refresh');
location.reload(); location.reload();
@ -263,15 +270,15 @@ export class BuildingTypeTwoReverseComponent implements OnInit {
title: { title: {
text: this.headname+this.tabledata[0].totalCount, text: this.headname+this.tabledata[0].totalCount,
left: "center", left: "center",
//top: "12", top:this.padHw?"18":"0",
bottom: '510', bottom:this.padHw?"0":'510',
textStyle: { textStyle: {
fontSize: 30 fontSize: 30
} }
}, },
grid: { grid: {
top: 90, top: 90,
bottom: 30 bottom: 30,
}, },
xAxis: { xAxis: {
id:this.organizationId, id:this.organizationId,

Loading…
Cancel
Save