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) { }
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%',

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//标题
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,

Loading…
Cancel
Save