Browse Source

[合并]合并代码

zhuzhou
邵佳豪 4 years ago
parent
commit
4b32c26ecc
  1. 1
      src/app/key-unit/basicinfo-look/basicinfo.component.html
  2. 9
      src/app/key-unit/basicinfo-look/basicinfo.component.ts
  3. 1
      src/app/key-unit/basicinfo/basicinfo.component.html
  4. 30
      src/app/key-unit/basicinfo/basicinfo.component.ts
  5. 4
      src/app/key-unit/basicinfo/statisticsOfFireFightingFacilities.html
  6. 15
      src/app/key-unit/edit-plan-info/edit-plan-info.component.html
  7. 13
      src/app/key-unit/edit-plan-info/edit-plan-info.component.scss
  8. 5
      src/app/key-unit/edit-plan-info/edit-plan-info.component.ts
  9. 4
      src/app/key-unit/key-unit.module.ts
  10. 12
      src/app/key-unit/view-unit-details/view-unit-details.component.html
  11. 13
      src/app/key-unit/view-unit-details/view-unit-details.component.scss
  12. 10
      src/app/key-unit/view-unit-details/view-unit-details.component.ts
  13. 12
      src/app/plan-audit/wait-examineer/wait-examineer.component.ts
  14. 160
      src/app/statistic-analysis/addUnit/add-unit-one/add-unit-one.component.ts
  15. 12
      src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.html
  16. 113
      src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.ts
  17. 12
      src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.html
  18. 46
      src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.ts
  19. 10
      src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.html
  20. 146
      src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.ts
  21. 54
      src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.ts
  22. 65
      src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.ts
  23. 8
      src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.html
  24. 64
      src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts
  25. 143
      src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.ts
  26. 135
      src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts
  27. 5
      src/app/statistic-analysis/compang-info/compang-info.component.ts
  28. 157
      src/app/statistic-analysis/echarts-data.service.ts
  29. 39
      src/app/statistic-analysis/state/page-one/page-one.component.ts
  30. 6
      src/app/statistic-analysis/state/page-there-year/page-there-year.component.html
  31. 32
      src/app/statistic-analysis/state/page-there-year/page-there-year.component.ts
  32. 6
      src/app/statistic-analysis/state/page-there/page-there.component.html
  33. 55
      src/app/statistic-analysis/state/page-there/page-there.component.ts
  34. 352
      src/app/statistic-analysis/state/page-two-name/page-two-name.component.ts
  35. 10
      src/app/statistic-analysis/state/page-two-time/page-two-time.component.html
  36. 635
      src/app/statistic-analysis/state/page-two-time/page-two-time.component.ts
  37. 37
      src/app/statistic-analysis/state/page-zhong-dui-details/page-zhong-dui-details.component.ts
  38. 49
      src/app/ui/collection-tools-building/collection-tools.component.html
  39. 11
      src/app/ui/collection-tools-building/collection-tools.component.scss
  40. 43
      src/app/ui/collection-tools-building/collection-tools.component.ts
  41. 12
      src/app/ui/collection-tools-building/panel.scss
  42. 43
      src/app/ui/collection-tools-plan/collection-tools.component.html
  43. 22
      src/app/ui/collection-tools-plan/collection-tools.component.ts
  44. 12
      src/app/ui/collection-tools-plan/panel.scss
  45. 45
      src/app/ui/collection-tools/collection-tools.component.html
  46. 10
      src/app/ui/collection-tools/collection-tools.component.scss
  47. 39
      src/app/ui/collection-tools/collection-tools.component.ts
  48. 12
      src/app/ui/collection-tools/panel.scss

1
src/app/key-unit/basicinfo-look/basicinfo.component.html

@ -6,6 +6,7 @@
<mat-panel-title>
单位信息
</mat-panel-title>
<button type="button" color="primary" mat-button mat-raised-button style="height: 35px; margin-right: 25px;" (click)="seeFirfightingDevice($event)">查看消防设施统计</button>
</mat-expansion-panel-header>
<div class="topbox">
<form (ngSubmit)="onSubmit(form.value,form.invalid,form)" #form="ngForm" class="example-container">

9
src/app/key-unit/basicinfo-look/basicinfo.component.ts

@ -18,6 +18,7 @@ import * as _ from 'lodash';
import Swiper from 'swiper';
import { LookMaster2 } from './lookmaster.component'
import { ActivatedRoute } from '@angular/router';
import { StatisticsOfFireFightingFacilities } from '../basicinfo/basicinfo.component';
declare var AMap: any;
@Component({
@ -26,6 +27,14 @@ declare var AMap: any;
styleUrls: ['./basicinfo.component.scss']
})
export class BasicinfoLookComponent implements OnInit {
//查看消防设施统计
seeFirfightingDevice (e) {
e.stopPropagation()
let dialogRef = this.dialog.open(StatisticsOfFireFightingFacilities);
dialogRef.afterClosed().subscribe();
}
unitinfo:any={
id: '',
name: '', //单位信息名字

1
src/app/key-unit/basicinfo/basicinfo.component.html

@ -6,6 +6,7 @@
<mat-panel-title>
单位信息
</mat-panel-title>
<button type="button" color="primary" mat-button mat-raised-button style="height: 35px; margin-right: 25px;" (click)="seeFirfightingDevice($event)">查看消防设施统计</button>
</mat-expansion-panel-header>
<div class="topbox">
<form (ngSubmit)="onSubmit(form.value,form.invalid,form)" #form="ngForm" class="example-container">

30
src/app/key-unit/basicinfo/basicinfo.component.ts

@ -28,6 +28,14 @@ declare var AMap: any;
styleUrls: ['./basicinfo.component.scss']
})
export class BasicinfoComponent implements OnInit {
//查看消防设施统计
seeFirfightingDevice (e) {
e.stopPropagation()
let dialogRef = this.dialog.open(StatisticsOfFireFightingFacilities);
dialogRef.afterClosed().subscribe();
}
unitinfo:any={
id: '',
name: '', //单位信息名字
@ -1154,4 +1162,26 @@ export class BasicinfoComponent implements OnInit {
this.houses[key].data = data
})
}
}
//消防设施统计
@Component({
selector: 'app-StatisticsOfFireFightingFacilities',
templateUrl: './statisticsOfFireFightingFacilities.html',
styleUrls: ['./basicinfo.component.scss']
})
export class StatisticsOfFireFightingFacilities implements OnInit {
constructor(private http: HttpClient, public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
let params = { companyId: sessionStorage.getItem('companyId'),buildingType: sessionStorage.getItem('buildingTypeId') }
this.http.get(`/api/CompanyFacilities/GetAllFacilities`,{params}).subscribe(data=>{
Object.keys(data).forEach(key => { this.allFireList.push(`${key} ${data[key]}`) })
})
}
allFireList = []
}

4
src/app/key-unit/basicinfo/statisticsOfFireFightingFacilities.html

@ -0,0 +1,4 @@
<div mat-dialog-title>消防设施统计</div>
<div>
<p style="margin: 5px 0; font-size: 14px;" *ngFor="let item of allFireList">{{item}}</p>
</div>

15
src/app/key-unit/edit-plan-info/edit-plan-info.component.html

@ -1,7 +1,14 @@
<mat-tab-group selectedIndex="0" style="height: 100%;" >
<div class="fixedPrompt">
<label class="scorePrompt" *ngIf="selected.value == 0"><label style="color: red;">*</label>单位信息,建筑信息填写完整可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 1"><label style="color: red;">*</label>单位毗邻模块标注完整可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 2"><label style="color: red;">*</label>消防设施,重点部位模块标注完整可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 3"><label style="color: red;">*</label>总平面图模块标注完整可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 4 || selected.value == 5"><label style="color: red;">*</label>层平面图模块标注完整可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 6"><label style="color: red;">*</label>填写2条以上可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 9"><label style="color: red;">*</label>外观,室内,安全出口上传图片可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 10"><label style="color: red;">*</label>上传2张CAD图片可得满分</label>
</div>
<mat-tab-group style="height: 100%;" [selectedIndex]="selected.value" (selectedIndexChange)="selected.setValue($event)">
<mat-tab label="1.基本信息">
<ng-template matTabContent>
<app-basicinfo></app-basicinfo>

13
src/app/key-unit/edit-plan-info/edit-plan-info.component.scss

@ -1,3 +1,16 @@
.mat-tab-body-wrapper{
height: 100%!important;
}
.fixedPrompt {
position: relative;
width: 100%;
height: 0px;
.scorePrompt {
width: 100%;
text-align: center;
position: absolute;
top: 35px;
font-size: 16px;
z-index: 111;
}
}

5
src/app/key-unit/edit-plan-info/edit-plan-info.component.ts

