|
|
@ -15,22 +15,38 @@ export class AddUnitThreeBarDetailsComponent implements OnInit { |
|
|
|
constructor(private router: Router,public dialog: MatDialog,public snackBar: MatSnackBar,private serviceData: EchartsDataService,public route: ActivatedRoute) { } |
|
|
|
constructor(private router: Router,public dialog: MatDialog,public snackBar: MatSnackBar,private serviceData: EchartsDataService,public route: ActivatedRoute) { } |
|
|
|
time:String |
|
|
|
time:String |
|
|
|
buildingTypeName:String |
|
|
|
buildingTypeName:String |
|
|
|
level:String |
|
|
|
//level:String
|
|
|
|
|
|
|
|
orId//上个页面传过来的组织id
|
|
|
|
|
|
|
|
buildId//上个页面传过来的建筑id
|
|
|
|
|
|
|
|
|
|
|
|
setTimeoutObj//延时器需要清除
|
|
|
|
setTimeoutObj//延时器需要清除
|
|
|
|
|
|
|
|
tabledata |
|
|
|
|
|
|
|
organizationId=[] |
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
|
this.dateInit () |
|
|
|
this.dateInit () |
|
|
|
|
|
|
|
|
|
|
|
this.route.queryParams.subscribe(params => { |
|
|
|
this.route.queryParams.subscribe(params => { |
|
|
|
this.time = params['time']; |
|
|
|
this.time = params['time']; |
|
|
|
this.buildingTypeName = params['buildingTpye']; |
|
|
|
this.buildingTypeName = params['buildingTpye']; |
|
|
|
this.level = params['level']; |
|
|
|
this.buildId=params['id'] |
|
|
|
this.bianli() |
|
|
|
this.orId=params['zhuid'] |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
let paramsdata={ |
|
|
|
|
|
|
|
id:this.buildId, |
|
|
|
|
|
|
|
organizationId:this.orId |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.serviceData.getData(paramsdata,`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.buildId}`) |
|
|
|
this.setTimeoutObj = window.setTimeout(()=>{ |
|
|
|
this.setTimeoutObj = window.setTimeout(()=>{ |
|
|
|
|
|
|
|
this.tabledata=JSON.parse(JSON.stringify(this.serviceData.allDate)) |
|
|
|
|
|
|
|
console.log(this.tabledata) |
|
|
|
|
|
|
|
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.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.zhiNumData,this.zhiNameData) |
|
|
|
this.detailEcharts() |
|
|
|
this.detailEcharts() |
|
|
|
},0) |
|
|
|
},1000) |
|
|
|
} |
|
|
|
} |
|
|
|
ngOnDestroy(){ |
|
|
|
ngOnDestroy(){ |
|
|
|
window.clearTimeout(this.setTimeoutObj); |
|
|
|
window.clearTimeout(this.setTimeoutObj); |
|
|
@ -72,22 +88,15 @@ export class AddUnitThreeBarDetailsComponent implements OnInit { |
|
|
|
zhongNameData = ["浦东中队","黄浦中队","徐汇中队","长宁中队","静安中队","普陀中队","虹口中队","杨浦中队","闵行中队","宝山中队","嘉定中队"] |
|
|
|
zhongNameData = ["浦东中队","黄浦中队","徐汇中队","长宁中队","静安中队","普陀中队","虹口中队","杨浦中队","闵行中队","宝山中队","嘉定中队"] |
|
|
|
zhongNumData = [300,290,280,270,260,250,240,230,220,210,200] |
|
|
|
zhongNumData = [300,290,280,270,260,250,240,230,220,210,200] |
|
|
|
|
|
|
|
|
|
|
|
zhiNameData = ["浦东支队","黄浦支队","徐汇支队","长宁支队","静安支队","普陀支队","虹口支队","杨浦支队","闵行支队","宝山支队","嘉定支队"] |
|
|
|
zhiNameData = [] |
|
|
|
zhiNumData = [300,290,280,270,260,250,240,230,220,210,200] |
|
|
|
zhiNumData = [] |
|
|
|
tiaoshiPao:any |
|
|
|
tiaoshiPao:any |
|
|
|
//气泡提示数据获取
|
|
|
|
//气泡提示数据获取
|
|
|
|
bianli(){ |
|
|
|
bianli(){ |
|
|
|
this.tiaoshiPao=null |
|
|
|
this.tiaoshiPao=null |
|
|
|
var arrshuzu='['; |
|
|
|
var arrshuzu='['; |
|
|
|
if(this.level == 'zhidui'){ |
|
|
|
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]+'"'+'},' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
for(var i=0;i<this.zhongNumData.length;i++){ |
|
|
|
|
|
|
|
arrshuzu+='{"value":'+this.zhongNumData[i]+',"coord":['+i+','+this.zhongNumData[i]+'],"name":'+'"'+this.zhongNameData[i]+'"'+'},' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
arrshuzu=arrshuzu.substring(0,arrshuzu.length-1) |
|
|
|
arrshuzu=arrshuzu.substring(0,arrshuzu.length-1) |
|
|
@ -102,15 +111,20 @@ export class AddUnitThreeBarDetailsComponent implements OnInit { |
|
|
|
this.detailPlanEchart = echarts.init(document.getElementById('barEchart'),'walden');
|
|
|
|
this.detailPlanEchart = echarts.init(document.getElementById('barEchart'),'walden');
|
|
|
|
this.option = { |
|
|
|
this.option = { |
|
|
|
title: { |
|
|
|
title: { |
|
|
|
text: this.time + '(' +this.buildingTypeName + ')'+':总数(666)', |
|
|
|
text: this.time + '' +this.buildingTypeName +`:总数(${this.tabledata[0].totalCount})`, |
|
|
|
left: "center", |
|
|
|
left: "center", |
|
|
|
textStyle: { |
|
|
|
textStyle: { |
|
|
|
fontSize: 30 |
|
|
|
fontSize: 30 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
grid: { |
|
|
|
|
|
|
|
top: 110, |
|
|
|
|
|
|
|
//bottom: 10
|
|
|
|
|
|
|
|
}, |
|
|
|
xAxis: { |
|
|
|
xAxis: { |
|
|
|
|
|
|
|
id:this.organizationId, |
|
|
|
type: 'category', |
|
|
|
type: 'category', |
|
|
|
data:this.level=="zhidui"? this.zhiNameData:this.zhongNameData, |
|
|
|
data:this.zhiNameData, |
|
|
|
axisLabel:{ |
|
|
|
axisLabel:{ |
|
|
|
//this.axisLabel,
|
|
|
|
//this.axisLabel,
|
|
|
|
textStyle:{ |
|
|
|
textStyle:{ |
|
|
@ -154,35 +168,69 @@ export class AddUnitThreeBarDetailsComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
this.detailPlanEchart.setOption(this.option); |
|
|
|
this.detailPlanEchart.setOption(this.option); |
|
|
|
this.detailPlanEchart.on("click",(params)=>{ |
|
|
|
this.detailPlanEchart.getZr().on("click",(params)=>{ |
|
|
|
if(this.level == "zhidui"){//如果是支队则跳转
|
|
|
|
const pointInPixel= [params.offsetX, params.offsetY]; |
|
|
|
// this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time/three_barDetails'],{queryParams:{'level':'zhongdui','time':params.name,'buildingTpye':this.buildingTypeName}});
|
|
|
|
if (this.detailPlanEchart.containPixel('grid',pointInPixel)){ |
|
|
|
this.level = "zhongdui" |
|
|
|
let xIndex=this.detailPlanEchart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0]; |
|
|
|
|
|
|
|
console.log(this.organizationId,this.option.xAxis.id) |
|
|
|
|
|
|
|
if(this.serviceData.level=="0"&&this.tiao==false&&this.tabledata[0].organizations.length>=1){ |
|
|
|
|
|
|
|
//总队不跳
|
|
|
|
|
|
|
|
console.log(params) |
|
|
|
|
|
|
|
this.zhiNameData=[] |
|
|
|
|
|
|
|
this.zhiNumData=[] |
|
|
|
|
|
|
|
this.organizationId=[] |
|
|
|
|
|
|
|
this.tiaoshiPao='' |
|
|
|
|
|
|
|
let paramsdata={ |
|
|
|
|
|
|
|
id:this.buildId, |
|
|
|
|
|
|
|
organizationId:this.option.xAxis.id[xIndex] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.serviceData.getData(paramsdata,`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.buildId}`) |
|
|
|
|
|
|
|
this.setTimeoutObj = window.setTimeout(()=>{ |
|
|
|
|
|
|
|
this.tabledata=JSON.parse(JSON.stringify(this.serviceData.allDate)) |
|
|
|
|
|
|
|
console.log(this.tabledata) |
|
|
|
|
|
|
|
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.option.xAxis.data = this.zhiNameData |
|
|
|
|
|
|
|
this.option.series[0].data = this.zhiNumData |
|
|
|
|
|
|
|
this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.zhiNumData,this.zhiNameData) |
|
|
|
|
|
|
|
this.option.series[0].markPoint.data=this.tiaoshiPao |
|
|
|
|
|
|
|
this.detailPlanEchart.setOption(this.option) |
|
|
|
|
|
|
|
},1000) |
|
|
|
|
|
|
|
this.tiao=true |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
console.log(this.organizationId,this.option.xAxis.id) |
|
|
|
|
|
|
|
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1,'jsid':this.option.xAxis.id[xIndex]}}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/* if(this.serviceData.level == "1"){//如果是支队则跳转 |
|
|
|
this.option.title.text = params.name + '(' +this.buildingTypeName + ')' |
|
|
|
this.option.title.text = params.name + '(' +this.buildingTypeName + ')' |
|
|
|
this.option.xAxis.data = this.zhongNameData |
|
|
|
this.option.xAxis.data = this.zhongNameData |
|
|
|
this.option.series[0].data = this.zhongNumData |
|
|
|
this.option.series[0].data = this.zhongNumData |
|
|
|
this.detailPlanEchart.setOption(this.option) |
|
|
|
this.detailPlanEchart.setOption(this.option) |
|
|
|
}else{ |
|
|
|
} */ |
|
|
|
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1}}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
tiao=false |
|
|
|
//返回按钮
|
|
|
|
//返回按钮
|
|
|
|
backBtn(){ |
|
|
|
backBtn(){ |
|
|
|
if(this.level == "zhongdui"){ |
|
|
|
/* if(this.level == "zhongdui"){ |
|
|
|
this.level = "zhidui" |
|
|
|
this.level = "zhidui" |
|
|
|
this.option.title.text = this.time + '(' +this.buildingTypeName + ')' |
|
|
|
this.option.title.text = this.time + '(' +this.buildingTypeName + ')' |
|
|
|
this.option.xAxis.data = this.zhiNameData |
|
|
|
this.option.xAxis.data = this.zhiNameData |
|
|
|
this.option.series[0].data = this.zhiNumData |
|
|
|
this.option.series[0].data = this.zhiNumData |
|
|
|
this.detailPlanEchart.setOption(this.option) |
|
|
|
this.detailPlanEchart.setOption(this.option) |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
window.history.go(-1) |
|
|
|
|
|
|
|
} |
|
|
|
} */ |
|
|
|
|
|
|
|
window.history.go(-1) |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tableTooltip(params:any){ |
|
|
|
tableTooltip(params:any){ |
|
|
|
var data |
|
|
|
var data |
|
|
|
if(this.level == "zhidui"){ |
|
|
|
if(this.serviceData.level == "1"){ |
|
|
|
data = this.serviceData.tableDataZhong |
|
|
|
data = this.serviceData.tableDataZhong |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
data = [ |
|
|
|
data = [ |
|
|
|