|
|
|
@ -12,10 +12,10 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
|
|
|
|
|
constructor(private router: Router,public data:EchartsDataService,private route:ActivatedRoute) { } |
|
|
|
|
|
|
|
|
|
forward(){ |
|
|
|
|
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':this.headname,'id':this.lastId}}) |
|
|
|
|
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':this.headname,'id':this.lastId,'type':this.zhiorbuild=='zhi'?'zhi':'build'}}) |
|
|
|
|
} |
|
|
|
|
reverse(){ |
|
|
|
|
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time'],{queryParams:{'level':this.headname,'id':this.lastId}}) |
|
|
|
|
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time'],{queryParams:{'level':this.headname,'id':this.lastId,'type':this.zhiorbuild=='zhi'?'zhi':'build'}}) |
|
|
|
|
} |
|
|
|
|
url = "/statisticanalysis/addUnit_one/addUnit_two_type" //当前路由地址
|
|
|
|
|
setTimeoutObj//延时器需要清除
|
|
|
|
@ -23,21 +23,26 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
|
|
|
|
|
lastId |
|
|
|
|
organizationId=[] |
|
|
|
|
buildingTypeId=[] |
|
|
|
|
zhiorbuild |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
//this.data.zuzhiorBuilding=="zhi"
|
|
|
|
|
if(sessionStorage.getItem('refresh') === 'true') { |
|
|
|
|
sessionStorage.removeItem('refresh'); |
|
|
|
|
location.reload(); |
|
|
|
|
} |
|
|
|
|
this.route.queryParams.subscribe(param=>{ |
|
|
|
|
this.headname=param.level |
|
|
|
|
this.lastId=param.id |
|
|
|
|
this.zhiorbuild=param.type |
|
|
|
|
});
|
|
|
|
|
let paramsdata:any = { |
|
|
|
|
id:this.lastId, |
|
|
|
|
//organizationId:'1'
|
|
|
|
|
} |
|
|
|
|
this.data.getData(this.data.zuzhiorBuilding=="zhi"?paramsdata:null,this.data.zuzhiorBuilding=="zhi"?`/api/StatisticsAnalysis/Companies/Organizations/${this.lastId}`:`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.lastId}`) |
|
|
|
|
this.data.getData(this.zhiorbuild=="zhi"?paramsdata:null,this.zhiorbuild=="zhi"?`/api/StatisticsAnalysis/Companies/Organizations/${this.lastId}`:`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.lastId}`) |
|
|
|
|
this.setTimeoutObj = window.setTimeout(()=>{ |
|
|
|
|
this.tabledata=JSON.parse(JSON.stringify(this.data.allDate)) |
|
|
|
|
//console.log(this.tabledata)
|
|
|
|
|
if(this.data.zuzhiorBuilding=="zhi"){ |
|
|
|
|
if(this.zhiorbuild=="zhi"){ |
|
|
|
|
for(var i=0;i<this.tabledata[0].buildingTypes.length;i++){ |
|
|
|
|
this.buildingData.push(this.tabledata[0].buildingTypes[i].buildingTypeName) |
|
|
|
|
this.buildnumData.push(this.tabledata[0].buildingTypes[i].count) |
|
|
|
@ -51,7 +56,7 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.tiaoshiPao=this.data.qipao(this.tiaoshiPao,this.data.zuzhiorBuilding=="zhi"?this.buildnumData:this.zhiNumData,this.data.zuzhiorBuilding=="zhi"?this.buildingData:this.zhiNameData) |
|
|
|
|
this.tiaoshiPao=this.data.qipao(this.tiaoshiPao,this.zhiorbuild=="zhi"?this.buildnumData:this.zhiNumData,this.zhiorbuild=="zhi"?this.buildingData:this.zhiNameData) |
|
|
|
|
//this.initCharts()
|
|
|
|
|
this.barEcharts() |
|
|
|
|
},1000) |
|
|
|
@ -144,7 +149,7 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
|
|
|
|
|
//气泡提示数据获取
|
|
|
|
|
bianli(){ |
|
|
|
|
var arrshuzu='['; |
|
|
|
|
if(this.data.zuzhiorBuilding=="zhi"){ |
|
|
|
|
if(this.zhiorbuild=="zhi"){ |
|
|
|
|
for(var i=0;i<this.buildnumData.length;i++){ |
|
|
|
|
arrshuzu+='{"value":'+this.buildnumData[i]+',"coord":['+i+','+this.buildnumData[i]+'],"name":'+'"'+this.buildingData[i]+'"'+'},' |
|
|
|
|
} |
|
|
|
@ -207,7 +212,7 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
|
|
|
|
|
tooltip: { |
|
|
|
|
trigger: 'item', |
|
|
|
|
formatter: (params)=>{ |
|
|
|
|
return this.data.tableTooltip(this.data.zuzhiorBuilding=="zhi"?this.data.buildingType:this.data.tableDataZhi,params.name) |
|
|
|
|
return this.data.tableTooltip(this.zhiorbuild=="zhi"?this.data.buildingType:this.data.tableDataZhi,params.name) |
|
|
|
|
}, |
|
|
|
|
position: this.data.tableTooltipNoShow2 |
|
|
|
|
}, |
|
|
|
@ -219,7 +224,7 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
|
|
|
|
|
fontSize:18, |
|
|
|
|
color:"#000000" |
|
|
|
|
}, |
|
|
|
|
data:this.data.zuzhiorBuilding=="zhi"? this.zhiNameData:this.buildingData |
|
|
|
|
data:this.zhiorbuild=="zhi"? this.zhiNameData:this.buildingData |
|
|
|
|
}, |
|
|
|
|
series: [ |
|
|
|
|
{ |
|
|
|
@ -238,7 +243,7 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
data:this.data.zuzhiorBuilding=="zhi"? [ |
|
|
|
|
data:this.zhiorbuild=="zhi"? [ |
|
|
|
|
{value: 500, name: this.zhiNameData[0]}, |
|
|
|
|
{value: 800, name: this.zhiNameData[1]}, |
|
|
|
|
{value: 900, name: this.zhiNameData[2]}, |
|
|
|
@ -308,9 +313,9 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
|
|
|
|
|
bottom: 30 |
|
|
|
|
}, |
|
|
|
|
xAxis: { |
|
|
|
|
id:this.data.zuzhiorBuilding=="zhi"?this.buildingTypeId:this.organizationId, |
|
|
|
|
id:this.zhiorbuild=="zhi"?this.buildingTypeId:this.organizationId, |
|
|
|
|
type: 'category', |
|
|
|
|
data:this.data.zuzhiorBuilding=="zhi"?this.buildingData: this.zhiNameData, |
|
|
|
|
data:this.zhiorbuild=="zhi"?this.buildingData: this.zhiNameData, |
|
|
|
|
axisLabel:{ |
|
|
|
|
//this.axisLabel,
|
|
|
|
|
interval: 0, |
|
|
|
@ -335,12 +340,12 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
|
|
|
|
|
tooltip: { |
|
|
|
|
trigger: 'item', |
|
|
|
|
formatter: (params)=>{ |
|
|
|
|
return this.data.zuzhiorBuilding=="zhi"?this.data.biaogeTishiZhi(params): this.data.biaogeTishida(params) |
|
|
|
|
return this.zhiorbuild=="zhi"?this.data.biaogeTishiZhi(params): this.data.biaogeTishida(params) |
|
|
|
|
}, |
|
|
|
|
position: this.data.tableTooltipNoShow2 |
|
|
|
|
}, |
|
|
|
|
series: [{ |
|
|
|
|
data: this.data.zuzhiorBuilding=="zhi"?this.buildnumData: this.zhiNumData, |
|
|
|
|
data: this.zhiorbuild=="zhi"?this.buildnumData: this.zhiNumData, |
|
|
|
|
type: 'bar', |
|
|
|
|
markPoint: { |
|
|
|
|
data: this.tiaoshiPao |
|
|
|
@ -357,10 +362,10 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
|
|
|
|
|
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.zuzhiorBuilding=='zhi'){ |
|
|
|
|
if(this.zhiorbuild=='zhi'){ |
|
|
|
|
if((this.data.level=='0'||this.data.level=='1')&&this.tabledata[0].buildingTypes[xIndex].organizations.length>=1){ |
|
|
|
|
//总队,支队跳转
|
|
|
|
|
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_typeDetails'],{queryParams:{'organizationName':option.xAxis.data[xIndex],'buildingTypeName':this.headname,'id':this.lastId,'zhuId':option.xAxis.id[xIndex]}}) |
|
|
|
|
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_typeDetails'],{queryParams:{'organizationName':option.xAxis.data[xIndex],'buildingTypeName':this.headname,'id':this.lastId,'zhuId':option.xAxis.id[xIndex],'type':this.zhiorbuild=='zhi'?'zhi':'build'}}) |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':option.xAxis.data[xIndex],'type':1,'jsid':this.lastId,'buildid':option.xAxis.id[xIndex]}}); |
|
|
|
@ -368,7 +373,7 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
|
|
|
|
|
}else{ |
|
|
|
|
if((this.data.level=='0'||this.data.level=='1')&&this.tabledata[0].organizations[xIndex].subOrganizations.length>=1){ |
|
|
|
|
//总队,支队跳转
|
|
|
|
|
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_typeDetails'],{queryParams:{'organizationName':option.xAxis.data[xIndex],'buildingTypeName':this.headname,'id':this.lastId,'zhuId':option.xAxis.id[xIndex]}}) |
|
|
|
|
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_typeDetails'],{queryParams:{'organizationName':option.xAxis.data[xIndex],'buildingTypeName':this.headname,'id':this.lastId,'zhuId':option.xAxis.id[xIndex],'type':this.zhiorbuild=='zhi'?'zhi':'build'}}) |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':option.xAxis.data[xIndex],'type':1,'jsid':option.xAxis.id[xIndex],'buildid':this.lastId}}); |
|
|
|
|