@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
@Component({
selector: 'app-edit-plan-info',
@ -9,7 +10,7 @@ export class EditPlanInfoComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
ngOnInit(): void { }
selected = new FormControl(0);
}

4
src/app/key-unit/key-unit.module.ts

@ -48,7 +48,7 @@ import { ViewUnitDetailsComponent } from './view-unit-details/view-unit-details.
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { AddHouseInfo } from './basicinfo/addhouseinfo.component';
import { LookMaster } from './basicinfo/lookmaster.component';
import { BasicinfoComponent } from './basicinfo/basicinfo.component';
import { BasicinfoComponent, StatisticsOfFireFightingFacilities } from './basicinfo/basicinfo.component';
import { EditPlanInfoComponent } from './edit-plan-info/edit-plan-info.component';
import { CountdownModule } from 'ngx-countdown';
import { BasicinfoLookComponent } from './basicinfo-look/basicinfo.component';
@ -88,7 +88,7 @@ import { upname } from './key-unit-management/key-unit-management.component';
import { companyAuditResult } from './key-unit-management/key-unit-management.component'
@NgModule({
declarations: [KeyUnitManagementComponent, EditUnitInfoComponent, ViewUnitDetailsComponent,CreateUnit,BasicinfoComponent,LookMaster,AddHouseInfo, EditPlanInfoComponent,BasicinfoLookComponent, ViewUnitDetailsPlanComponent,FunctionDivisionComponent,addPartition,addPartitionAttribute,AllaroundComponent,ImgDetails,RealisticPictureComponent,previewImg,addRealPicture,editRealPicture,KeySiteComponent,KeyImgDetail,KeySiteImgs,UploadingCADComponent,readFile,editFile,KeySiteLookComponent,KeySiteImgs2,FunctionDivisionLookComponent,RealisticPictureLookComponent,previewImg3,UploadingCADLookComponent,FireFightingDeviceComponent,ImagesData,previewBigImg,ImgsDataDetail,FireFightingDeviceLookComponent,ImagesData2,ImgsDataDetail2,previewBigImg2,LookMaster2,addPartitionAttribute2, SixFamiliarityComponent, ActualCombatDrillComponent,routerMapComponent, SixFamiliarListComponent,TrainingRecordinfoComponent,RouterGISComponent,WaterRoadComponent,PhotoofthesceneComponent,KnowRouteComponent,FindProblemComponent,upname,companyAuditResult],
declarations: [KeyUnitManagementComponent, EditUnitInfoComponent, ViewUnitDetailsComponent,CreateUnit,BasicinfoComponent,LookMaster,AddHouseInfo, EditPlanInfoComponent,BasicinfoLookComponent, ViewUnitDetailsPlanComponent,FunctionDivisionComponent,addPartition,addPartitionAttribute,AllaroundComponent,ImgDetails,RealisticPictureComponent,previewImg,addRealPicture,editRealPicture,KeySiteComponent,KeyImgDetail,KeySiteImgs,UploadingCADComponent,readFile,editFile,KeySiteLookComponent,KeySiteImgs2,FunctionDivisionLookComponent,RealisticPictureLookComponent,previewImg3,UploadingCADLookComponent,FireFightingDeviceComponent,ImagesData,previewBigImg,ImgsDataDetail,FireFightingDeviceLookComponent,ImagesData2,ImgsDataDetail2,previewBigImg2,LookMaster2,addPartitionAttribute2, SixFamiliarityComponent, ActualCombatDrillComponent,routerMapComponent, SixFamiliarListComponent,TrainingRecordinfoComponent,RouterGISComponent,WaterRoadComponent,PhotoofthesceneComponent,KnowRouteComponent,FindProblemComponent,upname,companyAuditResult,StatisticsOfFireFightingFacilities],
exports:[ViewUnitDetailsPlanComponent],
imports: [
CommonModule,

12
src/app/key-unit/view-unit-details/view-unit-details.component.html

@ -1,4 +1,14 @@
<mat-tab-group selectedIndex="0" style="height:99%;" (selectedTabChange)="selectedtab($event)">
<div class="fixedPrompt">
<label class="scorePrompt" *ngIf="selected.value == 0"><label style="color: red;">*</label>单位信息,建筑信息填写完整可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 1"><label style="color: red;">*</label>单位毗邻模块标注完整可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 2"><label style="color: red;">*</label>消防设施,重点部位模块标注完整可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 3"><label style="color: red;">*</label>总平面图模块标注完整可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 4 || selected.value == 5"><label style="color: red;">*</label>层平面图模块标注完整可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 6"><label style="color: red;">*</label>填写2条以上可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 9"><label style="color: red;">*</label>外观,室内,安全出口上传图片可得满分</label>
<label class="scorePrompt" *ngIf="selected.value == 10"><label style="color: red;">*</label>上传2张CAD图片可得满分</label>
</div>
<mat-tab-group style="height:100%;" [selectedIndex]="selected.value" (selectedIndexChange)="selected.setValue($event)">
<mat-tab label="1.基本信息">
<ng-template matTabContent>
<app-basicinfo-look></app-basicinfo-look>

13
src/app/key-unit/view-unit-details/view-unit-details.component.scss

@ -1,3 +1,16 @@
.mat-tab-body-wrapper{
height: 100%!important;
}
.fixedPrompt {
position: relative;
width: 100%;
height: 0px;
.scorePrompt {
width: 100%;
text-align: center;
position: absolute;
top: 35px;
font-size: 16px;
z-index: 111;
}
}

10
src/app/key-unit/view-unit-details/view-unit-details.component.ts

@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
@Component({
selector: 'app-view-unit-details',
@ -9,10 +10,7 @@ export class ViewUnitDetailsComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
selectedtab(e){
sessionStorage.setItem("tabsindex",e.index)
}
ngOnInit(): void { }
selected = new FormControl(0);
}

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

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

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

@ -12,12 +12,18 @@ export class AddUnitOneComponent implements OnInit {
constructor(private router: Router,public echartsData:EchartsDataService) { }
setTimeoutObj//延时器需要清除
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")
},0)
},1000)
this.echartsData.eventEmit.subscribe((value: any) => {
if (value == 'echarts') {
setTimeout(() => {
@ -41,11 +47,25 @@ 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)
}
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}})
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: {
@ -55,7 +75,9 @@ 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 tid=="pieone"?this.biaogeTishi(params.data,'one'):this.biaogeTishi(params.data,'two')
//return this.echartsData.tableTooltip(tid=="pieone"?this.echartsData.buildingType:this.echartsData.tableDataZhi,params.name)
},
position:this.echartsData.tableTooltipNoShow2
},
@ -67,7 +89,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: [
{
@ -86,39 +108,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,
@ -130,40 +120,72 @@ 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);
}
biaogeTishi(biaotou:string){
var shuju='[{"name":"浦东支队","number":"156","zhanbi":"3%"},{"name":"黄浦支队","number":"144","zhanbi":"2.8%"},'
shuju+='{"name":"徐汇支队","number":"133","zhanbi":"2.1%"},{"name":"长宁支队","number":"122","zhanbi":"1.6%"},'
shuju+='{"name":"静安支队","number":"120","zhanbi":"1.3%"},{"name":"普陀支队","number":"100","zhanbi":"1.1%"},'
shuju+='{"name":"虹口支队","number":"95","zhanbi":"1%"},{"name":"杨浦支队","number":"90","zhanbi":"0.9%"},'
shuju+='{"name":"闵行支队","number":"88","zhanbi":"0.8%"},{"name":"宝山支队","number":"83","zhanbi":"0.7%"},'
shuju+='{"name":"徐汇支队","number":"133","zhanbi":"2.1%"},{"name":"长宁支队","number":"122","zhanbi":"1.6%"},'
shuju+='{"name":"嘉定支队","number":"78","zhanbi":"0.6%"},{"name":"松江支队","number":"75","zhanbi":"0.5%"},'
shuju+='{"name":"金山支队","number":"65","zhanbi":"0.4%"},{"name":"崇明支队","number":"55","zhanbi":"0.3%"}]'
var jsonObj = JSON.parse(shuju);
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:#000000;font-size:30px;text-align: center;display:block;">'+biaotou+'</span></div>'
res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px; background:#FFFFFF; color:#000000;border-collapse:collapse;"cellspacing="0"; >';
res+='<thead><tr>';
res+='<td style="text-align:center;width:30%;border:1px solid #000000">名称</td>';
res+='<td style="text-align:center;width:30%;border:1px solid #000000">数量</td>'
res+='<td style="text-align:center;width:30%;border:1px solid #000000">总占比</td>'
res+='</tr></thead>'
res+='<tbody>';
for(var i=0;i<jsonObj.length;i++){
res+='<tr>'
res+='<td style="text-align:center;border:1px solid #000000">'+jsonObj[i].name+'</td>'
res+='<td style="text-align:center;border:1px solid #000000">'+jsonObj[i].number+'</td>'
res+='<td style="text-align:center;border:1px solid #000000">'+jsonObj[i].zhanbi+'</td></tr>'
res
tishiData
biaogeTishi(datas,type){
console.log(datas)
this.res=''
this.tishiData=''
if(type=='two'){
for(var a in this.echartsData.obdata[0].buildingTypeStatistics.buildingTypes){
if(this.echartsData.obdata[0].buildingTypeStatistics.buildingTypes[a].buildingTypeName==datas.name){
this.tishiData=this.echartsData.obdata[0].buildingTypeStatistics.buildingTypes[a].organizations
}
}
}else{
for(var a in this.echartsData.obdata[0].organizationStatistics.organizations){
if(this.echartsData.obdata[0].organizationStatistics.organizations[a].organizationId==datas.id){
this.tishiData=this.echartsData.obdata[0].organizationStatistics.organizations[a].buildingTypes
}
res+='</tbody>'
res+='<tfoot><td style="text-align:center;border:1px solid #000000">总计</td><td style="text-align:center;border:1px solid #000000">1356</td><td style="text-align:center;border:1px solid #000000">19%</td></tfoot>'
res+='</table></div></div>'
return res
}
}
console.log(this.tishiData)
var countall=0//总计
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+='</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+='<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+='<tbody>';
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>'
if(type=='two'){
this.res+='<td style="text-align:center;">'+this.tishiData[i].organizationName+'</td>'
}
else{
this.res+='<td style="text-align:center;">'+this.tishiData[i].buildingTypeName+'</td>'
}
this.res+='<td style="text-align:center;">'+this.tishiData[i].count+'</td>'
this.res+='<td style="text-align:center;">'+countbi+'%</td></tr>'
}
this.res+='</tbody>'
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>'
return this.res
}

12
src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.html

@ -1,6 +1,14 @@
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2020-12-24 10:59:48
* @LastEditors: sueRimn
* @LastEditTime: 2021-03-13 17:10:44
-->
<div class="box">
<div class="header">
<div class="queryField">
<!-- <div class="queryField">
<form #form="ngForm" (ngSubmit)="Submit(form.value)">
<span>查询年份:</span>
<mat-form-field>
@ -16,7 +24,7 @@
</mat-form-field>
<button type="submit" mat-raised-button color="primary">查询</button>
</form>
</div>
</div> -->
<div class="btnbox">
<button mat-stroked-button (click)="backBtn()">返回</button>

113
src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.ts

@ -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) { }
time:String
buildingTypeName:String
level:String
//level:String
orId//上个页面传过来的组织id
buildId//上个页面传过来的建筑id
setTimeoutObj//延时器需要清除
tabledata
organizationId=[]
ngOnInit(): void {
this.dateInit ()
this.route.queryParams.subscribe(params => {
this.time = params['time'];
this.buildingTypeName = params['buildingTpye'];
this.level = params['level'];
this.bianli()
this.buildId=params['id']
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.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()
},0)
},1000)
}
ngOnDestroy(){
window.clearTimeout(this.setTimeoutObj);
@ -72,22 +88,15 @@ export class AddUnitThreeBarDetailsComponent implements OnInit {
zhongNameData = ["浦东中队","黄浦中队","徐汇中队","长宁中队","静安中队","普陀中队","虹口中队","杨浦中队","闵行中队","宝山中队","嘉定中队"]
zhongNumData = [300,290,280,270,260,250,240,230,220,210,200]
zhiNameData = ["浦东支队","黄浦支队","徐汇支队","长宁支队","静安支队","普陀支队","虹口支队","杨浦支队","闵行支队","宝山支队","嘉定支队"]
zhiNumData = [300,290,280,270,260,250,240,230,220,210,200]
zhiNameData = []
zhiNumData = []
tiaoshiPao:any
//气泡提示数据获取
bianli(){
this.tiaoshiPao=null
var arrshuzu='[';
if(this.level == 'zhidui'){
for(var i=0;i<this.zhiNumData.length;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]+'"'+'},'
}
for(var i=0;i<this.zhiNumData.length;i++){
arrshuzu+='{"value":'+this.zhiNumData[i]+',"coord":['+i+','+this.zhiNumData[i]+'],"name":'+'"'+this.zhiNameData[i]+'"'+'},'
}
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.option = {
title: {
text: this.time + '(' +this.buildingTypeName + ')'+':总数(666)',
text: this.time + '' +this.buildingTypeName +`:总数(${this.tabledata[0].totalCount})`,
left: "center",
textStyle: {
fontSize: 30
}
},
grid: {
top: 110,
//bottom: 10
},
xAxis: {
id:this.organizationId,
type: 'category',
data:this.level=="zhidui"? this.zhiNameData:this.zhongNameData,
data:this.zhiNameData,
axisLabel:{
//this.axisLabel,
textStyle:{
@ -134,7 +148,7 @@ export class AddUnitThreeBarDetailsComponent implements OnInit {
tooltip: {
trigger: 'item',
formatter: (params)=>{
return this.tableTooltip(params)
return this.tiao==false? this.serviceData.biaogeTishida(params):this.tableTooltip(params)
},
position:this.serviceData.tableTooltipNoShowq
},
@ -154,35 +168,72 @@ export class AddUnitThreeBarDetailsComponent implements OnInit {
};
this.detailPlanEchart.setOption(this.option);
this.detailPlanEchart.on("click",(params)=>{
if(this.level == "zhidui"){//如果是支队则跳转
// this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time/three_barDetails'],{queryParams:{'level':'zhongdui','time':params.name,'buildingTpye':this.buildingTypeName}});
this.level = "zhongdui"
this.detailPlanEchart.getZr().on("click",(params)=>{
const pointInPixel= [params.offsetX, params.offsetY];
if (this.detailPlanEchart.containPixel('grid',pointInPixel)){
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[xIndex].subOrganizations.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.title.text =this.option.xAxis.data[xIndex]+`:总数(${this.tabledata[0].totalCount})`
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.option.xAxis.id=this.organizationId
this.detailPlanEchart.clear()
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':this.option.xAxis.data[xIndex],'type':1,'jsid':this.option.xAxis.id[xIndex]}});
}
}
/* if(this.serviceData.level == "1"){//
this.option.title.text = params.name + '(' +this.buildingTypeName + ')'
this.option.xAxis.data = this.zhongNameData
this.option.series[0].data = this.zhongNumData
this.detailPlanEchart.setOption(this.option)
}else{
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1}});
}
} */
})
}
tiao=false
//返回按钮
backBtn(){
if(this.level == "zhongdui"){
/* if(this.level == "zhongdui"){
this.level = "zhidui"
this.option.title.text = this.time + '(' +this.buildingTypeName + ')'
this.option.xAxis.data = this.zhiNameData
this.option.series[0].data = this.zhiNumData
this.detailPlanEchart.setOption(this.option)
}else{
window.history.go(-1)
}
} */
window.history.go(-1)
}
tableTooltip(params:any){
var data
if(this.level == "zhidui"){
if(this.serviceData.level == "1"){
data = this.serviceData.tableDataZhong
}else{
data = [
@ -205,7 +256,7 @@ export class AddUnitThreeBarDetailsComponent implements OnInit {
}
res+='</tbody>'
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>'
res+='<tfoot style="font-size:18px;"><td style="text-align:center;">总计</td><td style="text-align:center;">'+this.tabledata[0].totalCount+'</td><td style="text-align:center;">100%</td></tfoot>'
res+='</table></div></div>'
return res
}

12
src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.html

@ -1,6 +1,14 @@
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2020-12-24 10:59:48
* @LastEditors: sueRimn
* @LastEditTime: 2021-03-13 16:21:26
-->
<div class="box">
<div class="header">
<div class="queryField">
<!-- <div class="queryField">
<form #form="ngForm" (ngSubmit)="Submit(form.value)">
<span>查询年份:</span>
<mat-form-field>
@ -10,7 +18,7 @@
</mat-form-field>
<button type="submit" mat-raised-button color="primary">查询</button>
</form>
</div>
</div> -->
<div class="btnbox">
<button mat-stroked-button (click)="backBtn()">返回</button>

46
src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.ts

@ -18,16 +18,18 @@ export class AddUnitThreeLineDetailsComponent implements OnInit {
level:String
setTimeoutObj//延时器需要清除
qopao
lastId
ngOnInit(): void {
this.qopao=this.serviceData.qipao(this.qopao,this.dateNum,this.zhiNameData)
this.serviceData.selectType=0
this.dateInit ()
this.route.queryParams.subscribe(params => {
this.year = params['year'];
this.buildingTypeName = params['buildingType'];
this.lastId=params['id']
});
this.setTimeoutObj = window.setTimeout(()=>{
this.detailEcharts()
})
this.getdata()
},1000)
}
ngOnDestroy(){
@ -35,6 +37,37 @@ export class AddUnitThreeLineDetailsComponent implements OnInit {
this.detailPlanEchart.clear()
this.detailPlanEchart.dispose()
}
tabledata
zongcount=0
getdata(){
let parzhi={
BuildingTypeId:this.lastId,
TrendType:this.serviceData.selectType,
//TrendYear:this.year||''
}
let parbuild={
OrganizationId:this.lastId,
TrendType:this.serviceData.selectType,
//TrendYear:this.year||''
}
this.serviceData.getData(this.serviceData.zuzhiorBuilding=='zhi'?parbuild:parzhi,`/api/StatisticsAnalysis`)
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].companyStatistics.trendStatistics.added.length;i++){
if(this.tabledata[0].companyStatistics.trendStatistics.added[i].month>=this.serviceData.selectStartMonth||this.tabledata[0].companyStatistics.trendStatistics.added[i].month<=this.serviceData.selectEndMonth){
this.date.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].month)
this.dateNum.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].count)
this.zongcount=this.zongcount+this.tabledata[0].companyStatistics.trendStatistics.added[i].count
}
}
//this.oneInit (this.date,this.dateNum)
this.qopao=this.serviceData.qipao(this.qopao,this.dateNum,this.zhiNameData)
this.detailEcharts()
}, 1000);
}
selectType:string = 'month'; //选择当前的 查询类型 按月/年
@ -75,8 +108,8 @@ export class AddUnitThreeLineDetailsComponent implements OnInit {
detailPlanEchart
option
date = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月','9月']
dateNum = [270, 253, 244, 199, 189, 173, 160, 198,200]
date = []
dateNum = []
detailEcharts(){
this.detailPlanEchart = echarts.init(document.getElementById('barEchart'), 'skinUpp');
@ -171,7 +204,8 @@ export class AddUnitThreeLineDetailsComponent implements OnInit {
if (this.detailPlanEchart.containPixel('grid',pointInPixel)) {
let xIndex=this.detailPlanEchart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
/*事件处理代码书写位置*/
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time/three_barDetails'],{queryParams:{'level':'zhidui','time':this.option.xAxis.data[xIndex],'buildingTpye':this.buildingTypeName}});
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':this.buildingTypeName,'id':this.lastId}})
//this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time/three_barDetails'],{queryParams:{'level':'zhidui','time':this.option.xAxis.data[xIndex],'buildingTpye':this.buildingTypeName}});
}
});
}

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

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

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

@ -10,25 +10,24 @@ declare var echarts: any;
styleUrls: ['./add-unit-two-time.component.scss']
})
export class AddUnitTwoTimeComponent implements OnInit {
forward(){
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':this.headname}})
}
reverse(){
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time'],{queryParams:{'level':this.headname}})
}
constructor(private router: Router,public dialog: MatDialog,public snackBar: MatSnackBar,private serviceData: EchartsDataService,private route:ActivatedRoute) { }
setTimeoutObj//延时器需要清除
headname
type=1
lastId
tabledata
zongcount=0
ngOnInit(): void {
//this.dateInit ()
this.bianli()
console.log(this.serviceData.zuzhiorBuilding)
this.serviceData.selectType=0
this.dateInit ()
this.route.queryParams.subscribe(param=>{
this.headname=param.level
//this.type=param.type
this.lastId=param.id
});
this.setTimeoutObj = setTimeout(() => {
//this.oneInit (this.date,this.dateNum)
this.twoInit (this.date,this.dateNum,'month')
}, 0);
this.getdata()
}
ngOnDestroy(){
window.clearTimeout(this.setTimeoutObj);
@ -38,17 +37,54 @@ export class AddUnitTwoTimeComponent implements OnInit {
})
}
//获取数据
yeardatee
getdata(){
let parzhi={
BuildingTypeId:this.lastId,
TrendType:this.serviceData.selectType,
TrendYear:this.yeardatee||''
}
let parbuild={
OrganizationId:this.lastId,
TrendType:this.serviceData.selectType,
TrendYear:this.yeardatee||''
}
this.serviceData.getData(this.serviceData.zuzhiorBuilding=='zhi'?parbuild:parzhi,`/api/StatisticsAnalysis`)
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].companyStatistics.trendStatistics.added.length;i++){
if(this.tabledata[0].companyStatistics.trendStatistics.added[i].month>=this.serviceData.selectStartMonth||this.tabledata[0].companyStatistics.trendStatistics.added[i].month<=this.serviceData.selectEndMonth){
this.date.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].month)
this.dateNum.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].count)
this.zongcount=this.zongcount+this.tabledata[0].companyStatistics.trendStatistics.added[i].count
}
}
//this.oneInit (this.date,this.dateNum)
this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum,this.date)
this.twoInit (this.date,this.dateNum,'month')
}, 1000);
}
forward(){
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':this.headname,'id':this.lastId}})
}
reverse(){
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time'],{queryParams:{'level':this.headname,'id':this.lastId}})
}
selectType:string = 'month'; //选择当前的 查询类型 按月/年
//查询数据
years:any = []
years:any = [2020,2021]
selectMonth:any = [1,2,3,4,5,6,7,8,9,10,11,12]
//日期初始化
dateInit () {
let date = (new Date()).getFullYear()
for (let i=date; i>=date-10;i--) {
this.years.unshift(i)
//this.years.unshift(i)
}
}
selectOneYear:any = (new Date()).getFullYear() //开始年份
@ -57,31 +93,34 @@ export class AddUnitTwoTimeComponent implements OnInit {
selectEndMonth:any = (new Date()).getMonth()+1 //结束月份
//按月查询
monthSubmit (e) {
if (e.selectTwoYear > e.selectOneYear) {
this.serviceData.selectStartMonth=this.selectStartMonth
this.serviceData.selectEndMonth=this.selectEndMonth
console.log(this.selectStartMonth,this.selectEndMonth)
this.date=[]
this.dateNum=[]
this.zongcount=0
if (e.selectEndMonth>=e.selectStartMonth) {
let startTime = e.selectOneYear + '-' + e.selectStartMonth + '-' + 1 + ' ' + 0 + ':' + 0 +':'+ 0
let endTime = e.selectTwoYear + '-' + e.selectEndMonth + '-' + 31 + ' ' + 23 + ':' + 59 +':'+ 59
//console.log(startTime)
//console.log(endTime)
} else if (e.selectTwoYear === e.selectOneYear) {
if(e.selectEndMonth >= e.selectStartMonth) {
let startTime = e.selectOneYear + '-' + e.selectStartMonth + '-' + 1 + ' ' + 0 + ':' + 0 +':'+ 0
let endTime = e.selectTwoYear + '-' + e.selectEndMonth + '-' + 31 + ' ' + 23 + ':' + 59 +':'+ 59
//console.log(startTime)
//console.log(endTime)
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择正确时间区段','确定',config);
for(var i=0;i<this.tabledata[0].companyStatistics.trendStatistics.added.length;i++){
if(this.tabledata[0].companyStatistics.trendStatistics.added[i].month>=this.serviceData.selectStartMonth&&this.tabledata[0].companyStatistics.trendStatistics.added[i].month<=this.serviceData.selectEndMonth){
this.date.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].month)
this.dateNum.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].count)
this.zongcount=this.zongcount+this.tabledata[0].companyStatistics.trendStatistics.added[i].count
}
}
}else {
console.log(this.dateNum)
//this.oneInit (this.date,this.dateNum)
this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum,this.date)
this.twoInit (this.date,this.dateNum,'month')
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择正确时间区段','确定',config);
}
}
selectStartYear:any = (new Date()).getFullYear() //开始年份
selectStartYear:any = (new Date()).getFullYear()-1 //开始年份
selectEndYear:any = (new Date()).getFullYear() //结束年份
//按年查询
yearSubmit (e) {
@ -105,11 +144,29 @@ export class AddUnitTwoTimeComponent implements OnInit {
})
if(this.selectType == "year"){
this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum2,this.date2)
//this.oneInit(this.date2,this.dateNum2)
this.twoInit(this.date2,this.dateNum2,'year')
this.zongcount=0
this.serviceData.selectType=2
let paramdata={
BuildingTypeId:this.lastId,
TrendType:this.serviceData.selectType
}
this.serviceData.getData(paramdata,`/api/StatisticsAnalysis`)
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].companyStatistics.trendStatistics.added.length;i++){
this.dateNum2.push(this.tabledata[0].companyStatistics.trendStatistics.added[0].count)
this.zongcount=this.zongcount+this.tabledata[0].companyStatistics.trendStatistics.added[i].count
}
this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum,this.date)
this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum2,this.date2)
this.twoInit (this.date2,this.dateNum2,'year')
}, 1000);
/* this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum2,this.date2)
this.twoInit(this.date2,this.dateNum2,'year') */
}
if(this.selectType == "month"){
this.serviceData.selectType=0
this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum,this.date)
//this.oneInit(this.date,this.dateNum)
this.twoInit(this.date,this.dateNum,'month')
@ -151,8 +208,8 @@ export class AddUnitTwoTimeComponent implements OnInit {
{id:'suidao',name:'隧道',echart:null}]
date = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月','9月']
dateNum = [270, 253, 244, 199, 189, 173, 160, 198,200]
date = []
dateNum = []
tiaoshiPao:any
//气泡提示数据获取
bianli(){
@ -167,8 +224,8 @@ export class AddUnitTwoTimeComponent implements OnInit {
//return tishiPao
}
date2 = ['2019', '2020']
dateNum2 = [220, 180]
date2 = ['2020', '2021']
dateNum2 = [0]
//新增数量统计
oneInit (date,dateNum) {
@ -271,7 +328,7 @@ export class AddUnitTwoTimeComponent implements OnInit {
},
// 标题
title: {
text: this.headname+':总数(1012)',
text: this.headname+`:总数(${this.zongcount}`,
top: -4,
left: 'center',
textStyle:{
@ -355,9 +412,18 @@ export class AddUnitTwoTimeComponent implements OnInit {
/*事件处理代码书写位置*/
// console.log(option.series[0].data[xIndex],option.xAxis.data[xIndex],option.title.text,option.series[0].name)
if(option.series[0].name == "year"){
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time/three_lineDetails'],{queryParams:{'year':this.date2[xIndex],'buildingType':this.headname}});
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time/three_lineDetails'],{queryParams:{'year':this.date2[xIndex],'buildingType':this.headname,'id':this.lastId}});
/* this.selectType="month"
this.yeardatee=option.xAxis.data[xIndex]
this.getdata() */
}else{
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time/three_barDetails'],{queryParams:{'level':'zhidui','time':option.xAxis.data[xIndex],'buildingTpye':this.headname}});
if(this.serviceData.level=='0'||this.serviceData.level=='1'||this.serviceData.level=='2'){
//this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time/three_barDetails'],{queryParams:{'level':'zhidui','time':option.xAxis.data[xIndex],'buildingTpye':this.headname}});
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':this.headname,'id':this.lastId}})
}
}
}

54
src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.ts

@ -28,15 +28,33 @@ export class AddUnitTwoTypeDetailsComponent implements OnInit {
organizationName:String
buildingTypeName:String
setTimeoutObj//延时器需要清除
lastId
canshuId
tabledata
thisorId=[]
ngOnInit(): void {
this.bianli()
this.route.queryParams.subscribe(params => {
this.organizationName = params['organizationName'];
this.buildingTypeName = params['buildingTypeName'];
this.lastId=params['id']
this.canshuId=params['zhuId']
});
let paramsdata:any = {
//id:this.echartsData.zuzhiorBuilding=='zhi'? this.canshuId:this.lastId,
organizationId:this.echartsData.zuzhiorBuilding=='zhi'?this.lastId:this.canshuId
}
this.echartsData.getData(paramsdata,`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.echartsData.zuzhiorBuilding=='zhi'?this.canshuId:this.lastId}`)
this.setTimeoutObj = 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.thisorId.push(this.tabledata[0].organizations[i].organizationId)
}
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.zhongNumData,this.zhongNameData)
this.detailEcharts()
})
},1000)
}
ngOnDestroy(){
window.clearTimeout(this.setTimeoutObj);
@ -53,18 +71,22 @@ export class AddUnitTwoTypeDetailsComponent implements OnInit {
fontSize: 12
}
}//柱状图数值顶部显示
zhongNameData = ["浦东中队","黄浦中队","徐汇中队","长宁中队","静安中队","普陀中队","虹口中队","杨浦中队","闵行中队","宝山中队","嘉定中队"]
zhongNumData = [200,190,180,170,160,150,140,130,120,110,100]
zhongNameData = []
zhongNumData = []
tiaoshiPao:any
//气泡提示数据获取
bianli(){
var arrshuzu='[';
console.log(this.zhongNumData)
if(this.zhongNumData.length>=1){
var arrshuzu='[';
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+=']'
this.tiaoshiPao=JSON.parse(arrshuzu)
}
//return tishiPao
}
@ -73,7 +95,7 @@ export class AddUnitTwoTypeDetailsComponent implements OnInit {
this.detailPlanEchart = echarts.init(document.getElementById('barEchart'),'walden');
var option = {
title: {
text: this.buildingTypeName + '(' +this.organizationName + ')'+':总数(666)',
text: this.buildingTypeName + '(' +this.organizationName + ')'+`:总数(${this.tabledata[0].totalCount})`,
left: "center",
bottom: "500",
textStyle: {
@ -81,6 +103,7 @@ export class AddUnitTwoTypeDetailsComponent implements OnInit {
}
},
xAxis: {
id:this.thisorId,
type: 'category',
data: this.zhongNameData,
axisLabel:{
@ -106,7 +129,7 @@ export class AddUnitTwoTypeDetailsComponent implements OnInit {
tooltip: {
trigger: 'item',
formatter: (params)=>{
return this.tableTooltip(params)
return this.echartsData.biaogeTishida(params)
}
},
series: [{
@ -124,11 +147,18 @@ export class AddUnitTwoTypeDetailsComponent implements OnInit {
}]
};
this.detailPlanEchart.setOption(option);
this.detailPlanEchart.on('click', (params) => {
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1}});
/* const dialogRef = this.dialog.open(CompangInfoComponent, {
width:"400px",
}); */
this.detailPlanEchart.getZr().on('click', (params) => {
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.echartsData.level=='1'){
//总队和支队跳转
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time/three_barDetails'],{queryParams:{'time':'','buildingTpye':option.xAxis.data[xIndex]+this.organizationName,'zhuid':option.xAxis.id[xIndex],'id':this.canshuId}});
}else{
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1}});
}
}
});
}

