|
|
|
@ -12,13 +12,15 @@ export class AddUnitOneComponent implements OnInit {
|
|
|
|
|
constructor(private router: Router,public echartsData:EchartsDataService) { } |
|
|
|
|
|
|
|
|
|
setTimeoutObj//延时器需要清除
|
|
|
|
|
buildData=[] |
|
|
|
|
orData |
|
|
|
|
tabledata |
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
/* this.buildData.push(this.echartsData.getData(null,`/api/StatisticsAnalysis/BuildingTypes`)) |
|
|
|
|
this.orData=this.echartsData.getData(null,`/api/StatisticsAnalysis/Companies`) */ |
|
|
|
|
this.echartsData.getData(null,`/api/StatisticsAnalysis/Companies`) |
|
|
|
|
this.setTimeoutObj = window.setTimeout(()=>{ |
|
|
|
|
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) |
|
|
|
|
console.log(this.tabledata) |
|
|
|
|
this.initCharts("pieone") |
|
|
|
|
this.initCharts("pietwo") |
|
|
|
|
},1000) |
|
|
|
@ -45,12 +47,27 @@ export class AddUnitOneComponent implements OnInit {
|
|
|
|
|
buildingData=["高层","地下","轨道交通","化工生产","储罐类","厂房","古建筑","商市场","医院","学校","宾馆","娱乐场所","餐饮业","影剧院","展览建筑","隧道"] |
|
|
|
|
indexBzt//首页饼状图实例
|
|
|
|
|
/* 首页饼状图 */ |
|
|
|
|
initCharts(id){ |
|
|
|
|
|
|
|
|
|
this.indexBzt = echarts.init(document.getElementById(id),'walden'); |
|
|
|
|
lengthBuildData=[] |
|
|
|
|
lengthOrData=[] |
|
|
|
|
buildData=[] |
|
|
|
|
orData=[] |
|
|
|
|
initCharts(tid){ |
|
|
|
|
for(var i=0;i<this.tabledata[0].buildingTypeStatistics.buildingTypes.length;i++){ |
|
|
|
|
this.buildData.push(this.tabledata[0].buildingTypeStatistics.buildingTypes[i]) |
|
|
|
|
this.lengthBuildData.push(this.tabledata[0].buildingTypeStatistics.buildingTypes[i].buildingTypeName) |
|
|
|
|
} |
|
|
|
|
for(var i=0;i<this.tabledata[0].organizationStatistics.organizations.length;i++){ |
|
|
|
|
this.orData.push(this.tabledata[0].organizationStatistics.organizations[i]) |
|
|
|
|
this.lengthOrData.push(this.tabledata[0].organizationStatistics.organizations[i].organizationName) |
|
|
|
|
} |
|
|
|
|
console.log(this.buildData) |
|
|
|
|
this.buildData=this.buildData.map(v=>{return {name: v.buildingTypeName,value:v.count,id:v.buildingTypeId}}) |
|
|
|
|
this.orData=this.orData.map(v=>{return {name: v.organizationName,value:v.count,id:v.organizationId}}) |
|
|
|
|
console.log(this.buildData) |
|
|
|
|
this.indexBzt = echarts.init(document.getElementById(tid),'walden'); |
|
|
|
|
let options={ |
|
|
|
|
title: { |
|
|
|
|
text:id=="pieone"? '组织机构统计(8900家)':'建筑类型统计(8900家)', |
|
|
|
|
text:tid=="pieone"? `组织机构统计(${this.tabledata[0].organizationStatistics.totalCount}家)`:`建筑类型统计(${this.tabledata[0].buildingTypeStatistics.totalCount}家)`, |
|
|
|
|
left: 'center', |
|
|
|
|
top: "5%", |
|
|
|
|
textStyle: { |
|
|
|
@ -60,7 +77,8 @@ export class AddUnitOneComponent implements OnInit {
|
|
|
|
|
tooltip: { |
|
|
|
|
trigger: 'item', |
|
|
|
|
formatter: (params)=>{ |
|
|
|
|
return this.echartsData.tableTooltip(id=="pieone"?this.echartsData.buildingType:this.echartsData.tableDataZhi,params.name) |
|
|
|
|
console.log(params) |
|
|
|
|
return this.echartsData.tableTooltip(tid=="pieone"?this.echartsData.buildingType:this.echartsData.tableDataZhi,params.name) |
|
|
|
|
}, |
|
|
|
|
position:this.echartsData.tableTooltipNoShow2 |
|
|
|
|
}, |
|
|
|
@ -72,7 +90,7 @@ export class AddUnitOneComponent implements OnInit {
|
|
|
|
|
fontSize:14, |
|
|
|
|
color:"#000000" |
|
|
|
|
}, |
|
|
|
|
data: id=="pieone"?this.zhiNameData:this.buildingData |
|
|
|
|
data: tid=="pieone"?this.lengthOrData:this.lengthBuildData |
|
|
|
|
}, |
|
|
|
|
series: [ |
|
|
|
|
{ |
|
|
|
@ -91,39 +109,7 @@ export class AddUnitOneComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
data:id=="pieone"?[ |
|
|
|
|
{value: 500, name: this.zhiNameData[0]}, |
|
|
|
|
{value: 800, name: this.zhiNameData[1]}, |
|
|
|
|
{value: 900, name: this.zhiNameData[2]}, |
|
|
|
|
{value: 800, name: this.zhiNameData[3]}, |
|
|
|
|
{value: 1200, name: this.zhiNameData[4]}, |
|
|
|
|
{value: 1500, name: this.zhiNameData[5]}, |
|
|
|
|
{value: 1400, name: this.zhiNameData[6]}, |
|
|
|
|
{value: 600, name: this.zhiNameData[7]}, |
|
|
|
|
{value: 568, name: this.zhiNameData[8]}, |
|
|
|
|
{value: 888, name: this.zhiNameData[9]}, |
|
|
|
|
{value: 485, name: this.zhiNameData[10]}, |
|
|
|
|
{value: 966, name: this.zhiNameData[11]}, |
|
|
|
|
{value: 789, name: this.zhiNameData[12]}, |
|
|
|
|
{value: 500, name: this.zhiNameData[13]}, |
|
|
|
|
|
|
|
|
|
]:[ |
|
|
|
|
{value: 500, name: '高层'}, |
|
|
|
|
{value: 800, name: '地下'}, |
|
|
|
|
{value: 900, name: '轨道交通'}, |
|
|
|
|
{value: 800, name: '化工生产'}, |
|
|
|
|
{value: 1200, name: '储罐类'}, |
|
|
|
|
{value: 1500, name: '厂房'}, |
|
|
|
|
{value: 1400, name: '古建筑'}, |
|
|
|
|
{value: 600, name: '商市场'}, |
|
|
|
|
{value: 568, name: '医院'}, |
|
|
|
|
{value: 888, name: '学校'}, |
|
|
|
|
{value: 485, name: '宾馆'}, |
|
|
|
|
{value: 966, name: '娱乐场所'}, |
|
|
|
|
{value: 789, name: '餐饮业'}, |
|
|
|
|
{value: 500, name: '影剧院'}, |
|
|
|
|
{value: 1025, name: '展览建筑'}, |
|
|
|
|
{value: 600, name: '隧道'}], |
|
|
|
|
data:tid=="pieone"?this.orData:this.buildData, |
|
|
|
|
emphasis: { |
|
|
|
|
itemStyle: { |
|
|
|
|
shadowBlur: 10, |
|
|
|
@ -135,8 +121,15 @@ export class AddUnitOneComponent implements OnInit {
|
|
|
|
|
] |
|
|
|
|
}; |
|
|
|
|
this.indexBzt.on('click', (params) => { |
|
|
|
|
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':params.name}}); |
|
|
|
|
id=="pieone"?this.echartsData.zuzhiorBuilding="zhi":this.echartsData.zuzhiorBuilding="building" |
|
|
|
|
if(this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2'){ |
|
|
|
|
//总队,支队,大队跳转
|
|
|
|
|
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':params.name,'id':params.data.id}}); |
|
|
|
|
}else{ |
|
|
|
|
//中队跳转
|
|
|
|
|
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1}}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
tid=="pieone"?this.echartsData.zuzhiorBuilding="zhi":this.echartsData.zuzhiorBuilding="building" |
|
|
|
|
}); |
|
|
|
|
this.indexBzt.setOption(options); |
|
|
|
|
} |
|
|
|
|