|
|
@ -19,15 +19,29 @@ export class BuildingTypeTwoReverseComponent implements OnInit { |
|
|
|
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_two_reverse']) |
|
|
|
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_two_reverse']) |
|
|
|
} |
|
|
|
} |
|
|
|
headname//标题
|
|
|
|
headname//标题
|
|
|
|
|
|
|
|
buildId//建筑id
|
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
|
this.route.queryParams.subscribe(param=>{ |
|
|
|
this.route.queryParams.subscribe(param=>{ |
|
|
|
this.headname=param.level |
|
|
|
this.headname=param.level |
|
|
|
|
|
|
|
this.buildId=param.id |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
let paramsdata:any = { |
|
|
|
|
|
|
|
id:this.buildId, |
|
|
|
|
|
|
|
organizationId:'1' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.data.getData(paramsdata,`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.buildId}`) |
|
|
|
window.setTimeout(()=>{ |
|
|
|
window.setTimeout(()=>{ |
|
|
|
|
|
|
|
this.tabledata=JSON.parse(JSON.stringify(this.data.allDate)) |
|
|
|
|
|
|
|
for(var i=0;i<this.tabledata[0].organizations.length;i++){ |
|
|
|
|
|
|
|
this.zhiNameData.push(this.tabledata[0].organizations[i].organizationName) |
|
|
|
|
|
|
|
this.zhiNumData.push(this.tabledata[0].organizations[i].count) |
|
|
|
|
|
|
|
this.organizationId.push(this.tabledata[0].organizations[i].organizationId) |
|
|
|
|
|
|
|
} |
|
|
|
this.bianli() |
|
|
|
this.bianli() |
|
|
|
//this.initCharts()
|
|
|
|
|
|
|
|
this.barEcharts() |
|
|
|
this.barEcharts() |
|
|
|
},0) |
|
|
|
|
|
|
|
|
|
|
|
},1000); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
ngOnDestroy(): void { |
|
|
|
ngOnDestroy(): void { |
|
|
|
/* this.indexBzt.clear() |
|
|
|
/* this.indexBzt.clear() |
|
|
@ -110,11 +124,12 @@ export class BuildingTypeTwoReverseComponent implements OnInit { |
|
|
|
{name:"松江中队",number:"75",zhanbi:"0.5%"}, |
|
|
|
{name:"松江中队",number:"75",zhanbi:"0.5%"}, |
|
|
|
{name:"金山中队",number:"65",zhanbi:"0.4%"}, |
|
|
|
{name:"金山中队",number:"65",zhanbi:"0.4%"}, |
|
|
|
{name:"崇明中队",number:"55",zhanbi:"0.3%"} ] |
|
|
|
{name:"崇明中队",number:"55",zhanbi:"0.3%"} ] |
|
|
|
zhiNameData = ["浦东支队","黄浦支队","徐汇支队","长宁支队","静安支队","普陀支队","虹口支队","杨浦支队","闵行支队","宝山支队","嘉定支队","松江支队","金山支队","崇明支队"] |
|
|
|
zhiNameData = [] |
|
|
|
zhiNumData = [200,190,180,170,160,150,140,130,120,110,100,90,80,70] |
|
|
|
zhiNumData = [] |
|
|
|
tiaoshiPao:any |
|
|
|
tiaoshiPao:any |
|
|
|
//气泡提示数据获取
|
|
|
|
//气泡提示数据获取
|
|
|
|
bianli(){ |
|
|
|
bianli(){ |
|
|
|
|
|
|
|
console.log(this.zhiNameData,this.zhiNumData) |
|
|
|
var arrshuzu='['; |
|
|
|
var arrshuzu='['; |
|
|
|
for(var i=0;i<this.zhiNumData.length;i++){ |
|
|
|
for(var i=0;i<this.zhiNumData.length;i++){ |
|
|
|
arrshuzu+='{"value":'+this.zhiNumData[i]+',"coord":['+i+','+this.zhiNumData[i]+'],"name":'+'"'+this.zhiNameData[i]+'"'+'},' |
|
|
|
arrshuzu+='{"value":'+this.zhiNumData[i]+',"coord":['+i+','+this.zhiNumData[i]+'],"name":'+'"'+this.zhiNameData[i]+'"'+'},' |
|
|
@ -122,7 +137,7 @@ export class BuildingTypeTwoReverseComponent implements OnInit { |
|
|
|
arrshuzu=arrshuzu.substring(0,arrshuzu.length-1) |
|
|
|
arrshuzu=arrshuzu.substring(0,arrshuzu.length-1) |
|
|
|
arrshuzu+=']' |
|
|
|
arrshuzu+=']' |
|
|
|
this.tiaoshiPao=JSON.parse(arrshuzu) |
|
|
|
this.tiaoshiPao=JSON.parse(arrshuzu) |
|
|
|
//return tishiPao
|
|
|
|
console.log(this.tiaoshiPao) |
|
|
|
} |
|
|
|
} |
|
|
|
forArr = [{id:'gaoceng',name:'高层',echart:null}, |
|
|
|
forArr = [{id:'gaoceng',name:'高层',echart:null}, |
|
|
|
{id:'dixia',name:'地下',echart:null}, |
|
|
|
{id:'dixia',name:'地下',echart:null}, |
|
|
@ -232,30 +247,28 @@ export class BuildingTypeTwoReverseComponent implements OnInit { |
|
|
|
lengthdata=[]//提示数据
|
|
|
|
lengthdata=[]//提示数据
|
|
|
|
count=0//总数
|
|
|
|
count=0//总数
|
|
|
|
indexData=[]//所有数据
|
|
|
|
indexData=[]//所有数据
|
|
|
|
|
|
|
|
organizationId=[] |
|
|
|
|
|
|
|
tabledata |
|
|
|
barEcharts(){ |
|
|
|
barEcharts(){ |
|
|
|
this.http.get("/api/StatisticsAnalysis").subscribe((data:any)=>{ |
|
|
|
|
|
|
|
for(var i=0;i<data.companyStatistics.buildingTypeStatistics.buildingTypes.length;i++){ |
|
|
|
|
|
|
|
this.lengthdata.push(data.companyStatistics.buildingTypeStatistics.buildingTypes[i].buildingTypeName) |
|
|
|
|
|
|
|
this.count=this.count+data.companyStatistics.buildingTypeStatistics.buildingTypes[i].count |
|
|
|
|
|
|
|
this.indexData.push(data.companyStatistics.buildingTypeStatistics.buildingTypes[i]) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//JSON.parse(JSON.stringify(this.indexData).replace(/buildingTypeName/g, 'name'))
|
|
|
|
|
|
|
|
this.indexData=this.indexData.map(v=>{return {name: v.buildingTypeName,value:v.count}}) |
|
|
|
|
|
|
|
console.log(data) |
|
|
|
|
|
|
|
this.forArr.forEach(item=>{ |
|
|
|
this.forArr.forEach(item=>{ |
|
|
|
let _this = this |
|
|
|
let _this = this |
|
|
|
item.echart = echarts.init(document.getElementById('gaoceng'),'walden'); |
|
|
|
item.echart = echarts.init(document.getElementById('gaoceng'),'walden'); |
|
|
|
let option = { |
|
|
|
let option = { |
|
|
|
title: { |
|
|
|
title: { |
|
|
|
text: this.headname+':总数(1024)', |
|
|
|
text: this.headname+this.tabledata[0].totalCount, |
|
|
|
left: "center", |
|
|
|
left: "center", |
|
|
|
top: "15", |
|
|
|
//top: "12",
|
|
|
|
//bottom: '80',
|
|
|
|
bottom: '510', |
|
|
|
textStyle: { |
|
|
|
textStyle: { |
|
|
|
fontSize: 30 |
|
|
|
fontSize: 30 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
grid: { |
|
|
|
|
|
|
|
top: 90, |
|
|
|
|
|
|
|
bottom: 30 |
|
|
|
}, |
|
|
|
}, |
|
|
|
xAxis: { |
|
|
|
xAxis: { |
|
|
|
|
|
|
|
id:this.organizationId, |
|
|
|
type: 'category', |
|
|
|
type: 'category', |
|
|
|
data: this.zhiNameData, |
|
|
|
data: this.zhiNameData, |
|
|
|
axisLabel:{ |
|
|
|
axisLabel:{ |
|
|
@ -301,11 +314,24 @@ export class BuildingTypeTwoReverseComponent implements OnInit { |
|
|
|
}] |
|
|
|
}] |
|
|
|
}; |
|
|
|
}; |
|
|
|
item.echart.setOption(option); |
|
|
|
item.echart.setOption(option); |
|
|
|
item.echart.on('click', (params) => { |
|
|
|
item.echart.getZr().on('click', (params) => { |
|
|
|
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_three_details'],{queryParams:{'organizationName':params.name,'buildingTypeName':this.headname}}) |
|
|
|
const pointInPixel= [params.offsetX, params.offsetY]; |
|
|
|
|
|
|
|
if (item.echart.containPixel('grid',pointInPixel)) { |
|
|
|
|
|
|
|
let xIndex=item.echart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0]; |
|
|
|
|
|
|
|
/*事件处理代码书写位置*/ |
|
|
|
|
|
|
|
if(this.data.level=='0'||this.data.level=='1'){ |
|
|
|
|
|
|
|
//总队,支队跳转
|
|
|
|
|
|
|
|
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_three_details'],{queryParams:{'organizationName':option.xAxis.data[xIndex],'buildingTypeName':this.headname,'buildId':this.buildId,'organizationId':option.xAxis.id[xIndex]}}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1}}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//this.router.navigate(['/statisticanalysis/delete_one/delete_four'],{queryParams:{'level':this.option.xAxis.data[xIndex]+headName}});
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|