65
src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.ts

@ -12,23 +12,49 @@ 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}})
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':this.headname,'id':this.lastId}})
}
reverse(){
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time'],{queryParams:{'level':this.headname}})
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time'],{queryParams:{'level':this.headname,'id':this.lastId}})
}
url = "/statisticanalysis/addUnit_one/addUnit_two_type" //当前路由地址
setTimeoutObj//延时器需要清除
headname
lastId
organizationId=[]
buildingTypeId=[]
ngOnInit(): void {
//this.data.zuzhiorBuilding=="zhi"
this.route.queryParams.subscribe(param=>{
this.headname=param.level
this.lastId=param.id
});
let paramsdata:any = {
id:this.lastId,
//organizationId:'1'
}
this.data.getData(paramsdata,this.data.zuzhiorBuilding=="zhi"?`/api/StatisticsAnalysis/Companies/Organizations/${this.lastId}`:`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.lastId}`)
this.setTimeoutObj = window.setTimeout(()=>{
this.bianli()
this.tabledata=JSON.parse(JSON.stringify(this.data.allDate))
console.log(this.tabledata)
if(this.data.zuzhiorBuilding=="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)
this.buildingTypeId.push(this.tabledata[0].buildingTypes[i].buildingTypeId)
}
}else{
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.data.qipao(this.tiaoshiPao,this.data.zuzhiorBuilding=="zhi"?this.buildnumData:this.zhiNumData,this.data.zuzhiorBuilding=="zhi"?this.buildingData:this.zhiNameData)
//this.initCharts()
this.barEcharts()
},0)
},1000)
}
ngOnDestroy(){
window.clearTimeout(this.setTimeoutObj);
@ -112,8 +138,8 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
{name:"松江中队",number:"75",zhanbi:"0.5%"},
{name:"金山中队",number:"65",zhanbi:"0.4%"},
{name:"崇明中队",number:"55",zhanbi:"0.3%"} ]
zhiNameData = ["浦东支队","黄浦支队","徐汇支队","长宁支队","静安支队","普陀支队","虹口支队","杨浦支队","闵行支队","宝山支队","嘉定支队","松江支队","金山支队","崇明支队"]
zhiNumData = [200,190,180,170,160,150,140,130,120,110,100,90,80,70]
zhiNameData = []
zhiNumData = []
tiaoshiPao:any
//气泡提示数据获取
bianli(){
@ -163,8 +189,8 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
{id:'yingyuan',name:'影剧院',echart:null},
{id:'zhanlan',name:'展览建筑',echart:null},
{id:'suidao',name:'隧道',echart:null}]
buildingData=["高层","地下","轨道交通","化工生产","储罐类","厂房","古建筑","商市场","医院","学校","宾馆","娱乐场所","餐饮业","影剧院","展览建筑","隧道"]
buildnumData=[200,190,180,170,160,150,140,130,120,110,100,90,80,70,60,50,40]
buildingData=[]
buildnumData=[]
indexBzt //顶部饼状图
/* 顶部饼状图 */
initCharts(){
@ -261,13 +287,15 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
this.indexBzt.setOption(options);
}
//柱状图
tabledata
barEcharts(){
this.forArr.forEach(item=>{
let _this = this
item.echart = echarts.init(document.getElementById('gaoceng'),'walden');
let option = {
title: {
text: this.headname+':总数(1024)',
text: this.headname+`:总数(${this.tabledata[0].totalCount}`,
left: "center",
top: "0",
//bottom: '80%',
@ -276,6 +304,7 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
}
},
xAxis: {
id:this.data.zuzhiorBuilding=="zhi"?this.buildingTypeId:this.organizationId,
type: 'category',
data:this.data.zuzhiorBuilding=="zhi"?this.buildingData: this.zhiNameData,
axisLabel:{
@ -302,7 +331,7 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
tooltip: {
trigger: 'item',
formatter: (params)=>{
return this.tableTooltip(this.tableDataZhong,params.name)
return this.data.zuzhiorBuilding=="zhi"?this.data.biaogeTishiZhi(params): this.data.biaogeTishida(params)
},
position: this.data.tableTooltipNoShow2
},
@ -320,8 +349,20 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
}]
};
item.echart.setOption(option);
item.echart.on('click', (params) => {
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_typeDetails'],{queryParams:{'organizationName':params.name,'buildingTypeName':this.headname}})
item.echart.getZr().on('click', (params) => {
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/addUnit_one/addUnit_two_typeDetails'],{queryParams:{'organizationName':option.xAxis.data[xIndex],'buildingTypeName':this.headname,'id':this.lastId,'zhuId':option.xAxis.id[xIndex]}})
}
else{
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1}});
}
}
});
})

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>
<!--饼状图 -->
<div id="indexBzt" style="width: 100%;height: 100%;"></div>

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

