陈鹏飞 4 years ago
parent
commit
64d48b92af
  1. 12
      src/app/plan-audit/wait-examineer/wait-examineer.component.ts
  2. 7
      src/app/statistic-analysis/addUnit/add-unit-one/add-unit-one.component.ts
  3. 10
      src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.html
  4. 4
      src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.ts
  5. 8
      src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.html
  6. 63
      src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts
  7. 79
      src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.ts
  8. 68
      src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts
  9. 5
      src/app/statistic-analysis/compang-info/compang-info.component.ts
  10. 53
      src/app/statistic-analysis/echarts-data.service.ts
  11. 30
      src/app/statistic-analysis/state/page-one/page-one.component.ts
  12. 2
      src/app/statistic-analysis/state/page-two-name/page-two-name.component.ts
  13. 10
      src/app/statistic-analysis/state/page-two-time/page-two-time.component.html
  14. 4
      src/app/statistic-analysis/state/page-two-time/page-two-time.component.ts

12
src/app/plan-audit/wait-examineer/wait-examineer.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-12-25 16:13:50 * @Date: 2020-12-25 16:13:50
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-03-03 15:13:25 * @LastEditTime: 2021-03-10 08:36:31
*/ */
import { Component, Inject, OnInit } from '@angular/core'; import { Component, Inject, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
@ -395,7 +395,9 @@ export class WaitExamineerComponent implements OnInit {
}) })
} }
} }
this.shenheTable=[]
} }
} }
//批量审核 //批量审核
else{ else{
@ -428,11 +430,11 @@ export class WaitExamineerComponent implements OnInit {
this.getAlltabledate() this.getAlltabledate()
}) })
} }
this.shenheTable=[]
} }
} }
this.shenheTable=[]
} }
//拒绝操作 //拒绝操作
refuse(){ refuse(){
@ -488,6 +490,7 @@ export class WaitExamineerComponent implements OnInit {
}) })
} }
} }
this.shenheTable=[]
} }
} }
//批量审核 //批量审核
@ -521,9 +524,10 @@ export class WaitExamineerComponent implements OnInit {
this.getAlltabledate() this.getAlltabledate()
}) })
} }
this.shenheTable=[]
} }
} }
this.shenheTable=[] //this.shenheTable=[]
} }

7
src/app/statistic-analysis/addUnit/add-unit-one/add-unit-one.component.ts

