|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
* @Author: sueRimn |
|
|
|
|
* @Date: 2020-09-01 15:24:39 |
|
|
|
|
* @LastEditors: sueRimn |
|
|
|
|
* @LastEditTime: 2021-04-08 13:43:50 |
|
|
|
|
* @LastEditTime: 2021-04-22 09:52:50 |
|
|
|
|
*/ |
|
|
|
|
import { Component, OnInit } from '@angular/core'; |
|
|
|
|
import { Router } from '@angular/router'; |
|
|
|
@ -23,6 +23,7 @@ export class PageOneComponent implements OnInit {
|
|
|
|
|
constructor(private router: Router,public echartsData:EchartsDataService) { } |
|
|
|
|
|
|
|
|
|
padHw |
|
|
|
|
orid |
|
|
|
|
ngOnInit() { |
|
|
|
|
if(window.matchMedia("(max-width: 1400px)").matches){ |
|
|
|
|
this.padHw=true |
|
|
|
@ -38,6 +39,12 @@ export class PageOneComponent implements OnInit {
|
|
|
|
|
window.setTimeout(()=>{ |
|
|
|
|
this.getechartsdata() |
|
|
|
|
}) |
|
|
|
|
let jwt = sessionStorage.getItem("token"); |
|
|
|
|
let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); |
|
|
|
|
let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); |
|
|
|
|
let identityJsonparse=JSON.parse(identityJson) |
|
|
|
|
this.orid=identityJsonparse.oid |
|
|
|
|
//console.log(identityJsonparse)
|
|
|
|
|
} |
|
|
|
|
ngOnDestroy(): void { |
|
|
|
|
this.indexBzt.clear() |
|
|
|
@ -45,7 +52,8 @@ export class PageOneComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
async getechartsdata(){ |
|
|
|
|
await this.echartsData.getData(null,`/api/StatisticsAnalysis/Plans`) |
|
|
|
|
this.initCharts() |
|
|
|
|
this.initCharts("pieone") |
|
|
|
|
this.initCharts("pietwo") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* 首页饼状图 */ |
|
|
|
@ -53,53 +61,52 @@ export class PageOneComponent implements OnInit {
|
|
|
|
|
tabledata |
|
|
|
|
count |
|
|
|
|
indexData |
|
|
|
|
initCharts(){ |
|
|
|
|
initCharts(tid){ |
|
|
|
|
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) |
|
|
|
|
console.log(this.tabledata) |
|
|
|
|
//console.log(this.tabledata)
|
|
|
|
|
|
|
|
|
|
var ec = echarts as any; |
|
|
|
|
this.indexBzt = ec.init(document.getElementById('indexBzt'),'walden'); |
|
|
|
|
this.indexBzt = ec.init(document.getElementById(tid),'walden'); |
|
|
|
|
var options={ |
|
|
|
|
title: { |
|
|
|
|
text: `预案状态统计(${this.tabledata[0].totalCount}份)`, |
|
|
|
|
text:tid=='pieone'?`预案级别统计(${this.tabledata[0].planCategoryStatistics.totalCount}份)` :`预案状态统计(${this.tabledata[0].planStatusStatistics.totalCount}份)`, |
|
|
|
|
top: "7%", |
|
|
|
|
left: 'center', |
|
|
|
|
textStyle:{ |
|
|
|
|
fontSize:31 |
|
|
|
|
fontSize:this.padHw?25: 31 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
tooltip: { |
|
|
|
|
trigger: 'item', |
|
|
|
|
formatter: (params)=>{ |
|
|
|
|
this.echartsData.biaogeTishiyuan(params.data) |
|
|
|
|
this.echartsData.biaogeTishiyuan(params.data,tid) |
|
|
|
|
return this.echartsData.res |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
legend: { |
|
|
|
|
orient: 'vertical', |
|
|
|
|
right:this.padHw?50:150, |
|
|
|
|
top:this.padHw?30:80, |
|
|
|
|
bottom: 50, |
|
|
|
|
left: 'center', |
|
|
|
|
//padding:20,
|
|
|
|
|
// itemWidth:60,
|
|
|
|
|
// itemHeight:25,
|
|
|
|
|
textStyle:{ |
|
|
|
|
fontSize:18, |
|
|
|
|
fontSize:this.padHw?15: 18, |
|
|
|
|
color:"#000000" |
|
|
|
|
}, |
|
|
|
|
data: ['预案新增', '预案审核通过', '预案编制', '预案审核退回', '预案审核中'] |
|
|
|
|
data:tid=='pieone'?['Ⅰ级预案', 'Ⅱ级预案', 'Ⅲ级预案', 'Ⅳ级预案', 'Ⅴ级预案'] :['预案新增', '预案审核通过', '预案编制', '预案审核退回', '预案审核中'] |
|
|
|
|
}, |
|
|
|
|
series: [ |
|
|
|
|
{ |
|
|
|
|
name: '访问来源', |
|
|
|
|
type: 'pie', |
|
|
|
|
radius: '60%', |
|
|
|
|
center: ['50%', '50%'], |
|
|
|
|
radius: '50%', |
|
|
|
|
center: ['50%', '45%'], |
|
|
|
|
label:{ |
|
|
|
|
normal:{ |
|
|
|
|
show:true, |
|
|
|
|
// position: 'inner',
|
|
|
|
|
fontSize:18, |
|
|
|
|
formatter:'{b} {c}份\n({d}%)', |
|
|
|
|
fontSize:this.padHw?14: 18, |
|
|
|
|
formatter:this.padHw?'{b} \n{c}份({d}%)' :'{b} {c}份\n({d}%)', |
|
|
|
|
}, |
|
|
|
|
rich: { |
|
|
|
|
d: { |
|
|
|
@ -108,12 +115,18 @@ export class PageOneComponent implements OnInit {
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
data: [ |
|
|
|
|
{value:this.tabledata[0].plansStatuses[0]!=undefined? this.tabledata[0].plansStatuses[0].count:0, name: '预案新增',type:1,planStatusName:this.tabledata[0].plansStatuses[0]!=undefined?this.tabledata[0].plansStatuses[0].planStatusName:''}, |
|
|
|
|
{value:this.tabledata[0].plansStatuses[2]!=undefined? this.tabledata[0].plansStatuses[2].count:0, name: '预案审核通过',itemStyle:{color:'#02A7F0'},type:3,planStatusName:this.tabledata[0].plansStatuses[2]!=undefined? this.tabledata[0].plansStatuses[2].planStatusName:''}, |
|
|
|
|
{value:this.tabledata[0].plansStatuses[4]!=undefined?this.tabledata[0].plansStatuses[4].count:0, name: '预案编制',type:5,planStatusName:this.tabledata[0].plansStatuses[4]!=undefined?this.tabledata[0].plansStatuses[4].planStatusName:''}, |
|
|
|
|
{value:this.tabledata[0].plansStatuses[3]!=undefined? this.tabledata[0].plansStatuses[3].count:0, name: '预案审核退回',type:4,planStatusName:this.tabledata[0].plansStatuses[3]!=undefined? this.tabledata[0].plansStatuses[3].planStatusName:''}, |
|
|
|
|
{value:this.tabledata[0].plansStatuses[1]!=undefined? this.tabledata[0].plansStatuses[1].count:0, name: '预案审核中',type:2,planStatusName:this.tabledata[0].plansStatuses[1]!=undefined? this.tabledata[0].plansStatuses[1].planStatusName:''} |
|
|
|
|
data:tid=='pieone'?[ |
|
|
|
|
{value:this.tabledata[0].planCategoryStatistics.planCategories[0].count, name: 'Ⅰ级预案',planStatusName:this.tabledata[0].planCategoryStatistics.planCategories[0].planCategoryName,type:1}, |
|
|
|
|
{value:this.tabledata[0].planCategoryStatistics.planCategories[1].count, name: 'Ⅱ级预案',planStatusName:this.tabledata[0].planCategoryStatistics.planCategories[1].planCategoryName,type:2}, |
|
|
|
|
{value:this.tabledata[0].planCategoryStatistics.planCategories[2].count, name: 'Ⅲ级预案',planStatusName:this.tabledata[0].planCategoryStatistics.planCategories[2].planCategoryName,type:3}, |
|
|
|
|
{value:this.tabledata[0].planCategoryStatistics.planCategories[3].count, name: 'Ⅳ级预案',planStatusName:this.tabledata[0].planCategoryStatistics.planCategories[3].planCategoryName,type:4}, |
|
|
|
|
{value:this.tabledata[0].planCategoryStatistics.planCategories[4].count, name: 'Ⅴ级预案',planStatusName:this.tabledata[0].planCategoryStatistics.planCategories[4].planCategoryName,type:5}, |
|
|
|
|
]: [ |
|
|
|
|
{value:this.tabledata[0].planStatusStatistics.planStatuses[0]!=undefined? this.tabledata[0].planStatusStatistics.planStatuses[0].count:0, name: '预案新增',type:1,planStatusName:this.tabledata[0].planStatusStatistics.planStatuses[0]!=undefined?this.tabledata[0].planStatusStatistics.planStatuses[0].planStatusName:''}, |
|
|
|
|
{value:this.tabledata[0].planStatusStatistics.planStatuses[2]!=undefined? this.tabledata[0].planStatusStatistics.planStatuses[2].count:0, name: '预案审核通过',type:3,planStatusName:this.tabledata[0].planStatusStatistics.planStatuses[2]!=undefined? this.tabledata[0].planStatusStatistics.planStatuses[2].planStatusName:''}, |
|
|
|
|
{value:this.tabledata[0].planStatusStatistics.planStatuses[4]!=undefined? this.tabledata[0].planStatusStatistics.planStatuses[4].count:0, name: '预案编制',type:5,planStatusName:this.tabledata[0].planStatusStatistics.planStatuses[4]!=undefined?this.tabledata[0].planStatusStatistics.planStatuses[4].planStatusName:''}, |
|
|
|
|
{value:this.tabledata[0].planStatusStatistics.planStatuses[3]!=undefined? this.tabledata[0].planStatusStatistics.planStatuses[3].count:0, name: '预案审核退回',type:4,planStatusName:this.tabledata[0].planStatusStatistics.planStatuses[3]!=undefined? this.tabledata[0].planStatusStatistics.planStatuses[3].planStatusName:''}, |
|
|
|
|
{value:this.tabledata[0].planStatusStatistics.planStatuses[1]!=undefined? this.tabledata[0].planStatusStatistics.planStatuses[1].count:0, name: '预案审核中',type:2,planStatusName:this.tabledata[0].planStatusStatistics.planStatuses[1]!=undefined? this.tabledata[0].planStatusStatistics.planStatuses[1].planStatusName:''} |
|
|
|
|
], |
|
|
|
|
emphasis: { |
|
|
|
|
itemStyle: { |
|
|
|
@ -127,19 +140,58 @@ export class PageOneComponent implements OnInit {
|
|
|
|
|
}; |
|
|
|
|
this.indexBzt.on('click', (params) => { |
|
|
|
|
// console.log(params)
|
|
|
|
|
for(var i=0;i<this.tabledata[0].plansStatuses.length;i++){ |
|
|
|
|
if(this.tabledata[0].plansStatuses[i].planStatusName==params.data.planStatusName){ |
|
|
|
|
if((this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2')&&this.tabledata[0].plansStatuses[i].organizations.length>0){ |
|
|
|
|
if(tid=='pieone'){ |
|
|
|
|
for(var i=0;i<this.tabledata[0].planCategoryStatistics.planCategories.length;i++){ |
|
|
|
|
if(this.tabledata[0].planCategoryStatistics.planCategories[i].planCategoryName==params.data.planStatusName){ |
|
|
|
|
if((this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2')&&this.tabledata[0].planCategoryStatistics.planCategories[i].organizations.length>0){ |
|
|
|
|
this.tabledata[0].planCategoryStatistics.planCategories[i].organizations.forEach((element,index,array) => { |
|
|
|
|
if(array[index].organizationId==this.orid){ |
|
|
|
|
array.splice(index,1) |
|
|
|
|
} |
|
|
|
|
window.setTimeout(()=>{ |
|
|
|
|
if(array.length>0){ |
|
|
|
|
this.router.navigate(['/statisticanalysis/statePageOne/time'],{queryParams:{'level':params.name,'type':params.data.type,'tid':'pieone'}}); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'name':params.name,'id':null,'type':params.data.type,'tid':'pieone'}}); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else if(this.echartsData.level=='3'){ |
|
|
|
|
//中队跳转
|
|
|
|
|
this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'name':params.name,'id':null,'type':params.data.type,'tid':'pieone'}}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
for(var i=0;i<this.tabledata[0].planStatusStatistics.planStatuses.length;i++){ |
|
|
|
|
if(this.tabledata[0].planStatusStatistics.planStatuses[i].planStatusName==params.data.planStatusName){ |
|
|
|
|
if((this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2')&&this.tabledata[0].planStatusStatistics.planStatuses[i].organizations.length>0){ |
|
|
|
|
this.tabledata[0].planStatusStatistics.planStatuses[i].organizations.forEach((element,index,array) => { |
|
|
|
|
if(array[index].organizationId==this.orid){ |
|
|
|
|
array.splice(index,1) |
|
|
|
|
} |
|
|
|
|
window.setTimeout(()=>{ |
|
|
|
|
this.router.navigate(['/statisticanalysis/statePageOne/time'],{queryParams:{'level':params.name,'type':params.data.type}}); |
|
|
|
|
if(array.length>0){ |
|
|
|
|
this.router.navigate(['/statisticanalysis/statePageOne/time'],{queryParams:{'level':params.name,'type':params.data.type,'tid':'pietwo'}}); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'name':params.name,'id':null,'type':params.data.type,'tid':'pietwo'}}); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else if(this.echartsData.level=='3'){ |
|
|
|
|
//中队跳转
|
|
|
|
|
this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'name':params.name,'id':null,'type':params.data.type}}); |
|
|
|
|
this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'name':params.name,'id':null,'type':params.data.type,'tid':'pietwo'}}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|