@ -14,9 +14,11 @@ export class BuildingTypeOneComponent implements OnInit {
constructor(private http:HttpClient,private router: Router,public echartsData:EchartsDataService) { }
ngOnInit(): void {
this.echartsData.getData(null,`/api/StatisticsAnalysis/BuildingTypes`)
window.setTimeout(()=>{
this.initCharts()
},100)
},1000)
}
ngOnDestroy(): void {
this.indexBzt.clear()
@ -27,15 +29,14 @@ export class BuildingTypeOneComponent implements OnInit {
lengthdata=[]//提示数据
count=0//总数
indexData=[]//所有数据
tabledata
initCharts(){
this.echartsData.getData(null)
console.log(this.echartsData.allDate)
this.http.get("/api/StatisticsAnalysis").subscribe((data:any)=>{
console.log(data)
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])
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
console.log(this.tabledata)
for(var i=0;i<this.tabledata[0].buildingTypes.length;i++){
this.lengthdata.push(this.tabledata[0].buildingTypes[i].buildingTypeName)
this.count=this.count+this.tabledata[0].buildingTypes[i].count
this.indexData.push(this.tabledata[0].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,id:v.buildingTypeId}})
@ -54,10 +55,8 @@ export class BuildingTypeOneComponent implements OnInit {
trigger: 'item',
position: this.echartsData.tableTooltipNoShow2,
formatter: (params)=>{
//console.log(params)
this.echartsData.biaogeTishiZhi(params.data)
return this.echartsData.res
}
},
legend: {
@ -72,6 +71,7 @@ export class BuildingTypeOneComponent implements OnInit {
},
series: [
{
//top:'15%',
name: '访问来源',
type: 'pie',
radius: '60%',
@ -99,22 +99,36 @@ export class BuildingTypeOneComponent implements OnInit {
]
};
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);
})
}
tishiData
res:string
biaogeTishiZhi(datas){
let paramsdata:any = {
BuildingTypeId:datas.id
console.log(datas,this.tabledata)
for(var a in this.tabledata.buildingTypes){
if(this.tabledata.buildingTypes[a].buildingTypeId==datas.id){
this.tishiData=this.tabledata.buildingTypes[a].organizations
}
}
this.http.get("/api/StatisticsAnalysis/Companies",{params:paramsdata}).subscribe((data:any)=>{
this.tishiData=data
console.log(this.tishiData)
var countall=0//总计
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+='</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>';
@ -124,17 +138,19 @@ export class BuildingTypeOneComponent implements OnInit {
this.res+='</tr></thead>'
this.res+='<tbody>';
//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+='<td style="text-align:center;">'+this.tishiData.organizationStatistics.organizations[i].organizationName+'</td>'
this.res+='<td style="text-align:center;">'+this.tishiData.organizationStatistics.organizations[i].count+'</td>'
this.res+='<td style="text-align:center;">10</td></tr>'
this.res+='<td style="text-align:center;">'+this.tishiData[i].organizationName+'</td>'
this.res+='<td style="text-align:center;">'+this.tishiData[i].count+'</td>'
this.res+='<td style="text-align:center;">'+countbi+'%</td></tr>'
}
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>'
return this.res
})
}
}

143
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
listorganizationId//上个页面传过来的组织id
buildingTypeName:String
buildingTypeId
organizationId=[]//本层id
ngOnInit(): void {
this.route.queryParams.subscribe(params => {
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.zhongNumData,this.zhongNameData)
this.organizationName = params['organizationName'];
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(()=>{
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()
})
},1000)
}
ngOnDestroy(): void {
this.detailPlanEchart.clear()
@ -50,21 +67,27 @@ export class BuildingTypeThreeDetailsComponent implements OnInit {
fontSize: 12
}
}//柱状图数值顶部显示
zhongNameData = ["浦东中队","黄浦中队","徐汇中队","长宁中队","静安中队","普陀中队","虹口中队","杨浦中队","闵行中队","宝山中队","嘉定中队"]
zhongNumData = [200,190,180,170,160,150,140,130,120,110,100]
zhongNameData = []
zhongNumData = []
tiaoshiPao:any
detailPlanEchart
tabledata
detailEcharts(){
this.detailPlanEchart = echarts.init(document.getElementById('barEchart'),'walden');
var option = {
title: {
text: this.buildingTypeName + '(' +this.organizationName + ')'+':总数(666)',
text: this.buildingTypeName + '(' +this.organizationName + ')'+`:总数(${this.tabledata[0].totalCount})`,
left: "center",
textStyle: {
fontSize: 30
}
},
grid: {
top: 110,
//bottom: 10
},
xAxis: {
id:this.organizationId,
type: 'category',
data: this.zhongNameData,
// axisLabel: this.axisLabel
@ -95,6 +118,7 @@ export class BuildingTypeThreeDetailsComponent implements OnInit {
}
},
series: [{
id:this.organizationId,
data: this.zhongNumData,
type: 'bar',
barWidth :'38',
@ -109,34 +133,91 @@ export class BuildingTypeThreeDetailsComponent implements OnInit {
}]
};
this.detailPlanEchart.setOption(option);
this.detailPlanEchart.on('click', (params) => {
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1}});
this.detailPlanEchart.getZr().on('click', (params) => {
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[xIndex].subOrganizations.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
//option.series[0].id=this.organizationId
option.xAxis.id=this.organizationId
this.detailPlanEchart.clear()
this.detailPlanEchart.setOption(option)
//this.detailEcharts()
},1000)
this.tiao=true
}
else{
console.log(option.series[0].id)
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':option.xAxis.data[xIndex],'type':1,'jsid':option.xAxis.id[xIndex]}});
}
}
});
}
tableTooltip(params:any){
var data = [
{name:params.name,number:params.value,zhanbi:(params.value/1340 * 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>'
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+='<thead style="font-size:18px;"><tr>';
res+='<td style="text-align:center;width:30%;">名称</td>';
res+='<td style="text-align:center;width:30%;">数量</td>'
res+='<td style="text-align:center;width:30%;">总占比</td>'
res+='</tr></thead>'
res+='<tbody>';
for(var i=0;i<data.length;i++){
res+='<tr>'
res+='<td style="text-align:center;">'+data[i].name+'</td>'
res+='<td style="text-align:center;">'+data[i].number+'</td>'
res+='<td style="text-align:center;">'+data[i].zhanbi+'</td></tr>'
}
res+='</tbody>'
// res+='<tfoot><td style="text-align:center;border:1px solid #000000">总计</td><td style="text-align:center;border:1px solid #000000">1356</td><td style="text-align:center;border:1px solid #000000">19%</td></tfoot>'
res+='</table></div></div>'
return res
tiao=false
tishiData
res
tableTooltip(datas:any){
console.log(datas)
for(var a in this.echartsData.obdata[0].organizations){
if(this.echartsData.obdata[0].organizations[a].organizationName==datas.name){
this.tishiData=this.echartsData.obdata[0].organizations[a].subOrganizations
}
}
console.log(this.tishiData)
var countall=0//总计
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+='</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+='<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+='<tbody>';
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+='<td style="text-align:center;">'+this.tishiData[i].organizationName+'</td>'
this.res+='<td style="text-align:center;">'+this.tishiData[i].count+'</td>'
this.res+='<td style="text-align:center;">'+countbi+'%</td></tr>'
}
this.res+='</tbody>'
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>'
return this.res
}
}

135
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'])
}
headname//标题
buildId//建筑id
ngOnInit(): void {
this.route.queryParams.subscribe(param=>{
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(()=>{
this.bianli()
//this.initCharts()
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.tiaoshiPao=this.data.qipao(this.tiaoshiPao,this.zhiNumData,this.zhiNameData)
this.barEcharts()
},0)
},1000);
}
ngOnDestroy(): void {
/* this.indexBzt.clear()
@ -110,19 +124,21 @@ export class BuildingTypeTwoReverseComponent implements OnInit {
{name:"松江中队",number:"75",zhanbi:"0.5%"},
{name:"金山中队",number:"65",zhanbi:"0.4%"},
{name:"崇明中队",number:"55",zhanbi:"0.3%"} ]
zhiNameData = ["浦东支队","黄浦支队","徐汇支队","长宁支队","静安支队","普陀支队","虹口支队","杨浦支队","闵行支队","宝山支队","嘉定支队","松江支队","金山支队","崇明支队"]
zhiNumData = [200,190,180,170,160,150,140,130,120,110,100,90,80,70]
zhiNameData = []
zhiNumData = []
tiaoshiPao:any
//气泡提示数据获取
bianli(){
var arrshuzu='[';
if(this.zhiNumData.length>=1){
var arrshuzu='[';
for(var i=0;i<this.zhiNumData.length;i++){
arrshuzu+='{"value":'+this.zhiNumData[i]+',"coord":['+i+','+this.zhiNumData[i]+'],"name":'+'"'+this.zhiNameData[i]+'"'+'},'
}
arrshuzu=arrshuzu.substring(0,arrshuzu.length-1)
arrshuzu+=']'
this.tiaoshiPao=JSON.parse(arrshuzu)
//return tishiPao
}
}
forArr = [{id:'gaoceng',name:'高层',echart:null},
{id:'dixia',name:'地下',echart:null},
@ -232,30 +248,28 @@ export class BuildingTypeTwoReverseComponent implements OnInit {
lengthdata=[]//提示数据
count=0//总数
indexData=[]//所有数据
organizationId=[]
tabledata
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=>{
let _this = this
item.echart = echarts.init(document.getElementById('gaoceng'),'walden');
let option = {
title: {
text: this.headname+':总数(1024)',
text: this.headname+this.tabledata[0].totalCount,
left: "center",
top: "15",
//bottom: '80',
//top: "12",
bottom: '510',
textStyle: {
fontSize: 30
}
},
grid: {
top: 90,
bottom: 30
},
xAxis: {
id:this.organizationId,
type: 'category',
data: this.zhiNameData,
axisLabel:{
@ -282,7 +296,8 @@ export class BuildingTypeTwoReverseComponent implements OnInit {
tooltip: {
trigger: 'item',
formatter: (params)=>{
return this.tableTooltip(this.tableDataZhong,params.name)
console.log(params)
return this.tableTooltip(params)
},
position: this.data.tableTooltipNoShow2
},
@ -290,7 +305,7 @@ export class BuildingTypeTwoReverseComponent implements OnInit {
data: this.zhiNumData,
type: 'bar',
markPoint: {
data: this.tiaoshiPao
data:this.tiaoshiPao
},
//showBackground: true,
backgroundStyle: {
@ -301,36 +316,64 @@ export class BuildingTypeTwoReverseComponent implements OnInit {
}]
};
item.echart.setOption(option);
item.echart.on('click', (params) => {
this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_three_details'],{queryParams:{'organizationName':params.name,'buildingTypeName':this.headname}})
item.echart.getZr().on('click', (params) => {
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}});
}
});
})
})
}
//提示框表格
tableTooltip(dataArr,title:string){
let data = dataArr
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;">'+title+'</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+='<thead style="font-size:18px;"><tr>';
res+='<td style="text-align:center;width:30%;">名称</td>';
res+='<td style="text-align:center;width:30%;">数量</td>'
res+='<td style="text-align:center;width:30%;">总占比</td>'
res+='</tr></thead>'
res+='<tbody>';
//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.tableDataZhong.length;i++){
res+='<tr>'
res+='<td style="text-align:center;">'+this.tableDataZhong[i].name+'</td>'
res+='<td style="text-align:center;">'+this.tableDataZhong[i].number+'</td>'
res+='<td style="text-align:center;">'+this.tableDataZhong[i].zhanbi+'</td></tr>'
}
res+='</tbody>'
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>'
res+='</table></div></div>'
return res
res
tishiData
tableTooltip(datas){
console.log(datas)
for(var a in this.data.obdata[0].organizations){
if(this.data.obdata[0].organizations[a].organizationName==datas.name){
this.tishiData=this.data.obdata[0].organizations[a].subOrganizations
}
}
console.log(this.tishiData)
var countall=0//总计
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+='</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+='<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+='<tbody>';
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+='<td style="text-align:center;">'+this.tishiData[i].organizationName+'</td>'
this.res+='<td style="text-align:center;">'+this.tishiData[i].count+'</td>'
this.res+='<td style="text-align:center;">'+countbi+'%</td></tr>'
}
this.res+='</tbody>'
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>'
return this.res
}
}

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

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

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

@ -11,6 +11,7 @@ export class EchartsDataService {
this.allEcharts=this.http.get("/api/StatisticsAnalysis")
//return this.allEcharts.data
}
level = sessionStorage.getItem("level");
allEcharts
//计划首页
tableShow=false//控制首页表格显隐
@ -396,7 +397,7 @@ export class EchartsDataService {
return res
}
/**
* @name:
* @name: ()
* @test: test font
* @msg:
* @param {string()}
@ -404,46 +405,135 @@ export class EchartsDataService {
*/
res
tishiData
localData
biaogeTishiZhi(datas){
let paramsdata:any = {
BuildingTypeId:datas.id
console.log(datas)
for(var a in this.obdata[0].buildingTypes){
if(this.obdata[0].buildingTypes[a].buildingTypeName==datas.name){
this.tishiData=this.obdata[0].buildingTypes[a].organizations
}
}
//var res
this.http.get("/api/StatisticsAnalysis",{params:paramsdata}).subscribe((data:any)=>{
this.tishiData=data
console.log(this.tishiData)
})
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>'
console.log(this.tishiData)
var countall=0//总计
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+='</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+='<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+='<tbody>';
var countall=0
for(var i=0;i<this.tishiData.companyStatistics.organizationStatistics.organizations.length;i++){
countall+=this.tishiData.companyStatistics.organizationStatistics.organizations[i].count
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+='<td style="text-align:center;">'+this.tishiData[i].organizationName+'</td>'
this.res+='<td style="text-align:center;">'+this.tishiData[i].count+'</td>'
this.res+='<td style="text-align:center;">'+countbi+'%</td></tr>'
}
this.res+='</tbody>'
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>'
return this.res
}
//支队表格提示
biaogeTishida(datas){
console.log(datas)
this.tishiData=''
for(var a in this.obdata[0].organizations){
if(this.obdata[0].organizations[a].organizationName==datas.name){
this.tishiData=this.obdata[0].organizations[a].subOrganizations
}
}
console.log(this.tishiData)
var countall=0//总计
var countbi=0//站比
var allCountbi=0//总站比
for(var i=0;i<this.tishiData.length;i++){
countall+=this.tishiData[i].count
}
//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= '<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+='<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+='</tr></thead>'
this.res+='<tbody>';
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+='<td style="text-align:center;width:30%;">'+this.tishiData.companyStatistics.organizationStatistics.organizations[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;width:30%;">'+Math.round(this.tishiData.companyStatistics.organizationStatistics.organizations[i].count/countall* 10000)/ 100.00 +'%</td></tr>'
this.res+='<td style="text-align:center;">'+this.tishiData[i].organizationName+'</td>'
this.res+='<td style="text-align:center;">'+this.tishiData[i].count+'</td>'
this.res+='<td style="text-align:center;">'+countbi+'%</td></tr>'
}
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>'
return this.res
}
//预案表格提示
apidata=[]
biaogeTishiyuan(datas){
//localStorage.setItem('tishi',this.tishiData)
let paramdata={
planStatus:datas.type
}
if(localStorage.getItem('tishi')==undefined){
this.http.get(`/api/StatisticsAnalysis/Plans/Status`).subscribe((data:any)=>{
this.tishiData=data.organizations
localStorage.setItem('tishi',JSON.stringify(this.tishiData))
})
}
this.localData=localStorage.getItem('tishi')
/* window.setTimeout(()=>{
var countall=0//总计
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+='</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+='<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+='<tbody>';
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+='<td style="text-align:center;">'+this.tishiData[i].organizationName+'</td>'
this.res+='<td style="text-align:center;">'+this.tishiData[i].count+'</td>'
this.res+='<td style="text-align:center;">'+countbi+'%</td></tr>'
}
this.res+='</tbody>'
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>'
return this.res
},1000) */
}
}
zhiNameData = ["浦东支队","黄浦支队","徐汇支队","长宁支队","静安支队","普陀支队","虹口支队","杨浦支队","闵行支队","宝山支队","嘉定支队","松江支队","金山支队","崇明支队"]
zhiNumData = [200,190,180,170,160,150,140,130,120,110,100,90,80,70]
/**
* @name:
@ -453,7 +543,8 @@ export class EchartsDataService {
* @return {json对象}
*/
qipao(tiaoshiPao:any,yData,xData):any{
var arrshuzu='[';
if(yData.length>=1){
var arrshuzu='[';
for(var i=0;i<yData.length;i++){
arrshuzu+='{"value":'+yData[i]+',"coord":['+i+','+yData[i]+'],"name":'+'"'+xData[i]+'"'+'},'
//arrshuzu+=`{"value":${yData[i]},"coord":[${i},${yData[i]}],"name":`+`"`+`${xData[i]}`+`"`+`},`
@ -463,20 +554,28 @@ export class EchartsDataService {
tiaoshiPao=JSON.parse(arrshuzu)
//console.log(tiaoshiPao)
return tiaoshiPao
}
}
//获取所有数据
allDate=[]
getData(paramsdata){
this.http.get("/api/StatisticsAnalysis",{params:paramsdata}).subscribe((data:any)=>{
obdata
getData(paramsdata,api){
this.allDate=[]
this.obdata=null
this.http.get(api,{params:paramsdata}).subscribe((data:any)=>{
this.allDate.push(data)
console.log(this.allDate)
this.obdata=JSON.parse(JSON.stringify(this.allDate))
console.log(this.obdata)
return this.allDate
})
}
selectType=0//选择年月
selectOneYear
selectTwoYear
selectStartMonth=1
selectEndMonth=12
}

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

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

6
src/app/statistic-analysis/state/page-there-year/page-there-year.component.html

@ -4,11 +4,11 @@
* @Author: sueRimn
* @Date: 2020-09-17 10:56:18
* @LastEditors: sueRimn
* @LastEditTime: 2020-09-17 14:08:14
* @LastEditTime: 2021-03-13 14:19:22
-->
<div class="box">
<div class="header">
<div class="queryField">
<!-- <div class="queryField">
<form #form="ngForm" (ngSubmit)="Submit(form.value)">
<span>查询年份:</span>
<mat-form-field>
@ -18,7 +18,7 @@
</mat-form-field>
<button type="submit" mat-raised-button color="primary">查询</button>
</form>
</div>
</div> -->
<div class="btnbox">
<button mat-stroked-button (click)="goBack()">返回</button>

32
src/app/statistic-analysis/state/page-there-year/page-there-year.component.ts

@ -19,16 +19,30 @@ export class PageThereYearComponent implements OnInit {
buildingTypeName:String
level:String
setTimeoutObj//延时器需要清除
type
tabledata
ngOnInit(): void {
this.dateInit ()
this.bianli()
this.route.queryParams.subscribe(params => {
this.year = params['level'];
this.buildingTypeName = params['headtext'];
this.type=params['type']
});
let paramdata={
planStatus:this.type,
TrendType:this.serviceData.selectType
}
this.serviceData.getData(paramdata,`/api/StatisticsAnalysis`)
this.setTimeoutObj = window.setTimeout(()=>{
this.tabledata=JSON.parse(JSON.stringify(this.serviceData.allDate))
console.log(this.tabledata[0].planStatistics.trendStatistics.added)
for(var i=0;i<this.tabledata[0].companyStatistics.trendStatistics.added.length;i++){
this.date.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].month)
this.dateNum.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].count)
}
this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum,this.date)
this.detailEcharts()
})
},1000)
}
ngOnDestroy(){
window.clearTimeout(this.setTimeoutObj);
@ -91,14 +105,14 @@ export class PageThereYearComponent implements OnInit {
detailPlanEchart
option
date = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月','9月']
dateNum = [270, 253, 244, 199, 189, 173, 160, 198,200]
date = []
dateNum = []
detailEcharts(){
this.detailPlanEchart = echarts.init(document.getElementById('barEchart'), 'skinUpp');
this.option = {
grid: {
top: 50,
//top: 50,
left:40,
right: 20,
//bottom: 20,
@ -186,7 +200,13 @@ export class PageThereYearComponent implements OnInit {
if (this.detailPlanEchart.containPixel('grid',pointInPixel)) {
let xIndex=this.detailPlanEchart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
/*事件处理代码书写位置*/
this.router.navigate(['/statisticanalysis/stataPageThere'],{queryParams:{'level':this.option.xAxis.data[xIndex],'headtext':this.buildingTypeName,'zhong':'1'}});
if(this.serviceData.level=='0'||this.serviceData.level=='1'||this.serviceData.level=='2'){
this.router.navigate(['/statisticanalysis/stataPageThere'],{queryParams:{'level':this.option.xAxis.data[xIndex],'headtext':this.buildingTypeName,'zhong':'1','type':this.type}});
}
else if(this.serviceData.level=='3'){
//中队跳转
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1}});
}
}
});
}