@ -12,12 +12,16 @@ export class AddUnitOneComponent implements OnInit {
constructor(private router: Router,public echartsData:EchartsDataService) { } constructor(private router: Router,public echartsData:EchartsDataService) { }
setTimeoutObj//延时器需要清除 setTimeoutObj//延时器需要清除
buildData=[]
orData
ngOnInit(): void { ngOnInit(): void {
/* this.buildData.push(this.echartsData.getData(null,`/api/StatisticsAnalysis/BuildingTypes`))
this.orData=this.echartsData.getData(null,`/api/StatisticsAnalysis/Companies`) */
this.setTimeoutObj = window.setTimeout(()=>{ this.setTimeoutObj = window.setTimeout(()=>{
this.initCharts("pieone") this.initCharts("pieone")
this.initCharts("pietwo") this.initCharts("pietwo")
},0) },1000)
this.echartsData.eventEmit.subscribe((value: any) => { this.echartsData.eventEmit.subscribe((value: any) => {
if (value == 'echarts') { if (value == 'echarts') {
setTimeout(() => { setTimeout(() => {
@ -42,6 +46,7 @@ export class AddUnitOneComponent implements OnInit {
indexBzt//首页饼状图实例 indexBzt//首页饼状图实例
/* 首页饼状图 */ /* 首页饼状图 */
initCharts(id){ initCharts(id){
this.indexBzt = echarts.init(document.getElementById(id),'walden'); this.indexBzt = echarts.init(document.getElementById(id),'walden');
let options={ let options={
title: { title: {

10
src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.html

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-09-05 13:50:45 * @Date: 2020-09-05 13:50:45
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-01-04 11:09:57 * @LastEditTime: 2021-03-10 15:19:25
--> -->
<div class="box"> <div class="box">
<div class="header"> <div class="header">
@ -17,24 +17,24 @@
<div class="queryField" *ngIf="selectType=='month'"> <div class="queryField" *ngIf="selectType=='month'">
<form #form="ngForm" (ngSubmit)="monthSubmit(form.value)"> <form #form="ngForm" (ngSubmit)="monthSubmit(form.value)">
<span>开始年份:</span> <!-- <span>开始年份:</span>
<mat-form-field> <mat-form-field>
<mat-select [(ngModel)]="selectOneYear" name='selectOneYear'> <mat-select [(ngModel)]="selectOneYear" name='selectOneYear'>
<mat-option *ngFor="let item of years" [value]="item">{{item}}</mat-option> <mat-option *ngFor="let item of years" [value]="item">{{item}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field> -->
<span>开始月份:</span> <span>开始月份:</span>
<mat-form-field> <mat-form-field>
<mat-select [(ngModel)]="selectStartMonth" name='selectStartMonth'> <mat-select [(ngModel)]="selectStartMonth" name='selectStartMonth'>
<mat-option *ngFor="let item of selectMonth" [value]="item">{{item}}</mat-option> <mat-option *ngFor="let item of selectMonth" [value]="item">{{item}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span>结束年份:</span> <!-- <span>结束年份:</span>
<mat-form-field> <mat-form-field>
<mat-select [(ngModel)]="selectTwoYear" name='selectTwoYear'> <mat-select [(ngModel)]="selectTwoYear" name='selectTwoYear'>
<mat-option *ngFor="let item of years" [value]="item">{{item}}</mat-option> <mat-option *ngFor="let item of years" [value]="item">{{item}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field> -->
<span>结束月份:</span> <span>结束月份:</span>
<mat-form-field> <mat-form-field>
<mat-select [(ngModel)]="selectEndMonth" name='selectEndMonth'> <mat-select [(ngModel)]="selectEndMonth" name='selectEndMonth'>

4
src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.ts

@ -20,7 +20,7 @@ export class AddUnitTwoTimeComponent implements OnInit {
setTimeoutObj//延时器需要清除 setTimeoutObj//延时器需要清除
headname headname
ngOnInit(): void { ngOnInit(): void {
//this.dateInit () this.dateInit ()
this.bianli() this.bianli()
this.route.queryParams.subscribe(param=>{ this.route.queryParams.subscribe(param=>{
this.headname=param.level this.headname=param.level
@ -81,7 +81,7 @@ export class AddUnitTwoTimeComponent implements OnInit {
this.snackBar.open('请选择正确时间区段','确定',config); this.snackBar.open('请选择正确时间区段','确定',config);
} }
} }
selectStartYear:any = (new Date()).getFullYear() //开始年份 selectStartYear:any = (new Date()).getFullYear()-1 //开始年份
selectEndYear:any = (new Date()).getFullYear() //结束年份 selectEndYear:any = (new Date()).getFullYear() //结束年份
//按年查询 //按年查询
yearSubmit (e) { yearSubmit (e) {

8
src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.html

@ -1,3 +1,11 @@
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2021-01-11 14:48:05
* @LastEditors: sueRimn
* @LastEditTime: 2021-03-09 16:03:00
-->
<body> <body>
<!--饼状图 --> <!--饼状图 -->
<div id="indexBzt" style="width: 100%;height: 100%;"></div> <div id="indexBzt" style="width: 100%;height: 100%;"></div>

63
src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts

@ -14,9 +14,10 @@ export class BuildingTypeOneComponent implements OnInit {
constructor(private http:HttpClient,private router: Router,public echartsData:EchartsDataService) { } constructor(private http:HttpClient,private router: Router,public echartsData:EchartsDataService) { }
ngOnInit(): void { ngOnInit(): void {
this.echartsData.getData(null,`/api/StatisticsAnalysis/BuildingTypes`)
window.setTimeout(()=>{ window.setTimeout(()=>{
this.initCharts() this.initCharts()
},100) },1000)
} }
ngOnDestroy(): void { ngOnDestroy(): void {
this.indexBzt.clear() this.indexBzt.clear()
@ -27,15 +28,14 @@ export class BuildingTypeOneComponent implements OnInit {
lengthdata=[]//提示数据 lengthdata=[]//提示数据
count=0//总数 count=0//总数
indexData=[]//所有数据 indexData=[]//所有数据
tabledata
initCharts(){ initCharts(){
this.echartsData.getData(null) console.log(this.echartsData.obdata)
console.log(this.echartsData.allDate) this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
this.http.get("/api/StatisticsAnalysis").subscribe((data:any)=>{ for(var i=0;i<this.tabledata[0].buildingTypes.length;i++){
console.log(data) this.lengthdata.push(this.tabledata[0].buildingTypes[i].buildingTypeName)
for(var i=0;i<data.companyStatistics.buildingTypeStatistics.buildingTypes.length;i++){ this.count=this.count+this.tabledata[0].buildingTypes[i].count
this.lengthdata.push(data.companyStatistics.buildingTypeStatistics.buildingTypes[i].buildingTypeName) this.indexData.push(this.tabledata[0].buildingTypes[i])
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')) //JSON.parse(JSON.stringify(this.indexData).replace(/buildingTypeName/g, 'name'))
this.indexData=this.indexData.map(v=>{return {name: v.buildingTypeName,value:v.count,id:v.buildingTypeId}}) this.indexData=this.indexData.map(v=>{return {name: v.buildingTypeName,value:v.count,id:v.buildingTypeId}})
@ -54,7 +54,7 @@ export class BuildingTypeOneComponent implements OnInit {
trigger: 'item', trigger: 'item',
position: this.echartsData.tableTooltipNoShow2, position: this.echartsData.tableTooltipNoShow2,
formatter: (params)=>{ formatter: (params)=>{
//console.log(params) console.log(params)
this.echartsData.biaogeTishiZhi(params.data) this.echartsData.biaogeTishiZhi(params.data)
return this.echartsData.res return this.echartsData.res
@ -72,6 +72,7 @@ export class BuildingTypeOneComponent implements OnInit {
}, },
series: [ series: [
{ {
//top:'15%',
name: '访问来源', name: '访问来源',
type: 'pie', type: 'pie',
radius: '60%', radius: '60%',
@ -99,22 +100,36 @@ export class BuildingTypeOneComponent implements OnInit {
] ]
}; };
this.indexBzt.on('click', (params) => { this.indexBzt.on('click', (params) => {
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_two_reverse'],{queryParams:{'level':params.name}}); if(this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2'){
//总队,支队,大队跳转
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_two_reverse'],{queryParams:{'level':params.name,'id':params.data.id}});
}else if(this.echartsData.level=='3'){
//中队跳转
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1}});
}
}); });
this.indexBzt.setOption(options); this.indexBzt.setOption(options);
})
} }
tishiData tishiData
res:string res:string
biaogeTishiZhi(datas){ biaogeTishiZhi(datas){
let paramsdata:any = { console.log(datas,this.tabledata)
BuildingTypeId:datas.id for(var a in this.tabledata.buildingTypes){
if(this.tabledata.buildingTypes[a].buildingTypeId==datas.id){
this.tishiData=this.tabledata.buildingTypes[a].organizations
}
} }
console.log(this.tishiData)
this.http.get("/api/StatisticsAnalysis/Companies",{params:paramsdata}).subscribe((data:any)=>{ var countall=0//总计
this.tishiData=data var countbi=0//站比
var allCountbi=0//总站比
for(var i=0;i<this.tishiData.length;i++){
countall+=this.tishiData[i].count
}
this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>' this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>'
this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >'; this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='<thead style="font-size:18px;"><tr>'; this.res+='<thead style="font-size:18px;"><tr>';
@ -124,17 +139,19 @@ export class BuildingTypeOneComponent implements OnInit {
this.res+='</tr></thead>' this.res+='</tr></thead>'
this.res+='<tbody>'; this.res+='<tbody>';
//var res='<div class="tishi" style=" width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span >'+biaotou+'</span></div>' //var res='<div class="tishi" style=" width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span >'+biaotou+'</span></div>'
for(var i=0;i<this.tishiData.organizationStatistics.organizations.length;i++){ for(var i=0;i<this.tishiData.length;i++){
countbi=Math.round(this.tishiData[i].count/countall* 10000)/ 100.00
allCountbi=allCountbi+countbi
this.res+='<tr>' this.res+='<tr>'
this.res+='<td style="text-align:center;">'+this.tishiData.organizationStatistics.organizations[i].organizationName+'</td>' this.res+='<td style="text-align:center;">'+this.tishiData[i].organizationName+'</td>'
this.res+='<td style="text-align:center;">'+this.tishiData.organizationStatistics.organizations[i].count+'</td>' this.res+='<td style="text-align:center;">'+this.tishiData[i].count+'</td>'
this.res+='<td style="text-align:center;">10</td></tr>' this.res+='<td style="text-align:center;">'+countbi+'%</td></tr>'
} }
this.res+='</tbody>' this.res+='</tbody>'
this.res+='<tfoot style="font-size:18px;"><td style="text-align:center;">总计</td><td style="text-align:center;">1356</td><td style="text-align:center;">19%</td></tfoot>' this.res+='<tfoot style="font-size:18px;"><td style="text-align:center;">总计</td><td style="text-align:center;">'+countall+'</td><td style="text-align:center;">'+allCountbi.toFixed(2)+'%</td></tfoot>'
this.res+='</table></div></div>' this.res+='</table></div></div>'
return this.res return this.res
})
} }
} }

79
src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.ts

@ -24,17 +24,34 @@ export class BuildingTypeThreeDetailsComponent implements OnInit {
} }
organizationName:String organizationName:String
listorganizationId//上个页面传过来的组织id
buildingTypeName:String buildingTypeName:String
buildingTypeId
organizationId=[]//本层id
ngOnInit(): void { ngOnInit(): void {
this.route.queryParams.subscribe(params => { this.route.queryParams.subscribe(params => {
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.zhongNumData,this.zhongNameData)
this.organizationName = params['organizationName']; this.organizationName = params['organizationName'];
this.buildingTypeName = params['buildingTypeName']; this.buildingTypeName = params['buildingTypeName'];
this.listorganizationId=params['organizationId'];
this.buildingTypeId=params['buildId'];
}); });
let paramsdata={
id:this.buildingTypeId,
organizationId:this.listorganizationId
}
this.echartsData.getData(paramsdata,`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.buildingTypeId}`)
window.setTimeout(()=>{ window.setTimeout(()=>{
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
console.log(this.tabledata)
for(var i=0;i<this.tabledata[0].organizations.length;i++){
this.zhongNameData.push(this.tabledata[0].organizations[i].organizationName)
this.zhongNumData.push(this.tabledata[0].organizations[i].count)
this.organizationId.push(this.tabledata[0].organizations[i].organizationId)
}
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.zhongNumData,this.zhongNameData)
this.detailEcharts() this.detailEcharts()
}) },1000)
} }
ngOnDestroy(): void { ngOnDestroy(): void {
this.detailPlanEchart.clear() this.detailPlanEchart.clear()
@ -50,21 +67,27 @@ export class BuildingTypeThreeDetailsComponent implements OnInit {
fontSize: 12 fontSize: 12
} }
}//柱状图数值顶部显示 }//柱状图数值顶部显示
zhongNameData = ["浦东中队","黄浦中队","徐汇中队","长宁中队","静安中队","普陀中队","虹口中队","杨浦中队","闵行中队","宝山中队","嘉定中队"] zhongNameData = []
zhongNumData = [200,190,180,170,160,150,140,130,120,110,100] zhongNumData = []
tiaoshiPao:any tiaoshiPao:any
detailPlanEchart detailPlanEchart
tabledata
detailEcharts(){ detailEcharts(){
this.detailPlanEchart = echarts.init(document.getElementById('barEchart'),'walden'); this.detailPlanEchart = echarts.init(document.getElementById('barEchart'),'walden');
var option = { var option = {
title: { title: {
text: this.buildingTypeName + '(' +this.organizationName + ')'+':总数(666)', text: this.buildingTypeName + '(' +this.organizationName + ')'+`:总数(${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.zhongNameData, data: this.zhongNameData,
// axisLabel: this.axisLabel // axisLabel: this.axisLabel
@ -109,15 +132,55 @@ export class BuildingTypeThreeDetailsComponent implements OnInit {
}] }]
}; };
this.detailPlanEchart.setOption(option); this.detailPlanEchart.setOption(option);
this.detailPlanEchart.on('click', (params) => { this.detailPlanEchart.getZr().on('click', (params) => {
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1}}); const pointInPixel= [params.offsetX, params.offsetY];
if (this.detailPlanEchart.containPixel('grid',pointInPixel)) {
let xIndex=this.detailPlanEchart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
/*事件处理代码书写位置*/
if(this.echartsData.level=="0"&&this.tiao==false&&this.tabledata[0].organizations.length>1){
//总队不跳转
console.log(params)
this.zhongNameData=[]
this.zhongNumData=[]
this.organizationId=[]
this.tiaoshiPao=''
let paramsdatee={
id:this.buildingTypeId,
organizationId:option.xAxis.id[xIndex]
}
this.echartsData.getData(paramsdatee,`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.buildingTypeId}`)
window.setTimeout(()=>{
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
console.log(this.tabledata)
for(var i=0;i<this.tabledata[0].organizations.length;i++){
this.zhongNameData.push(this.tabledata[0].organizations[i].organizationName)
this.zhongNumData.push(this.tabledata[0].organizations[i].count)
this.organizationId.push(this.tabledata[0].organizations[i].organizationId)
}
option.title.text = this.buildingTypeName + '(' +option.xAxis.data[xIndex]+ ')'+`:总数(${this.tabledata[0].totalCount})`
option.xAxis.data = this.zhongNameData
option.series[0].data = this.zhongNumData
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.zhongNumData,this.zhongNameData)
option.series[0].markPoint.data=this.tiaoshiPao
this.detailPlanEchart.setOption(option)
//this.detailEcharts()
},1000)
this.tiao=true
}
else{
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':option.xAxis.data[xIndex],'type':1,'jsid':option.xAxis.id[xIndex]}});
}
}
}); });
} }
tiao=false
tableTooltip(params:any){ tableTooltip(params:any){
console.log(params)
var data = [ var data = [
{name:params.name,number:params.value,zhanbi:(params.value/1340 * 100).toFixed(2) + "%"} {name:params.name,number:params.value,zhanbi:((params.value/this.tabledata[0].totalCount) * 100).toFixed(2) + "%"}
] ]
var res = '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+params.name+'</span></div>' var res = '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+params.name+'</span></div>'
res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >'; res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';

68
src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts

@ -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:{
@ -290,7 +303,7 @@ export class BuildingTypeTwoReverseComponent implements OnInit {
data: this.zhiNumData, data: this.zhiNumData,
type: 'bar', type: 'bar',
markPoint: { markPoint: {
data: this.tiaoshiPao data:this.tiaoshiPao
}, },
//showBackground: true, //showBackground: true,
backgroundStyle: { backgroundStyle: {
@ -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}});
}
}); });
}) })
})
} }

5
src/app/statistic-analysis/compang-info/compang-info.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2021-03-05 15:57:08 * @Date: 2021-03-05 15:57:08
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-03-06 11:35:04 * @LastEditTime: 2021-03-10 17:02:33
*/ */
import { Component, OnInit, ViewChild, Inject } from '@angular/core'; import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http' import { HttpClient } from '@angular/common/http'
@ -33,6 +33,7 @@ export class CompangInfoComponent implements OnInit{
this.route.queryParams.subscribe(params => { this.route.queryParams.subscribe(params => {
this.titlename = params['name']; this.titlename = params['name'];
this.type = params['type']; this.type = params['type'];
this.jsId=params['jsid']
}); });
this.getAlltabledate() this.getAlltabledate()
} }
@ -40,7 +41,7 @@ export class CompangInfoComponent implements OnInit{
tabledataSource tabledataSource
titlename //上个页面传过来的名称 titlename //上个页面传过来的名称
type //上个页面传过来:1重点单位 2预案 type //上个页面传过来:1重点单位 2预案
jsId=1 //组织机构id jsId //组织机构id
//分页 //分页
@ViewChild(MatPaginator, {static: true}) @ViewChild(MatPaginator, {static: true})
pageEvent: PageEvent; pageEvent: PageEvent;

53
src/app/statistic-analysis/echarts-data.service.ts

@ -11,6 +11,7 @@ export class EchartsDataService {
this.allEcharts=this.http.get("/api/StatisticsAnalysis") this.allEcharts=this.http.get("/api/StatisticsAnalysis")
//return this.allEcharts.data //return this.allEcharts.data
} }
level = sessionStorage.getItem("level");
allEcharts allEcharts
//计划首页 //计划首页
tableShow=false//控制首页表格显隐 tableShow=false//控制首页表格显隐
@ -405,38 +406,37 @@ export class EchartsDataService {
res res
tishiData tishiData
biaogeTishiZhi(datas){ biaogeTishiZhi(datas){
let paramsdata:any = { for(var a in this.obdata[0].buildingTypes){
BuildingTypeId:datas.id if(this.obdata[0].buildingTypes[a].buildingTypeId==datas.id){
this.tishiData=this.obdata[0].buildingTypes[a].organizations
}
} }
//var res console.log(this.tishiData)
this.http.get("/api/StatisticsAnalysis",{params:paramsdata}).subscribe((data:any)=>{ var countall=0//总计
this.tishiData=data var countbi=0//站比
console.log(this.tishiData) var allCountbi=0//总站比
for(var i=0;i<this.tishiData.length;i++){
}) countall+=this.tishiData[i].count
this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>' }
this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>'
this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >'; this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='<thead style="font-size:18px;"><tr>'; this.res+='<thead style="font-size:18px;"><tr>';
this.res+='<td style="text-align:center;width:30%;>名称</td>'; this.res+='<td style="text-align:center;width:30%;">名称</td>';
this.res+='<td style="text-align:center;width:30%;">数量</td>' this.res+='<td style="text-align:center;width:30%;">数量</td>'
this.res+='<td style="text-align:center;width:30%;">总占比</td>' this.res+='<td style="text-align:center;width:30%;">总占比</td>'
this.res+='</tr></thead>' this.res+='</tr></thead>'
this.res+='<tbody>'; this.res+='<tbody>';
var countall=0 for(var i=0;i<this.tishiData.length;i++){
for(var i=0;i<this.tishiData.companyStatistics.organizationStatistics.organizations.length;i++){ countbi=Math.round(this.tishiData[i].count/countall* 10000)/ 100.00
countall+=this.tishiData.companyStatistics.organizationStatistics.organizations[i].count allCountbi=allCountbi+countbi
}
//var res='<div class="tishi" style=" width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span >'+biaotou+'</span></div>'
for(var i=0;i<this.tishiData.companyStatistics.organizationStatistics.organizations.length;i++){
this.res+='<tr>' this.res+='<tr>'
this.res+='<td style="text-align:center;width:30%;">'+this.tishiData.companyStatistics.organizationStatistics.organizations[i].organizationName+'</td>' this.res+='<td style="text-align:center;">'+this.tishiData[i].organizationName+'</td>'
this.res+='<td style="text-align:center;width:30%;">'+this.tishiData.companyStatistics.organizationStatistics.organizations[i].count+'</td>' this.res+='<td style="text-align:center;">'+this.tishiData[i].count+'</td>'
this.res+='<td style="text-align:center;width:30%;">'+Math.round(this.tishiData.companyStatistics.organizationStatistics.organizations[i].count/countall* 10000)/ 100.00 +'%</td></tr>' this.res+='<td style="text-align:center;">'+countbi+'%</td></tr>'
} }
this.res+='</tbody>' this.res+='</tbody>'
this.res+='<tfoot style="font-size:18px;"><td style="text-align:center;">总计</td><td style="text-align:center;">'+this.tishiData.companyStatistics.totalCount+'</td><td style="text-align:center;">100%</td></tfoot>' this.res+='<tfoot style="font-size:18px;"><td style="text-align:center;">总计</td><td style="text-align:center;">'+countall+'</td><td style="text-align:center;">'+allCountbi.toFixed(2)+'%</td></tfoot>'
this.res+='</table></div></div>' this.res+='</table></div></div>'
return this.res return this.res
@ -444,6 +444,7 @@ export class EchartsDataService {
zhiNameData = ["浦东支队","黄浦支队","徐汇支队","长宁支队","静安支队","普陀支队","虹口支队","杨浦支队","闵行支队","宝山支队","嘉定支队","松江支队","金山支队","崇明支队"] zhiNameData = ["浦东支队","黄浦支队","徐汇支队","长宁支队","静安支队","普陀支队","虹口支队","杨浦支队","闵行支队","宝山支队","嘉定支队","松江支队","金山支队","崇明支队"]
zhiNumData = [200,190,180,170,160,150,140,130,120,110,100,90,80,70] zhiNumData = [200,190,180,170,160,150,140,130,120,110,100,90,80,70]
/** /**
* @name: * @name:
@ -468,10 +469,14 @@ export class EchartsDataService {
//获取所有数据 //获取所有数据
allDate=[] allDate=[]
getData(paramsdata){ obdata
this.http.get("/api/StatisticsAnalysis",{params:paramsdata}).subscribe((data:any)=>{ getData(paramsdata,api){
this.allDate=[]
this.obdata=null
this.http.get(api,{params:paramsdata}).subscribe((data:any)=>{
this.allDate.push(data) this.allDate.push(data)
console.log(this.allDate) this.obdata=JSON.parse(JSON.stringify(this.allDate))
console.log(this.obdata)
return this.allDate return this.allDate
}) })
} }

30
src/app/statistic-analysis/state/page-one/page-one.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-09-01 15:24:39 * @Date: 2020-09-01 15:24:39
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2020-12-30 14:06:07 * @LastEditTime: 2021-03-10 14:50:23
*/ */
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
@ -22,9 +22,10 @@ export class PageOneComponent implements OnInit {
constructor(private router: Router,public echartsData:EchartsDataService) { } constructor(private router: Router,public echartsData:EchartsDataService) { }
ngOnInit() { ngOnInit() {
this.echartsData.getData(null,`/api/StatisticsAnalysis/Plans`)
window.setTimeout(()=>{ window.setTimeout(()=>{
this.initCharts() this.initCharts()
},0) },1000)
} }
ngOnDestroy(): void { ngOnDestroy(): void {
this.indexBzt.clear() this.indexBzt.clear()
@ -34,12 +35,18 @@ export class PageOneComponent implements OnInit {
/* 首页饼状图 */ /* 首页饼状图 */
indexBzt indexBzt
tabledata
count
indexData
initCharts(){ initCharts(){
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
console.log(this.tabledata)
var ec = echarts as any; var ec = echarts as any;
this.indexBzt = ec.init(document.getElementById('indexBzt'),'walden'); this.indexBzt = ec.init(document.getElementById('indexBzt'),'walden');
var options={ var options={
title: { title: {
text: '预案状态统计(7005家)', text: `预案状态统计(${this.tabledata[0].totalCount}份)`,
top: "7%", top: "7%",
left: 'center', left: 'center',
textStyle:{ textStyle:{
@ -48,9 +55,10 @@ export class PageOneComponent implements OnInit {
}, },
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
formatter: (params)=>{ /* formatter: (params)=>{
return this.echartsData.biaogeTishiZhi(params.name) console.log(params)
} return this.echartsData.biaogeTishiZhi(params.data)
} */
}, },
legend: { legend: {
orient: 'vertical', orient: 'vertical',
@ -86,11 +94,11 @@ export class PageOneComponent implements OnInit {
}, },
data: [ data: [
{value: 1585, name: '预案新增'}, {value: 45, name: '预案新增'},
{value: 2000, name: '预案审核通过',itemStyle:{color:'#02A7F0'}}, {value: this.tabledata[0].planningStatistics.approvedCount, name: '预案审核通过',itemStyle:{color:'#02A7F0'}},
{value: 2600, name: '预案编制'}, {value: 37, name: '预案编制'},
{value: 1500, name: '预案审核退回'}, {value: this.tabledata[0].planningStatistics.rejectedCount, name: '预案审核退回'},
{value: 1800, name: '预案审核中'} {value: this.tabledata[0].planningStatistics.auditingCount, name: '预案审核中'}
], ],
emphasis: { emphasis: {
itemStyle: { itemStyle: {

2
src/app/statistic-analysis/state/page-two-name/page-two-name.component.ts

@ -88,7 +88,7 @@ export class PageTwoNameComponent implements OnInit {
this.addEchart = echarts.init(document.getElementById('pie'),'walden'); this.addEchart = echarts.init(document.getElementById('pie'),'walden');
var option = { var option = {
title: { title: {
text: _this.headname+"总数(1024)", text: _this.headname+"总数(102)",
left: "center", left: "center",
top: "0", top: "0",
bottom: '100%', bottom: '100%',

10
src/app/statistic-analysis/state/page-two-time/page-two-time.component.html

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-09-05 08:59:24 * @Date: 2020-09-05 08:59:24
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-01-04 11:15:39 * @LastEditTime: 2021-03-10 15:16:52
--> -->
<div class="content"> <div class="content">
@ -19,24 +19,24 @@
<div class="queryField" *ngIf="selectType=='month' && !isQuery && echartsData.statefulInspectionToggle"> <div class="queryField" *ngIf="selectType=='month' && !isQuery && echartsData.statefulInspectionToggle">
<form #form="ngForm" (ngSubmit)="monthSubmit(form.value)"> <form #form="ngForm" (ngSubmit)="monthSubmit(form.value)">
<span>开始年份:</span> <!-- <span>开始年份:</span>
<mat-form-field> <mat-form-field>
<mat-select [(ngModel)]="selectOneYear" name='selectOneYear'> <mat-select [(ngModel)]="selectOneYear" name='selectOneYear'>
<mat-option *ngFor="let item of years" [value]="item">{{item}}</mat-option> <mat-option *ngFor="let item of years" [value]="item">{{item}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field> -->
<span>开始月份:</span> <span>开始月份:</span>
<mat-form-field> <mat-form-field>
<mat-select [(ngModel)]="selectStartMonth" name='selectStartMonth'> <mat-select [(ngModel)]="selectStartMonth" name='selectStartMonth'>
<mat-option *ngFor="let item of selectMonth" [value]="item">{{item}}</mat-option> <mat-option *ngFor="let item of selectMonth" [value]="item">{{item}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span>结束年份:</span> <!-- <span>结束年份:</span>
<mat-form-field> <mat-form-field>
<mat-select [(ngModel)]="selectTwoYear" name='selectTwoYear'> <mat-select [(ngModel)]="selectTwoYear" name='selectTwoYear'>
<mat-option *ngFor="let item of years" [value]="item">{{item}}</mat-option> <mat-option *ngFor="let item of years" [value]="item">{{item}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field> -->
<span>结束月份:</span> <span>结束月份:</span>
<mat-form-field> <mat-form-field>
<mat-select [(ngModel)]="selectEndMonth" name='selectEndMonth'> <mat-select [(ngModel)]="selectEndMonth" name='selectEndMonth'>

4
src/app/statistic-analysis/state/page-two-time/page-two-time.component.ts

@ -214,7 +214,7 @@ export class echartsComponent implements OnInit {
}, },
// 标题 // 标题
title: { title: {
text: '预案统计状态'+':总数(1024)', text: '预案统计状态'+':总数(102)',
top: -4, top: -4,
left: 'center', left: 'center',
subtext:'今年', subtext:'今年',
@ -296,7 +296,7 @@ export class echartsComponent implements OnInit {
// 标题 // 标题
title: { title: {
text: this.headtext+':总数(1024)', text: this.headtext+':总数(102)',
top: -4, top: -4,
left: 'center', left: 'center',
bottom: 100, bottom: 100,

Loading…
Cancel
Save