diff --git a/src/app/statistic-analysis/state/page-one/page-one.component.html b/src/app/statistic-analysis/state/page-one/page-one.component.html index ff564e1..5a6f8e0 100644 --- a/src/app/statistic-analysis/state/page-one/page-one.component.html +++ b/src/app/statistic-analysis/state/page-one/page-one.component.html @@ -4,13 +4,17 @@ * @Author: sueRimn * @Date: 2020-09-01 15:24:39 * @LastEditors: sueRimn - * @LastEditTime: 2020-09-02 14:49:05 + * @LastEditTime: 2021-07-14 14:13:42 -->
+ + autorenew + +
diff --git a/src/app/statistic-analysis/state/page-one/page-one.component.ts b/src/app/statistic-analysis/state/page-one/page-one.component.ts index 94e4231..11b472c 100644 --- a/src/app/statistic-analysis/state/page-one/page-one.component.ts +++ b/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: 2021-07-07 14:07:26 + * @LastEditTime: 2021-07-14 14:31:47 */ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; @@ -55,31 +55,55 @@ export class PageOneComponent implements OnInit { this.initCharts("pieone") this.initCharts("pietwo") } + //级别和类型转换 + pieonetype=true//级别 + clickhuan(){ + this.pieonetype=!this.pieonetype + this.initCharts("pieone") + } /* 首页饼状图 */ indexBzt tabledata count indexData - planCategoriesData=[] - planStatusesData=[] + planCategoriesData=[]//预案级别 + planStatusesData=[]//预案状态 + planTypeStatisticsdata=[]//预案类型 initCharts(tid){ + this.planTypeStatisticsdata=[] + this.planCategoriesData=[] this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) if(tid=='pieone') { - this.tabledata[0].planCategoryStatistics.planCategories.forEach((value,index,array) => { - if(array[index].planCategoryName=='LevelOne'){ - this.planCategoriesData.push({name:'Ⅰ级预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:1}) - }else if(array[index].planCategoryName=='LevelTwo'){ - this.planCategoriesData.push({name:'Ⅱ级预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:2}) - }else if(array[index].planCategoryName=='LevelThree'){ - this.planCategoriesData.push({name:'Ⅲ级预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:3}) - }else if(array[index].planCategoryName=='LevelFour'){ - this.planCategoriesData.push({name:'Ⅳ级预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:4}) - }else if(array[index].planCategoryName=='LevelFive'){ - this.planCategoriesData.push({name:'Ⅴ级预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:5}) - } - }); + if(this.pieonetype){ + this.tabledata[0].planCategoryStatistics.planCategories.forEach((value,index,array) => { + if(array[index].planCategoryName=='LevelOne'){ + this.planCategoriesData.push({name:'Ⅰ级预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:1}) + }else if(array[index].planCategoryName=='LevelTwo'){ + this.planCategoriesData.push({name:'Ⅱ级预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:2}) + }else if(array[index].planCategoryName=='LevelThree'){ + this.planCategoriesData.push({name:'Ⅲ级预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:3}) + }else if(array[index].planCategoryName=='LevelFour'){ + this.planCategoriesData.push({name:'Ⅳ级预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:4}) + }else if(array[index].planCategoryName=='LevelFive'){ + this.planCategoriesData.push({name:'Ⅴ级预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:5}) + } + }); + }else{ + this.tabledata[0].planTypeStatistics.planTypes.forEach((value,index,array) => { + if(array[index].planTypeName=='Plan2D'){ + this.planTypeStatisticsdata.push({name:'二维预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:1}) + }else if(array[index].planTypeName=='Plan3D'){ + this.planTypeStatisticsdata.push({name:'三维预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:2}) + }else if(array[index].planTypeName=='Other'){ + this.planTypeStatisticsdata.push({name:'其它预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:3}) + }else if(array[index].planTypeName=='PlanText'){ + this.planTypeStatisticsdata.push({name:'文本预案',value:array[index].count,planStatusName:array[index].planCategoryName,type:4}) + } + }); + } + }else{ this.tabledata[0].planStatusStatistics.planStatuses.forEach((value,index,array) => { if(array[index].planStatusName=='New'){ @@ -101,7 +125,7 @@ export class PageOneComponent implements OnInit { this.indexBzt = ec.init(document.getElementById(tid),'walden'); var options={ title: { - text:tid=='pieone'?`预案级别统计(${this.tabledata[0].planCategoryStatistics.totalCount}份)` :`预案状态统计(${this.tabledata[0].planStatusStatistics.totalCount}份)`, + text:tid=='pieone'&&this.pieonetype?`预案级别统计(${this.tabledata[0].planCategoryStatistics.totalCount}份)` :tid=='pieone'&&!this.pieonetype?`预案类型统计(${this.tabledata[0].planTypeStatistics.totalCount}份)`:`预案状态统计(${this.tabledata[0].planStatusStatistics.totalCount}份)`, top: "7%", left: 'center', textStyle:{ @@ -125,7 +149,7 @@ export class PageOneComponent implements OnInit { fontSize:this.padHw?15: 18, color:"#000000" }, - data:tid=='pieone'?['Ⅰ级预案', 'Ⅱ级预案', 'Ⅲ级预案', 'Ⅳ级预案', 'Ⅴ级预案'] :['预案新增', '预案审核通过', '预案编制', '预案审核退回', '预案审核中'] + data:tid=='pieone'&&this.pieonetype?['Ⅰ级预案', 'Ⅱ级预案', 'Ⅲ级预案', 'Ⅳ级预案', 'Ⅴ级预案']:tid=='pieone'&&!this.pieonetype?['二维预案', '三维预案', '其它预案', '文本预案'] :['预案新增', '预案审核通过', '预案编制', '预案审核退回', '预案审核中'] }, series: [ { @@ -147,7 +171,7 @@ export class PageOneComponent implements OnInit { }, }, - data:tid=='pieone'?this.planCategoriesData:this.planStatusesData, + data:tid=='pieone'&&this.pieonetype?this.planCategoriesData:tid=='pieone'&&!this.pieonetype?this.planTypeStatisticsdata:this.planStatusesData, emphasis: { itemStyle: { shadowBlur: 10,