Browse Source

[增加]综合分析对接后端接口

zhuzhou
chenjingyu 4 years ago
parent
commit
59364345cb
  1. 12
      src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.html
  2. 6
      src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.ts
  3. 12
      src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.html
  4. 46
      src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.ts
  5. 2
      src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.html
  6. 142
      src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.ts
  7. 4
      src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.ts
  8. 4
      src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.ts
  9. 8
      src/app/statistic-analysis/echarts-data.service.ts
  10. 6
      src/app/statistic-analysis/state/page-there-year/page-there-year.component.html
  11. 32
      src/app/statistic-analysis/state/page-there-year/page-there-year.component.ts
  12. 6
      src/app/statistic-analysis/state/page-there/page-there.component.html
  13. 55
      src/app/statistic-analysis/state/page-there/page-there.component.ts
  14. 618
      src/app/statistic-analysis/state/page-two-time/page-two-time.component.ts

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>

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

@ -32,7 +32,7 @@ export class AddUnitThreeBarDetailsComponent implements OnInit {
this.orId=params['zhuid']
});
let paramsdata={
id:this.buildId,
//id:this.buildId,
organizationId:this.orId
}
this.serviceData.getData(paramsdata,`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.buildId}`)
@ -173,7 +173,7 @@ export class AddUnitThreeBarDetailsComponent implements OnInit {
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.length>=1){
if(this.serviceData.level=="0"&&this.tiao==false&&this.tabledata[0].organizations[xIndex].subOrganizations.length>=1){
//总队不跳
console.log(params)
this.zhiNameData=[]
@ -181,7 +181,7 @@ export class AddUnitThreeBarDetailsComponent implements OnInit {
this.organizationId=[]
this.tiaoshiPao=''
let paramsdata={
id:this.buildId,
//id:this.buildId,
organizationId:this.option.xAxis.id[xIndex]
}
this.serviceData.getData(paramsdata,`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.buildId}`)

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}});
}
});
}

2
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-03-10 15:19:25
* @LastEditTime: 2021-03-13 14:41:42
-->
<div class="box">
<div class="header">

142
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 {
console.log(this.serviceData.zuzhiorBuilding)
this.serviceData.selectType=0
this.dateInit ()
this.bianli()
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,24 +93,27 @@ 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
@ -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}})
}
}
}

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

@ -40,10 +40,10 @@ export class AddUnitTwoTypeDetailsComponent implements OnInit {
this.canshuId=params['zhuId']
});
let paramsdata:any = {
id:this.echartsData.zuzhiorBuilding=='zhi'? this.canshuId:this.lastId,
//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.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)

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

@ -12,10 +12,10 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
constructor(private router: Router,public data:EchartsDataService,private route:ActivatedRoute) { }
forward(){
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':this.headname}})
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//延时器需要清除

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

@ -572,8 +572,10 @@ export class EchartsDataService {
return this.allDate
})
}
selectType=0//选择年月
selectOneYear
selectTwoYear
selectStartMonth=1
selectEndMonth=12
}

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) => {

618
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';
@ -145,10 +144,10 @@ export class echartsComponent implements OnInit {
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='[';
@ -165,10 +164,21 @@ export class echartsComponent implements OnInit {
this.type=param.type
});
let paramdata={
planStatus:this.type
//planStatus:this.type,
TrendType:this.echartsData.selectType
}
this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Plans/Status`)
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)
}
}
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.datayuey,this.datayuex)
//this.oneInit()
this.twoInit()
@ -187,114 +197,61 @@ 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: '预案统计状态'+':总数(102)',
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) {
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
console.log(this.tabledata)
let that = this
this.twoExample = echarts.init(document.getElementById('two'), 'skinUpp');
var option = {
@ -382,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',
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}});
}
}
},
// 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.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}});
}
}
@ -495,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;

Loading…
Cancel
Save