6
src/app/statistic-analysis/state/page-there/page-there.component.html

@ -4,11 +4,11 @@
* @Author: sueRimn
* @Date: 2020-09-17 10:53:38
* @LastEditors: sueRimn
* @LastEditTime: 2020-09-17 11:06:12
* @LastEditTime: 2021-03-13 10:35:34
-->
<div class="box">
<div class="header">
<div class="queryField">
<!-- <div class="queryField">
<form #form="ngForm" (ngSubmit)="Submit(form.value)">
<span>查询年份:</span>
<mat-form-field>
@ -24,7 +24,7 @@
</mat-form-field>
<button type="submit" mat-raised-button color="primary">查询</button>
</form>
</div>
</div> -->
<div class="btnbox">
<button mat-stroked-button (click)="goBack()">返回</button>

55
src/app/statistic-analysis/state/page-there/page-there.component.ts

@ -21,6 +21,9 @@ export class PageThereComponent implements OnInit {
setTimeoutObj//延时器需要清除
headtext:string;
zhong:string
type
tabledata
organizationId=[]
ngOnDestroy():void{
this.zhutu.clear()
@ -28,23 +31,33 @@ export class PageThereComponent implements OnInit {
}
ngOnInit(): void {
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.zhiNumData,this.zhiNameData)
this.dateInit();
//let headtext:string;
let datayuex:string;
let headName:string;
// console.log(this.activatedRoute.queryParams.subscribe)
//headtext=this.activatedRoute.queryParams["headtext"];
this.activatedRoute.queryParams.subscribe(param=>{
this.type=param.type
this.headtext=param.headtext
datayuex=param.level
this.zhong=param.zhong
headName=datayuex+''+this.headtext;
headName=datayuex+''+this.headtext;
//console.log(headName)
});
let paramdata={
planStatus:this.type,
TrendType:this.echartsData.selectType
}
this.echartsData.getData(paramdata,`/api/StatisticsAnalysis`)
window.setTimeout(()=>{
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
console.log(this.tabledata)
for(var i=0;i<this.tabledata[0].planStatistics.organizationStatistics.organizations.length;i++){
this.zhiNameData.push(this.tabledata[0].planStatistics.organizationStatistics.organizations[i].organizationName)
this.zhiNumData.push(this.tabledata[0].planStatistics.organizationStatistics.organizations[i].count)
this.organizationId.push(this.tabledata[0].planStatistics.organizationStatistics.organizations[i].organizationId)
}
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.zhiNumData,this.zhiNameData)
this.zhuzhuangtu(headName)
},0)
},1000)
}
selectType:string = 'month'; //选择当前的 查询类型 按月/年
@ -81,9 +94,8 @@ export class PageThereComponent implements OnInit {
fontSize: 12
}
}//柱状图数值顶部显示
zhiNameData = ["浦东支队","黄浦支队","徐汇支队","长宁支队","静安支队","普陀支队","虹口支队","杨浦支队","闵行支队","宝山支队","嘉定支队","松江支队","金山支队","崇明支队"]
zhiNumData = [200,190,180,170,160,150,140,130,120,110,100,90,80,70]
zhongNameData = ["浦东中队","黄浦中队","徐汇中队","长宁中队","静安中队","普陀中队","虹口中队","杨浦中队","闵行中队","宝山中队","嘉定中队","松江中队","金山中队","崇明中队"]
zhiNameData = []
zhiNumData = []
tiaoshiPao:any
//气泡提示数据获取
bianli(){
@ -106,6 +118,10 @@ export class PageThereComponent implements OnInit {
axisLabel = {
interval: 0,
textStyle:{
fontSize :18,
color:'#000000'
},
formatter:function(value)
{
var ret = "";//拼接加\n返回的类目项
@ -147,17 +163,11 @@ export class PageThereComponent implements OnInit {
bottom:'35%'
}, */
xAxis: {
id:this.organizationId,
type: 'category',
data: this.zhiNameData,
//axisLabel: this.axisLabel,
axisLabel:{
//this.axisLabel,
textStyle:{
fontSize :18,
color:'#000000'
}
}
axisLabel: this.axisLabel,
},
yAxis: {
type: 'value',
@ -199,9 +209,12 @@ export class PageThereComponent implements OnInit {
if (this.zhutu.containPixel('grid',pointInPixel)) {
let xIndex=this.zhutu.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
/*事件处理代码书写位置*/
/* this.echartsData.statefulInspectionName = this.option.xAxis.data[xIndex]+''
this.echartsData.statefulInspectionToggle = false */
this.router.navigate(['/statisticanalysis/PageZhongDuiDetails'],{queryParams:{'level':this.option.xAxis.data[xIndex],'headtext':headName}});
if(this.echartsData.level=='0'||this.echartsData.level=='1'){
this.router.navigate(['/statisticanalysis/PageZhongDuiDetails'],{queryParams:{'level':this.option.xAxis.data[xIndex],'headtext':headName,'id':this.option.xAxis.id[xIndex],'type':this.type}});
}else{
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1}});
}
}
});
/* this.zhutu.on('click', (params) => {

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

@ -15,18 +15,31 @@ export class PageTwoNameComponent implements OnInit {
@ViewChild('zhongDuiChild') zhongDuiChild:PageZhongDuiDetailsComponent; //父组件中获得子组件的引用
ngOnInit(): void {
this.route.queryParams.subscribe(param=>{
this.headname=param.level
this.type=param.type
});
let paramdata={
planStatus:this.type
}
this.data.getData(paramdata,`/api/StatisticsAnalysis/Plans/Status`)
setTimeout(() => {
this.tabledata=JSON.parse(JSON.stringify(this.data.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.data.qipao(this.tiaoshiPao,this.zhiNumData,this.zhiNameData)
this.route.queryParams.subscribe(param=>{
this.headname=param.level
});
this.planAdd()
}, 0);
},1000);
}
ngOnDestroy(): void {
}
headname//标题
type//预案类型
axisLabel = {
interval: 0,
textStyle:{
@ -67,8 +80,8 @@ export class PageTwoNameComponent implements OnInit {
}
}//柱状图上方显示数值
zhiNameData = ["浦东支队","黄浦支队","徐汇支队","长宁支队","静安支队","普陀支队","虹口支队","杨浦支队","闵行支队","宝山支队","嘉定支队","松江支队","金山支队","崇明支队"]
zhiNumData = [200,190,180,170,160,150,140,130,120,110,100,90,80,70]
zhiNameData = []
zhiNumData = []
tiaoshiPao:any
//气泡提示数据获取
bianli(){
@ -82,13 +95,15 @@ export class PageTwoNameComponent implements OnInit {
//return tishiPao
}
addEchart
tabledata
organizationId=[]
//预案新增统计
planAdd () {
let _this = this
this.addEchart = echarts.init(document.getElementById('pie'),'walden');
var option = {
title: {
text: _this.headname+"总数(1024)",
text: _this.headname+`总数(${this.tabledata[0].totalCount}`,
left: "center",
top: "0",
bottom: '100%',
@ -96,8 +111,12 @@ export class PageTwoNameComponent implements OnInit {
fontSize: 30
}
},
grid: {
top: 110,
//bottom: 10
},
xAxis: {
id:this.organizationId,
type: 'category',
data: this.zhiNameData,
axisLabel:{
@ -146,323 +165,18 @@ export class PageTwoNameComponent implements OnInit {
if (this.addEchart.containPixel('grid',pointInPixel)) {
let xIndex=this.addEchart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
/*事件处理代码书写位置*/
this.router.navigate(['/statisticanalysis/PageZhongDuiDetails'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':option.title.text}});
}
});
}
passPlanEchartObj
//预案审核通过
passPlanEchart (){
let _this = this
this.passPlanEchartObj = echarts.init(document.getElementById('passPlanEchart'),'walden');
var option = {
title: {
text: "预案审核通过:总数(1024)",
left: "center",
top: "0",
bottom: '100%',
textStyle: {
fontSize: 23
}
},
xAxis: {
type: 'category',
data: this.zhiNameData,
axisLabel: this.axisLabel
},
yAxis: {
type: 'value',
axisLabel:{
//this.axisLabel,
textStyle:{
fontSize :16,
color:'#000000'
}
}
},
tooltip: {
trigger: 'item',
formatter: (params)=>{
return this.data.biaogeTishi(params.name)
}/* ,
position: this.data.tableTooltipNoShow2 */
},
series: [{
data: this.zhiNumData,
type: 'bar',
markPoint: {
data: this.tiaoshiPao
},
backgroundStyle: {
color: 'rgba(220, 220, 220, 0.8)'
},
barWidth :'28',
//label: this.topTextlabel
}]
};
this.passPlanEchartObj.setOption(option);
this.passPlanEchartObj.getZr().on('click', (params) => {
const pointInPixel= [params.offsetX, params.offsetY];
if (this.passPlanEchartObj.containPixel('grid',pointInPixel)) {
let xIndex=this.passPlanEchartObj.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
/*事件处理代码书写位置*/
this.router.navigate(['/statisticanalysis/PageZhongDuiDetails'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':option.title.text}});
}
});
}
passMakeEchart
//预案编制
planMake (){
let _this = this
this.passMakeEchart = echarts.init(document.getElementById('planMake'),'walden');
var option = {
title: {
text: "预案编制:总数(1024)",
left: "center",
top: "0",
bottom: '100%',
textStyle: {
fontSize: 23
}
},
xAxis: {
type: 'category',
data: this.zhiNameData,
axisLabel: this.axisLabel
},
yAxis: {
type: 'value',
axisLabel:{
//this.axisLabel,
textStyle:{
fontSize :16,
color:'#000000'
}
}
},
tooltip: {
trigger: 'item',
formatter: (params)=>{
return this.data.biaogeTishi(params.name)
}/* ,
position: this.data.tableTooltipNoShow2 */
},
series: [{
data: this.zhiNumData,
type: 'bar',
markPoint: {
data: this.tiaoshiPao
},
backgroundStyle: {
color: 'rgba(220, 220, 220, 0.8)'
},
barWidth :'28',
//label: this.topTextlabel
}]
};
this.passMakeEchart.setOption(option);
this.passMakeEchart.getZr().on('click', (params) => {
const pointInPixel= [params.offsetX, params.offsetY];
if (this.passMakeEchart.containPixel('grid',pointInPixel)) {
let xIndex=this.passMakeEchart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
/*事件处理代码书写位置*/
this.router.navigate(['/statisticanalysis/PageZhongDuiDetails'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':option.title.text}});
}
});
}
passBackEchart
//预案审核退回
planBack (){
let _this = this
this.passBackEchart = echarts.init(document.getElementById('planBack'),'walden');
var option = {
title: {
text: "预案审核退回:总数(1024)",
left: "center",
top: "0",
bottom: '100%',
textStyle: {
fontSize: 23
}
},
xAxis: {
type: 'category',
data: this.zhiNameData,
axisLabel: this.axisLabel
},
yAxis: {
type: 'value',
axisLabel:{
//this.axisLabel,
textStyle:{
fontSize :16,
color:'#000000'
}
}
},
tooltip: {
trigger: 'item',
formatter: (params)=>{
return this.data.biaogeTishi(params.name)
}/* ,
position: this.data.tableTooltipNoShow2 */
},
series: [{
data: this.zhiNumData,
type: 'bar',
markPoint: {
data: this.tiaoshiPao
},
backgroundStyle: {
color: 'rgba(220, 220, 220, 0.8)'
},
barWidth :'28',
//label: this.topTextlabel
}]
};
this.passBackEchart.setOption(option);
this.passBackEchart.getZr().on('click', (params) => {
const pointInPixel= [params.offsetX, params.offsetY];
if (this.passBackEchart.containPixel('grid',pointInPixel)) {
let xIndex=this.passBackEchart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
/*事件处理代码书写位置*/
this.router.navigate(['/statisticanalysis/PageZhongDuiDetails'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':option.title.text}});
}
});
}
planAuditEchart
//预案审核中
planAudit (){
let _this = this
this.planAuditEchart = echarts.init(document.getElementById('planAudit'),'walden');
var option = {
title: {
text: "预案审核中:总数(1024)",
left: "center",
top: "0",
bottom: '100%',
textStyle: {
fontSize: 23
if(this.data.level=='0'||this.data.level=='1'){
this.router.navigate(['/statisticanalysis/PageZhongDuiDetails'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':_this.headname,'id':option.xAxis.id[xIndex],'type':this.type}});
}else{
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1}});
}
},
xAxis: {
type: 'category',
data: this.zhiNameData,
axisLabel: this.axisLabel
},
yAxis: {
type: 'value',
axisLabel:{
//this.axisLabel,
textStyle:{
fontSize :16,
color:'#000000'
}
}
},
tooltip: {
trigger: 'item',
formatter: (params)=>{
return this.data.biaogeTishi(params.name)
}/* ,
position: this.data.tableTooltipNoShow2 */
},
series: [{
data: this.zhiNumData,
type: 'bar',
markPoint: {
data: this.tiaoshiPao
},
backgroundStyle: {
color: 'rgba(220, 220, 220, 0.8)'
},
barWidth :'28',
//label: this.topTextlabel
}]
};
this.planAuditEchart.setOption(option);
this.planAuditEchart.getZr().on('click', (params) => {
const pointInPixel= [params.offsetX, params.offsetY];
if (this.planAuditEchart.containPixel('grid',pointInPixel)) {
let xIndex=this.planAuditEchart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
/*事件处理代码书写位置*/
this.router.navigate(['/statisticanalysis/PageZhongDuiDetails'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':option.title.text}});
}
});
}
topEchart
//预案状态统计
planState(){
this.topEchart = echarts.init(document.getElementById('pie'),'walden');
var option = {
title: {
text: '预案状态统计(7005份)',
left: 'center',
top: "6%",
textStyle: {
fontSize: 30
}
},
tooltip: {
trigger: 'item',
formatter: (params)=>{
return this.data.biaogeTishiZhi(params.name)
},
position: this.data.tableTooltipNoShow2
},
legend: {
orient: 'vertical',
right: '13%',
top: "26%",
textStyle:{
fontSize:18,
color:"#000000"
},
data: ['预案新增', '预案审核通过', '预案编制', '预案审核退回', '预案审核中']
},
series: [
{
name: '访问来源',
type: 'pie',
radius: '75%',
center: ['50%', '60%'],
data: [
{value: 1585, name: '预案新增'},
{value: 2000, name: '预案审核通过'},
{value: 2600, name: '预案编制'},
{value: 1500, name: '预案审核退回'},
{value: 1800, name: '预案审核中'}
],
label: {
formatter: '{b}({c}份)\n{d|{d}%}',
fontSize :18,
rich: {
d: {
align: 'center',
fontSize :18
}
},
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
}
this.topEchart.setOption(option);
}
passPlanEchartObj
tableTooltip(biaotou:string){
var shuju='[{"name":"浦东支队","number":"156","zhanbi":"3%"},{"name":"黄浦支队","number":"144","zhanbi":"2.8%"},'

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

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

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

@ -15,19 +15,23 @@ declare var echarts: any;
})
export class PageTwoTimeComponent implements OnInit {
constructor(private router: Router,public snackBar: MatSnackBar,private adapter: DateAdapter<any>,public echartsData:EchartsDataService) { }
constructor(private router: Router,public snackBar: MatSnackBar,private adapter: DateAdapter<any>,public echartsData:EchartsDataService,private activatedRoute: ActivatedRoute) { }
@ViewChild('appEcharts')appEcharts :echartsComponent; //父组件中获得子组件的引用
@ViewChild('pageTwoName')pageTwoName :PageTwoNameComponent; //父组件中获得子组件的引用
@ViewChild('echartsComponent')echartsComponent :echartsComponent; //父组件中获得子组件的引用
ngOnInit(): void {
this.activatedRoute.queryParams.subscribe(param=>{
this.type=param.type
});
this.echartsData.statefulInspectionToggle = true
this.dateInit()
this.bianli()
}
isQuery:boolean = true; //横纵向查询
type
//shao
toggleTrue () {
this.isQuery = true
@ -52,10 +56,16 @@ export class PageTwoTimeComponent implements OnInit {
changeTime (e) {
let data = e.value
this.appEcharts.changeTime(data)
if(e.value=='month'){
this.echartsData.selectType=0
}
else if(e.value=='year'){
this.echartsData.selectType=2
}
}
//查询数据
years:any = []
years:any = [2020,2021]
selectMonth:any = [1,2,3,4,5,6,7,8,9,10,11,12]
tiaoshiPao:any
datayuey=[270, 253, 244, 199, 189, 173, 160, 198,200]
@ -76,34 +86,23 @@ export class PageTwoTimeComponent implements OnInit {
dateInit () {
let date = (new Date()).getFullYear()
for (let i=date; i>=date-10;i--) {
this.years.unshift(i)
//this.years.unshift(i)
}
}
selectOneYear:any = (new Date()).getFullYear() //开始年份
selectTwoYear:any = (new Date()).getFullYear() //结束年份
selectStartMonth:any = 1 //开始月份
selectEndMonth:any = (new Date()).getMonth()+1 //结束月份
selectEndMonth:any = 12 //结束月份
//按月查询
monthSubmit (e) {
if (e.selectTwoYear > e.selectOneYear) {
if(e.selectEndMonth >= e.selectStartMonth) {
let startTime = e.selectOneYear + '-' + e.selectStartMonth + '-' + 1 + ' ' + 0 + ':' + 0 +':'+ 0
let endTime = e.selectTwoYear + '-' + e.selectEndMonth + '-' + 31 + ' ' + 23 + ':' + 59 +':'+ 59
//console.log(startTime)
//console.log(endTime)
} else if (e.selectTwoYear === e.selectOneYear) {
if(e.selectEndMonth >= e.selectStartMonth) {
let startTime = e.selectOneYear + '-' + e.selectStartMonth + '-' + 1 + ' ' + 0 + ':' + 0 +':'+ 0
let endTime = e.selectTwoYear + '-' + e.selectEndMonth + '-' + 31 + ' ' + 23 + ':' + 59 +':'+ 59
//console.log(startTime)
//console.log(endTime)
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请选择正确时间区段','确定',config);
}
}else {
this.echartsData.selectStartMonth=e.selectStartMonth
this.echartsData.selectEndMonth=e.selectEndMonth
this.appEcharts.findYue()
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -113,15 +112,15 @@ export class PageTwoTimeComponent implements OnInit {
selectStartYear:any = (new Date()).getFullYear() //开始年份
selectStartYear:any = (new Date()).getFullYear()-1 //开始年份
selectEndYear:any = (new Date()).getFullYear() //结束年份
//按年查询
yearSubmit (e) {
if (e.selectEndYear >= e.selectStartYear) {
let startTime = e.selectStartYear + '-' + 1 + '-' + 1 + ' ' + 0 + ':' + 0 +':'+ 0
let endTime = e.selectEndYear + '-' + 12 + '-' + 31 + ' ' + 23 + ':' + 59 +':'+ 59
//console.log(startTime)
//console.log(endTime)
this.echartsData.selectOneYear=e.selectStartYear
this.echartsData.selectTwoYear=e.selectEndYear
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -143,11 +142,12 @@ export class echartsComponent implements OnInit {
constructor(private router: Router,private activatedRoute: ActivatedRoute,public snackBar: MatSnackBar,private adapter: DateAdapter<any>,public echartsData:EchartsDataService) { }
type
tiaoshiPao:any
datayuey=[270, 253, 244, 199, 189, 173, 160, 198, 200]
datayuex=['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月','9月']
dataYearX = ['2019','2020']
dataYearY = [1078, 936]
datayuey=[]
datayuex=[]
dataYearX = ['2020','2021']
dataYearY = ['0']
//气泡提示数据获取
bianli(){
var arrshuzu='[';
@ -159,18 +159,30 @@ export class echartsComponent implements OnInit {
this.tiaoshiPao=JSON.parse(arrshuzu)
}
ngOnInit(): void {
this.activatedRoute.queryParams.subscribe(param=>{
this.headtext=param.level
this.type=param.type
});
let paramdata={
//planStatus:this.type,
TrendType:this.echartsData.selectType
}
this.echartsData.getData(paramdata,`/api/StatisticsAnalysis`)
window.setTimeout(()=>{
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.datayuey,this.datayuex)
this.activatedRoute.queryParams.subscribe(param=>{
this.headtext=param.level
});
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
//console.log(this.tabledata[0].companyStatistics.trendStatistics.added)
for(var i=0;i<this.tabledata[0].companyStatistics.trendStatistics.added.length;i++){
if(this.tabledata[0].companyStatistics.trendStatistics.added[i].month>=this.echartsData.selectStartMonth||this.tabledata[0].companyStatistics.trendStatistics.added[i].month<=this.echartsData.selectEndMonth){
this.datayuex.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].month)
this.datayuey.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].count)
}
}
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.datayuey,this.datayuex)
//this.oneInit()
this.twoInit()
/* this.threeInit()
this.fourInit()
this.fiveInit()
this.sixInit() */
},0)
},1000)
}
ngOnDestroy () {
@ -185,110 +197,60 @@ export class echartsComponent implements OnInit {
if (e=='year') {
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.dataYearY,this.dataYearX)
//this.oneInit(this.dataYearX,this.dataYearY)
this.twoInit(this.dataYearX,this.dataYearY)
this.echartsData.selectType=2
let paramdata={
//planStatus:this.type,
TrendType:this.echartsData.selectType
}
this.echartsData.getData(paramdata,`/api/StatisticsAnalysis`)
window.setTimeout(()=>{
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
console.log(this.tabledata[0].companyStatistics.trendStatistics.added)
this.dataYearY.push(this.tabledata[0].companyStatistics.trendStatistics.added[0].count)
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.datayuey,this.datayuex)
//this.oneInit()
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.dataYearY,this.dataYearX)
this.twoInit(this.dataYearX,this.dataYearY)
},1000)
//this.twoInit(this.dataYearX,this.dataYearY)
} else {
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.datayuey,this.datayuex)
//this.oneInit()
this.echartsData.selectType=0
this.twoInit()
}
}
oneExample:any;
oneInit (X=this.datayuex, Y=this.datayuey) {
this.oneExample = echarts.init(document.getElementById('one'),'walden');
var option = {
grid: {
top: 50,
left:50,
right: 20,
},
tooltip: {
trigger: 'axis',
formatter: (params)=>{
return this.echartsData.tableTooltip(this.echartsData.planData,params[0].name)
},
},
// 标题
title: {
text: '预案统计状态'+':总数(1024)',
top: -4,
left: 'center',
subtext:'今年',
  //副标题文本样式
  subtextStyle:{
color:'#999',
fontWeight:'bold',
},
textStyle:{
//文字颜色
color:'#000',
fontSize: 22,
}
},
// x轴
xAxis: {
type: 'category',
data: X,
boundaryGap: true,
axisLabel: {
color: "#000", //刻度线标签颜色
textStyle:{
fontSize :15,
color:'#000000'
},
},
//设置坐标轴字体颜色和宽度
axisLine: {
lineStyle: {
color: "#000",
},
},
splitLine: {//分割线配置
show:true,
lineStyle: {
color: '#999',
}
}
},
// y轴
yAxis: {
type: 'value',
name: '个',
axisLabel: {
textStyle:{
fontSize :15,
color:'#000000'
},
color: "#000" //刻度线标签颜色
},
//设置坐标轴字体颜色和宽度
axisLine: {
lineStyle: {
color: "#000",
//按月查询
findYue(){
this.twoExample.clear()
this.datayuex=[]
this.datayuey=[]
let paramdata={
planStatus:this.type,
TrendType:this.echartsData.selectType
}
this.echartsData.getData(paramdata,`/api/StatisticsAnalysis`)
window.setTimeout(()=>{
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
//console.log(this.tabledata[0].companyStatistics.trendStatistics.added)
for(var i=0;i<this.tabledata[0].companyStatistics.trendStatistics.added.length;i++){
if(this.tabledata[0].companyStatistics.trendStatistics.added[i].month>=this.echartsData.selectStartMonth&&this.tabledata[0].companyStatistics.trendStatistics.added[i].month<=this.echartsData.selectEndMonth){
this.datayuex.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].month)
this.datayuey.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].count)
}
}
},
// 数据
series: [{
name: '单位预案编制数量',
type: 'line',
markPoint: {
symbolSize:[65, 65],
data: this.tiaoshiPao
},
data: Y,
}
],
};
this.oneExample.setOption(option);
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.datayuey,this.datayuex)
this.twoInit(this.datayuex,this.datayuey)
},1000)
}
headtext
twoExample:any;
tabledata
twoInit (X=this.datayuex, Y=this.datayuey) {
let that = this
this.twoExample = echarts.init(document.getElementById('two'), 'skinUpp');
@ -296,7 +258,7 @@ export class echartsComponent implements OnInit {
// 标题
title: {
text: this.headtext+':总数(1024)',
text: this.headtext+':总数(102)',
top: -4,
left: 'center',
bottom: 100,
@ -377,112 +339,17 @@ export class echartsComponent implements OnInit {
const pointInPixel= [params.offsetX, params.offsetY];
if (this.twoExample.containPixel('grid',pointInPixel)) {
let xIndex=this.twoExample.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
if(option.xAxis.data[xIndex]=='2019'||option.xAxis.data[xIndex]=='2020'){
this.router.navigate(['/statisticanalysis/stataPageThereYearComponent'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':option.title.text}});
if(this.echartsData.selectType==2){
this.router.navigate(['/statisticanalysis/stataPageThereYearComponent'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':option.title.text,'type':this.type}});
}else{
/*事件处理代码书写位置*/
this.router.navigate(['/statisticanalysis/stataPageThere'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':option.title.text}});
}
}
});
}
threeExample:any;
threeInit (X=this.datayuex, Y=this.datayuey) {
let that = this
this.threeExample = echarts.init(document.getElementById('three'), 'skinUpp');
var option = {
grid: {
top: 50,
left:50,
right: 20,
},
// 标题
title: {
text: '预案审核通过'+':总数(1024)',
top: -4,
left: 'center',
bottom: 100,
textStyle:{
//文字颜色
color:'#000',
}
},
//提示框
tooltip: {
trigger: 'axis',
formatter: (params)=>{
return this.echartsData.tableTooltip(this.echartsData.tableDataZhi,'预案审核通过')
}
},
// x轴
xAxis: {
type: 'category',
data: X,
boundaryGap: true,
axisLabel: {
textStyle:{
fontSize :15,
color:'#000000'
},
color: "#000", //刻度线标签颜色
},
//设置坐标轴字体颜色和宽度
axisLine: {
lineStyle: {
color: "#000",
},
},
splitLine: {//分割线配置
show:true,
lineStyle: {
color: '#999',
}
}
},
// y轴
yAxis: {
type: 'value',
name: '个',
axisLabel: {
textStyle:{
fontSize :15,
color:'#000000'
},
color: "#000" //刻度线标签颜色
},
//设置坐标轴字体颜色和宽度
axisLine: {
lineStyle: {
color: "#000",
if(this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2'){
this.router.navigate(['/statisticanalysis/stataPageThere'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':this.headtext,'type':this.type}});
} else if(this.echartsData.level=='3'){
//中队跳转
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1}});
}
}
},
// 数据
series: [{
name: '单位预案编制数量',
type: 'line',
markPoint: {
symbolSize:[65, 65],
data: this.tiaoshiPao
},
data: Y,
}
],
};
this.threeExample.setOption(option);
this.threeExample.getZr().on('click', (params) => {
const pointInPixel= [params.offsetX, params.offsetY];
if (this.threeExample.containPixel('grid',pointInPixel)) {
let xIndex=this.threeExample.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
if(option.xAxis.data[xIndex]=='2019'||option.xAxis.data[xIndex]=='2020'){
this.router.navigate(['/statisticanalysis/stataPageThereYearComponent'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':option.title.text}});
}else{
/*事件处理代码书写位置*/
this.router.navigate(['/statisticanalysis/stataPageThere'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':option.title.text}});
}
}
@ -490,312 +357,8 @@ export class echartsComponent implements OnInit {
});
}
fourExample:any;
fourInit (X=this.datayuex, Y=this.datayuey) {
let that = this
this.fourExample = echarts.init(document.getElementById('four'), 'skinUpp');
var option = {
grid: {
top: 50,
left:50,
right: 20,
},
// 标题
title: {
text: '预案编制'+':总数(1024)',
top: -4,
left: 'center',
bottom: 100,
textStyle:{
//文字颜色
color:'#000',
}
},
//提示框
tooltip: {
trigger: 'axis',
formatter: (params)=>{
return this.echartsData.tableTooltip(this.echartsData.tableDataZhi,'预案编制')
}
},
// x轴
xAxis: {
type: 'category',
data: X,
boundaryGap: true,
axisLabel: {
textStyle:{
fontSize :15,
color:'#000000'
},
color: "#000", //刻度线标签颜色
},
//设置坐标轴字体颜色和宽度
axisLine: {
lineStyle: {
color: "#000",
},
},
splitLine: {//分割线配置
show:true,
lineStyle: {
color: '#999',
}
}
},
// y轴
yAxis: {
type: 'value',
name: '个',
axisLabel: {
textStyle:{
fontSize :15,
color:'#000000'
},
color: "#000" //刻度线标签颜色
},
//设置坐标轴字体颜色和宽度
axisLine: {
lineStyle: {
color: "#000",
}
}
},
// 数据
series: [{
name: '单位预案编制数量',
type: 'line',
markPoint: {
symbolSize:[65, 65],
data: this.tiaoshiPao
},
data: Y,
}
],
};
this.fourExample.setOption(option);
this.fourExample.getZr().on('click', (params) => {
const pointInPixel= [params.offsetX, params.offsetY];
if (this.fourExample.containPixel('grid',pointInPixel)) {
let xIndex=this.fourExample.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
if(option.xAxis.data[xIndex]=='2019'||option.xAxis.data[xIndex]=='2020'){
this.router.navigate(['/statisticanalysis/stataPageThereYearComponent'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':option.title.text}});
}else{
/*事件处理代码书写位置*/
this.router.navigate(['/statisticanalysis/stataPageThere'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':option.title.text}});
}
}
});
}
fiveExample:any;
fiveInit (X=this.datayuex, Y=this.datayuey) {
let that = this
this.fiveExample = echarts.init(document.getElementById('five'), 'skinUpp');
var option = {
grid: {
top: 50,
left:50,
right: 20,
bottom: 20,
},
// 标题
title: {
text: '预案审核退回'+':总数(1024)',
top: -4,
left: 'center',
bottom: 100,
textStyle:{
//文字颜色
color:'#000',
}
},
//提示框
tooltip: {
trigger: 'axis',
formatter: (params)=>{
return this.echartsData.tableTooltip(this.echartsData.tableDataZhi,'预案审核退回')
}
},
// x轴
xAxis: {
type: 'category',
data: X,
boundaryGap: true,
axisLabel: {
textStyle:{
fontSize :15,
color:'#000000'
},
color: "#000", //刻度线标签颜色
},
//设置坐标轴字体颜色和宽度
axisLine: {
lineStyle: {
color: "#000",
},
},
splitLine: {//分割线配置
show:true,
lineStyle: {
color: '#999',
}
}
},
// y轴
yAxis: {
type: 'value',
name: '个',
axisLabel: {
textStyle:{
fontSize :15,
color:'#000000'
},
color: "#000" //刻度线标签颜色
},
//设置坐标轴字体颜色和宽度
axisLine: {
lineStyle: {
color: "#000",
}
}
},
// 数据
series: [{
name: '单位预案编制数量',
type: 'line',
markPoint: {
symbolSize:[65, 65],
data: this.tiaoshiPao
},
data: Y,
}
],
};
this.fiveExample.setOption(option);
this.fiveExample.getZr().on('click', (params) => {
const pointInPixel= [params.offsetX, params.offsetY];
if (this.fiveExample.containPixel('grid',pointInPixel)) {
let xIndex=this.fiveExample.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
if(option.xAxis.data[xIndex]=='2019'||option.xAxis.data[xIndex]=='2020'){
this.router.navigate(['/statisticanalysis/stataPageThereYearComponent'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':option.title.text}});
}else{
/*事件处理代码书写位置*/
this.router.navigate(['/statisticanalysis/stataPageThere'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':option.title.text}});
}
}
});
}
sixExample:any;
sixInit (X=this.datayuex, Y=this.datayuey) {
let that = this
this.sixExample = echarts.init(document.getElementById('six'), 'skinUpp');
var option = {
grid: {
top: 50,
left:50,
right: 20,
bottom: 20,
},
// 标题
title: {
text: '预案审核中'+':总数(1024)',
top: -4,
left: 'center',
textStyle:{
//文字颜色
color:'#000',
}
},
//提示框
tooltip: {
trigger: 'axis',
formatter: (params)=>{
return this.echartsData.tableTooltip(this.echartsData.tableDataZhi,'预案审核中')
}
},
// x轴
xAxis: {
type: 'category',
data: X,
boundaryGap: true,
axisLabel: {
textStyle:{
fontSize :15,
color:'#000000'
},
color: "#000", //刻度线标签颜色
},
//设置坐标轴字体颜色和宽度
axisLine: {
lineStyle: {
color: "#000",
},
},
splitLine: {//分割线配置
show:true,
lineStyle: {
color: '#999',
}
}
},
// y轴
yAxis: {
type: 'value',
name: '个',
axisLabel: {
textStyle:{
fontSize :15,
color:'#000000'
},
color: "#000" //刻度线标签颜色
},
//设置坐标轴字体颜色和宽度
axisLine: {
lineStyle: {
color: "#000",
}
}
},
// 数据
series: [{
name: '单位预案编制数量',
type: 'line',
markPoint: {
symbolSize:[65, 65],
data: this.tiaoshiPao
},
data: Y,
}
],
};
this.sixExample.setOption(option);
this.sixExample.getZr().on('click', (params) => {
const pointInPixel= [params.offsetX, params.offsetY];
if (this.sixExample.containPixel('grid',pointInPixel)) {
let xIndex=this.sixExample.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
if(option.xAxis.data[xIndex]=='2019'||option.xAxis.data[xIndex]=='2020'){
this.router.navigate(['/statisticanalysis/stataPageThereYearComponent'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':option.title.text}});
}else{
/*事件处理代码书写位置*/
this.router.navigate(['/statisticanalysis/stataPageThere'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':option.title.text}});
}
}
});
}
threeExample:any;

37
src/app/statistic-analysis/state/page-zhong-dui-details/page-zhong-dui-details.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-09-05 13:50:45
* @LastEditors: sueRimn
* @LastEditTime: 2020-11-10 14:36:51
* @LastEditTime: 2021-03-12 16:08:24
*/
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@ -19,23 +19,40 @@ export class PageZhongDuiDetailsComponent implements OnInit {
constructor( public route: ActivatedRoute,public data: EchartsDataService) { }
zhongNameData = ["浦东中队","黄浦中队","徐汇中队","长宁中队","静安中队","普陀中队","虹口中队","杨浦中队","闵行中队","宝山中队","嘉定中队"]
zhongNumData = [200,190,180,170,160,150,140,130,120,110,100]
zhongNameData = []
zhongNumData = []
tiaoshiPao:any
headtext:string;
headName:string;
type
lastid
tabledata
organizationId=[]
ngOnInit(): void {
window.setTimeout(()=>{
let level:string;
let level:string;
this.route.queryParams.subscribe(param=>{
this.headtext=param.headtext
level=param.level
this.headName=level+''+this.headtext;
//console.log(headName)
this.type=param.type
this.lastid=param.id
});
let paramdata={
planStatus:this.type,
OrganizationId:this.lastid
}
this.data.getData(paramdata,`/api/StatisticsAnalysis/Plans/Status`)
window.setTimeout(()=>{
this.tabledata=JSON.parse(JSON.stringify(this.data.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.data.qipao(this.tiaoshiPao,this.zhongNumData,this.zhongNameData)
this.detailEcharts()
})
},1000)
}
ngOnDestroy(): void {
this.detailPlanEchart.clear()
@ -58,7 +75,12 @@ export class PageZhongDuiDetailsComponent implements OnInit {
fontSize: 30
}
},
grid: {
top: 110,
//bottom: 10
},
xAxis: {
id:this.organizationId,
type: 'category',
data: this.zhongNameData,
axisLabel:{
@ -101,6 +123,7 @@ export class PageZhongDuiDetailsComponent implements OnInit {
}]
};
this.detailPlanEchart.setOption(option);
}

49
src/app/ui/collection-tools-building/collection-tools.component.html

@ -61,7 +61,7 @@
<!--功能区 -->
<div class="functionalDomain">
<div class='functionalDomainContent' id="functionalDomainContent">
<div class='functionalDomainContent' id="functionalDomainContentTwo">
<!-- H5Canvas -->
<app-working-area #canvas [init]='this'></app-working-area>
@ -125,23 +125,35 @@
<label class="overflowText" style="font-weight: 550;">素材库</label>
</div>
<div [hidden]="!toggleMaterialBank" [ngClass]="{'materialBankDIV': pattern}">
<mat-accordion *ngFor="let item of allLibrary" id="panelLibrary">
<mat-expansion-panel (opened)='opened(item)'>
<mat-expansion-panel-header>
<label class="text">{{item.name}}</label>
</mat-expansion-panel-header>
<div class="panelLibraryFlex">
<div class="imgBox" *ngFor="let items of item.images;let key = index" [title]="items.name"
(click)='selectImg(item,items,key)'
[ngClass]="{'selectImg': selectLibrary==item.name && selectImageIndex==key}">
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<p class="overflowText">{{items.name}}</p>
</div>
<div>
<input type="text" class="searchLibrary" [(ngModel)]="searchInput" (ngModelChange)="libraryChange()">
<div class="panelLibraryFlex" *ngIf="searchLibrary.length">
<div class="imgBox" *ngFor="let items of searchLibrary;let key = index" [title]="items.name"
[ngClass]="{'selectImg': selectLibrary=='搜索' && selectImageIndex==key}" (click)='selectImg({name:"搜索"},items,key)'>
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<p class="overflowText">{{items.name}}</p>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
<ng-container *ngIf="!searchLibrary.length">
<mat-accordion *ngFor="let item of allLibrary" id="panelLibrary">
<mat-expansion-panel (opened)='opened(item)'>
<mat-expansion-panel-header>
<label class="text">{{item.name}}</label>
</mat-expansion-panel-header>
<div class="panelLibraryFlex">
<div class="imgBox" *ngFor="let items of item.images;let key = index" [title]="items.name"
(click)='selectImg(item,items,key)'
[ngClass]="{'selectImg': selectLibrary==item.name && selectImageIndex==key}">
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<p class="overflowText">{{items.name}}</p>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</ng-container>
</div>
</div>
<!-- 素材库 -->
@ -419,8 +431,9 @@
</div>
<div class="firecategoriesTree">
<div class="hideAllTreeNode" (click)='toggoleAllTreenode()' *ngIf="allFireElements.length"><label>全部显示/隐藏</label><mat-icon [ngClass]="{'icongray': hideAllTreenode == false}">visibility</mat-icon></div>
<!-- 消防列表树写在这里 -->
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl" cdkDropList [cdkDropListData]="dataSource" (cdkDropListDropped)="drop($event)">
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl" cdkDropList [cdkDropListData]="dataSource" (cdkDropListDropped)="drop($event)">
<mat-tree-node cdkDrag cdkDragDisabled="false" [ngClass]="{'isLookPattern': !node.isLookPattern && !isEditPattern}" *matTreeNodeDef="let node;" matTreeNodePadding cdkTreeNodePaddingIndent='26' (click)="clickTreeNode(node)" class="treeNode">
<button mat-icon-button disabled></button>

11
src/app/ui/collection-tools-building/collection-tools.component.scss

@ -191,7 +191,6 @@
}
}
//右侧属性
.property{
display: flex;
@ -314,6 +313,16 @@
}
}
.hideAllTreeNode {
box-sizing: border-box;
margin: 3px 0;
padding: 0 6px 0 10px;
font-size: 14px;
height: 24px;
line-height: 24px;
display: flex;
label { display: inline-block; flex: 1; cursor: pointer; }
}
//右侧消防要素
.firecategories{
background-color: #fff;

43
src/app/ui/collection-tools-building/collection-tools.component.ts

@ -692,7 +692,7 @@ export class CollectionToolsBuildingComponent implements OnInit {
let that = this
window.setTimeout(()=>{
document.getElementById("functionalDomainContent").oncontextmenu = function (event) {
document.getElementById("functionalDomainContentTwo").oncontextmenu = function (event) {
// that.canvas.cancelPaint()
that.selectImageIndex = -1
event.preventDefault();
@ -1316,7 +1316,7 @@ export class CollectionToolsBuildingComponent implements OnInit {
//处理 tree 数据结构
handleTreeData (storeyData) {
this.hideAllTreenode = true
this.storeyData = storeyData
let data = this.allFireElements //所有消防要素模板
let treeData = [] //tree型 处理完成后的数据
@ -1384,9 +1384,24 @@ export class CollectionToolsBuildingComponent implements OnInit {
this.canvas.setHighlight(iconHighLightArr)
}
hideAllTreenode:boolean = true; //全部显示/隐藏tree节点
toggoleAllTreenode () {
this.hideAllTreenode = !this.hideAllTreenode
let list = []
this.allFireElements.forEach(element=>{
if (element.isTemplate) { this.hideAllTreenode? element.isLook = false : element.isLook = true }
})
this.treeControl.dataNodes.forEach(item=>{
this.hideAllTreenode? item.isLook = false : item.isLook = true
item.level === 0 ? list.push(item) : null
})
list.forEach(item=>{
this.clickLookItem(item)
})
}
//点击数节点的显示隐藏icon
clickLookItem(node){
//修改真实素材islook属性
for(let key in this.storeyData.data){
if(key == node.id){
@ -1398,9 +1413,8 @@ export class CollectionToolsBuildingComponent implements OnInit {
console.log(node)
if(node.isTemplate){
this.allFireElements.forEach(item=>{
if(item.id == node.id || item.name == "其他"){
item.isLook = !item.isLook
}
if(item.id == node.id){ item.isLook = !item.isLook }
if (item.name == '其他' && node.name == '其他') { item.isLook = !item.isLook }
})
}
@ -2040,6 +2054,23 @@ export class CollectionToolsBuildingComponent implements OnInit {
selectLibrary:any; //选中的素材库
selectImage:any; //选中的素材库图片
selectImageIndex:number; //选中的素材库图片index
searchSettimeout:any; //延时器
searchInput:string = null; //模糊搜索 input
searchLibrary:any = []; //模糊搜索 素材
//输入框 输入事件
libraryChange () {
window.clearTimeout(this.searchSettimeout)
this.searchSettimeout = window.setTimeout(()=>{
if (this.searchInput === "") {
this.searchLibrary = []
} else {
this.http.get(`/api/Assets?assetName=${this.searchInput}`).subscribe((data:any)=>{
this.searchLibrary = data
})
}
},500)
}
//获取素材库
getAllLibrary (type:string='input') {

12
src/app/ui/collection-tools-building/panel.scss

@ -212,6 +212,18 @@
box-sizing: border-box;
margin-left: 10px;
}
//模糊搜索 input
.searchLibrary {
display: block;
border: 1px solid rgb(219, 212, 212);
border-radius: 5px;
outline: none;
box-sizing: border-box;
margin: 5px auto;
padding-left: 5px;
width: 95%;
height: 30px;
}
.panelLibraryFlex {
display: flex;
flex-direction: row;

43
src/app/ui/collection-tools-plan/collection-tools.component.html

@ -103,23 +103,34 @@
<label class="overflowText" style="font-weight: 550;">素材库</label>
</div>
<div [hidden]="!toggleMaterialBank" [ngClass]="{'materialBankDIV': pattern}">
<mat-accordion *ngFor="let item of allLibrary" id="panelLibrary">
<mat-expansion-panel (opened)='opened(item)'>
<mat-expansion-panel-header>
<label class="text">{{item.name}}</label>
</mat-expansion-panel-header>
<div class="panelLibraryFlex">
<div class="imgBox" *ngFor="let items of item.images;let key = index" [title]="items.name"
(click)='selectImg(item,items,key)'
[ngClass]="{'selectImg': selectLibrary==item.name && selectImageIndex==key}">
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<p class="overflowText">{{items.name}}</p>
</div>
<div>
<input type="text" class="searchLibrary" [(ngModel)]="searchInput" (ngModelChange)="libraryChange()">
<div class="panelLibraryFlex" *ngIf="searchLibrary.length">
<div class="imgBox" *ngFor="let items of searchLibrary;let key = index" [title]="items.name"
[ngClass]="{'selectImg': selectLibrary=='搜索' && selectImageIndex==key}" (click)='selectImg({name:"搜索"},items,key)'>
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<p class="overflowText">{{items.name}}</p>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
<ng-container *ngIf="!searchLibrary.length">
<mat-accordion *ngFor="let item of allLibrary" id="panelLibrary">
<mat-expansion-panel (opened)='opened(item)'>
<mat-expansion-panel-header>
<label class="text">{{item.name}}</label>
</mat-expansion-panel-header>
<div class="panelLibraryFlex">
<div class="imgBox" *ngFor="let items of item.images;let key = index" [title]="items.name"
[ngClass]="{'selectImg': selectLibrary==item.name && selectImageIndex==key}" (click)='selectImg(item,items,key)'>
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<p class="overflowText">{{items.name}}</p>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</ng-container>
</div>
</div>
<!-- 素材库 -->

22
src/app/ui/collection-tools-plan/collection-tools.component.ts

@ -1409,9 +1409,8 @@ export class CollectionToolsPlanComponent implements OnInit {
//所有消防要素模板变化islook值
if(node.isTemplate){
this.allFireElements.forEach(item=>{
if(item.id == node.id || item.name == "其他"){
item.isLook = !item.isLook
}
if(item.id == node.id){ item.isLook = !item.isLook }
if (item.name == '其他' && node.name == '其他') { item.isLook = !item.isLook }
})
}
@ -2043,6 +2042,23 @@ export class CollectionToolsPlanComponent implements OnInit {
selectLibrary:any; //选中的素材库
selectImage:any; //选中的素材库图片
selectImageIndex:number; //选中的素材库图片index
searchSettimeout:any; //延时器
searchInput:string = null; //模糊搜索 input
searchLibrary:any = []; //模糊搜索 素材
//输入框 输入事件
libraryChange () {
window.clearTimeout(this.searchSettimeout)
this.searchSettimeout = window.setTimeout(()=>{
if (this.searchInput === "") {
this.searchLibrary = []
} else {
this.http.get(`/api/Assets?assetName=${this.searchInput}`).subscribe((data:any)=>{
this.searchLibrary = data
})
}
},500)
}
//获取素材库
getAllLibrary (type:string='input') {

12
src/app/ui/collection-tools-plan/panel.scss

@ -212,6 +212,18 @@
box-sizing: border-box;
margin-left: 10px;
}
//模糊搜索 input
.searchLibrary {
display: block;
border: 1px solid rgb(219, 212, 212);
border-radius: 5px;
outline: none;
box-sizing: border-box;
margin: 5px auto;
padding-left: 5px;
width: 95%;
height: 30px;
}
.panelLibraryFlex {
display: flex;
flex-direction: row;

45
src/app/ui/collection-tools/collection-tools.component.html

@ -202,23 +202,35 @@
<label class="overflowText" style="font-weight: 550;">素材库</label>
</div>
<div [hidden]="!toggleMaterialBank" [ngClass]="{'materialBankDIV': pattern}">
<mat-accordion *ngFor="let item of allLibrary" id="panelLibrary">
<mat-expansion-panel (opened)='opened(item)'>
<mat-expansion-panel-header>
<label class="text">{{item.name}}</label>
</mat-expansion-panel-header>
<div class="panelLibraryFlex">
<div class="imgBox" *ngFor="let items of item.images;let key = index" [title]="items.name"
(click)='selectImg(item,items,key)'
[ngClass]="{'selectImg': selectLibrary==item.name && selectImageIndex==key}">
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<p class="overflowText">{{items.name}}</p>
</div>
<div>
<input type="text" class="searchLibrary" [(ngModel)]="searchInput" (ngModelChange)="libraryChange()">
<div class="panelLibraryFlex" *ngIf="searchLibrary.length">
<div class="imgBox" *ngFor="let items of searchLibrary;let key = index" [title]="items.name"
[ngClass]="{'selectImg': selectLibrary=='搜索' && selectImageIndex==key}" (click)='selectImg({name:"搜索"},items,key)'>
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<p class="overflowText">{{items.name}}</p>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
<ng-container *ngIf="!searchLibrary.length">
<mat-accordion *ngFor="let item of allLibrary" id="panelLibrary">
<mat-expansion-panel (opened)='opened(item)'>
<mat-expansion-panel-header>
<label class="text">{{item.name}}</label>
</mat-expansion-panel-header>
<div class="panelLibraryFlex">
<div class="imgBox" *ngFor="let items of item.images;let key = index" [title]="items.name"
(click)='selectImg(item,items,key)'
[ngClass]="{'selectImg': selectLibrary==item.name && selectImageIndex==key}">
<img [src]="items.imageUrl" onerror="javascript:this.src='../../../assets/images/noImg.png'">
<p class="overflowText">{{items.name}}</p>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</ng-container>
</div>
</div>
<!-- 素材库 -->
@ -504,6 +516,7 @@
</div>
<div class="firecategoriesTree">
<div class="hideAllTreeNode" (click)='toggoleAllTreenode()' *ngIf="allFireElements.length"><label>全部显示/隐藏</label><mat-icon [ngClass]="{'icongray': hideAllTreenode == false}">visibility</mat-icon></div>
<!-- 消防列表树写在这里 -->
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl" cdkDropList [cdkDropListData]="dataSource" (cdkDropListDropped)="drop($event)">

10
src/app/ui/collection-tools/collection-tools.component.scss

@ -357,6 +357,16 @@
}
}
.hideAllTreeNode {
box-sizing: border-box;
margin: 3px 0;
padding: 0 6px 0 10px;
font-size: 14px;
height: 24px;
line-height: 24px;
display: flex;
label { display: inline-block; flex: 1; cursor: pointer; }
}
//右侧消防要素
.firecategories{
position: relative;

39
src/app/ui/collection-tools/collection-tools.component.ts

@ -1343,6 +1343,7 @@ export class CollectionToolsComponent implements OnInit {
selectPanelPoint //传过来的处置素材
//处理 tree 数据结构
handleTreeData (storeyData,selectPanelPoint) {
this.hideAllTreenode = true
this.storeyData = storeyData
this.selectPanelPoint = selectPanelPoint
let data = this.allFireElements //所有消防要素模板
@ -1434,6 +1435,22 @@ export class CollectionToolsComponent implements OnInit {
this.canvas.setHighlight(iconHighLightArr)
}
hideAllTreenode:boolean = true; //全部显示/隐藏tree节点
toggoleAllTreenode () {
this.hideAllTreenode = !this.hideAllTreenode
let list = []
this.allFireElements.forEach(element=>{
if (element.isTemplate) { this.hideAllTreenode? element.isLook = false : element.isLook = true }
})
this.treeControl.dataNodes.forEach(item=>{
this.hideAllTreenode? item.isLook = false : item.isLook = true
item.level === 0 ? list.push(item) : null
})
list.forEach(item=>{
this.clickLookItem(item)
})
}
//点击数节点的显示隐藏icon
clickLookItem(node){
//修改真实素材islook属性
@ -1453,9 +1470,8 @@ export class CollectionToolsComponent implements OnInit {
//所有消防要素模板变化islook值
if(node.isTemplate){
this.allFireElements.forEach(item=>{
if(item.id == node.id || item.name == "其他"){
item.isLook = !item.isLook
}
if ( item.id == node.id ) { item.isLook = !item.isLook }
if (item.name == '其他' && node.name == '其他') { item.isLook = !item.isLook }
})
}
@ -2106,6 +2122,23 @@ export class CollectionToolsComponent implements OnInit {
selectLibrary:any; //选中的素材库
selectImage:any; //选中的素材库图片
selectImageIndex:number; //选中的素材库图片index
searchSettimeout:any; //延时器
searchInput:string = null; //模糊搜索 input
searchLibrary:any = []; //模糊搜索 素材
//输入框 输入事件
libraryChange () {
window.clearTimeout(this.searchSettimeout)
this.searchSettimeout = window.setTimeout(()=>{
if (this.searchInput === "") {
this.searchLibrary = []
} else {
this.http.get(`/api/Assets?assetName=${this.searchInput}`).subscribe((data:any)=>{
this.searchLibrary = data
})
}
},500)
}
//获取素材库
getAllLibrary (type:string='input') {

12
src/app/ui/collection-tools/panel.scss

@ -209,6 +209,18 @@
box-sizing: border-box;
margin-left: 10px;
}
//模糊搜索 input
.searchLibrary {
display: block;
border: 1px solid rgb(219, 212, 212);
border-radius: 5px;
outline: none;
box-sizing: border-box;
margin: 5px auto;
padding-left: 5px;
width: 95%;
height: 30px;
}
.panelLibraryFlex {
display: flex;
flex-direction: row;

Loading…
Cancel
Save