From c883ff8f1920b1623bc26a14cc0ae12056c3c42d Mon Sep 17 00:00:00 2001 From: chenjingyu Date: Fri, 12 Mar 2021 17:26:05 +0800 Subject: [PATCH] await --- .../add-unit-one/add-unit-one.component.ts | 86 +++-- .../add-unit-three-bar-details.component.ts | 9 +- .../add-unit-two-type-details.component.ts | 2 +- .../add-unit-two-type-statistics.component.ts | 2 +- .../building-type-one.component.ts | 2 - .../building-type-three-details.component.ts | 70 ++-- .../building-type-two-reverse.component.ts | 62 +-- .../compang-info/compang-info.component.ts | 4 +- .../echarts-data.service.ts | 53 ++- .../state/page-one/page-one.component.ts | 29 +- .../page-two-name/page-two-name.component.ts | 352 ++---------------- .../page-two-time/page-two-time.component.ts | 23 +- .../page-zhong-dui-details.component.ts | 37 +- 13 files changed, 293 insertions(+), 438 deletions(-) diff --git a/src/app/statistic-analysis/addUnit/add-unit-one/add-unit-one.component.ts b/src/app/statistic-analysis/addUnit/add-unit-one/add-unit-one.component.ts index 419e1b3..371fdd1 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-one/add-unit-one.component.ts +++ b/src/app/statistic-analysis/addUnit/add-unit-one/add-unit-one.component.ts @@ -60,10 +60,8 @@ export class AddUnitOneComponent implements OnInit { this.orData.push(this.tabledata[0].organizationStatistics.organizations[i]) this.lengthOrData.push(this.tabledata[0].organizationStatistics.organizations[i].organizationName) } - console.log(this.buildData) 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}}) - console.log(this.buildData) this.indexBzt = echarts.init(document.getElementById(tid),'walden'); let options={ title: { @@ -78,7 +76,8 @@ export class AddUnitOneComponent implements OnInit { trigger: 'item', formatter: (params)=>{ console.log(params) - return this.echartsData.tableTooltip(tid=="pieone"?this.echartsData.buildingType:this.echartsData.tableDataZhi,params.name) + 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 }, @@ -133,35 +132,60 @@ export class AddUnitOneComponent implements OnInit { }); 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 = '
'+biaotou+'
' - res+='
'; - res+=''; - res+=''; - res+='' - res+='' - res+='' - res+=''; - for(var i=0;i' - res+='' - res+='' + 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 } - - res+='' - res+='' - res+='
名称数量总占比
'+jsonObj[i].number+''+jsonObj[i].zhanbi+'
总计135619%
' - return res + } + }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 + } + } + } + + console.log(this.tishiData) + var countall=0//总计 + var countbi=0//站比 + var allCountbi=0//总站比 + for(var i=0;i' + this.res+='
'; + this.res+=''; + this.res+=''; + this.res+='' + this.res+='' + this.res+='' + this.res+=''; + for(var i=0;i' + } + else{ + this.res+='' + } + + this.res+='' + this.res+='' + } + + this.res+='' + this.res+='' + this.res+='
名称数量总占比
'+this.tishiData[i].buildingTypeName+''+this.tishiData[i].count+''+countbi+'%
总计'+countall+''+allCountbi.toFixed(2)+'%
' + return this.res } diff --git a/src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.ts b/src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.ts index 451ec77..741ab20 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.ts +++ b/src/app/statistic-analysis/addUnit/add-unit-three-bar-details/add-unit-three-bar-details.component.ts @@ -148,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 }, @@ -193,16 +193,19 @@ export class AddUnitThreeBarDetailsComponent implements OnInit { 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':params.name,'type':1,'jsid':this.option.xAxis.id[xIndex]}}); + 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"){//如果是支队则跳转 @@ -253,7 +256,7 @@ export class AddUnitThreeBarDetailsComponent implements OnInit { } res+='' - res+='总计135619%' + res+='总计'+this.tabledata[0].totalCount+'100%' res+='' return res } diff --git a/src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.ts b/src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.ts index 9a6d602..a3f09bb 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.ts +++ b/src/app/statistic-analysis/addUnit/add-unit-two-type-details/add-unit-two-type-details.component.ts @@ -129,7 +129,7 @@ export class AddUnitTwoTypeDetailsComponent implements OnInit { tooltip: { trigger: 'item', formatter: (params)=>{ - return this.tableTooltip(params) + return this.echartsData.biaogeTishida(params) } }, series: [{ diff --git a/src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.ts b/src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.ts index 4c1d24d..87bd212 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.ts +++ b/src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.ts @@ -331,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 }, diff --git a/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts b/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts index cedfe85..1145a2f 100644 --- a/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts +++ b/src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts @@ -55,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: { diff --git a/src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.ts b/src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.ts index 9be3fca..24a98d4 100644 --- a/src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.ts +++ b/src/app/statistic-analysis/buildingType/building-type-three-details/building-type-three-details.component.ts @@ -118,6 +118,7 @@ export class BuildingTypeThreeDetailsComponent implements OnInit { } }, series: [{ + id:this.organizationId, data: this.zhongNumData, type: 'bar', barWidth :'38', @@ -137,7 +138,7 @@ export class BuildingTypeThreeDetailsComponent implements OnInit { if (this.detailPlanEchart.containPixel('grid',pointInPixel)) { let xIndex=this.detailPlanEchart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0]; /*事件处理代码书写位置*/ - if(this.echartsData.level=="0"&&this.tiao==false&&this.tabledata[0].organizations.length>1){ + if(this.echartsData.level=="0"&&this.tiao==false&&this.tabledata[0].organizations[xIndex].subOrganizations.length>=1){ //总队不跳转 console.log(params) this.zhongNameData=[] @@ -162,12 +163,17 @@ export class BuildingTypeThreeDetailsComponent implements OnInit { 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]}}); } @@ -176,30 +182,42 @@ export class BuildingTypeThreeDetailsComponent implements OnInit { } tiao=false - - tableTooltip(params:any){ - console.log(params) - var data = [ - {name:params.name,number:params.value,zhanbi:((params.value/this.tabledata[0].totalCount) * 100).toFixed(2) + "%"} - ] - var res = '
'+params.name+'
' - res+='
'; - res+=''; - res+=''; - res+='' - res+='' - res+='' - res+=''; - for(var i=0;i' - res+='' - res+='' - } - - res+='' - // res+='' - res+='
名称数量总占比
'+data[i].number+''+data[i].zhanbi+'
总计135619%
' - return res + 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.res+='
'; + this.res+=''; + this.res+=''; + this.res+='' + this.res+='' + this.res+='' + this.res+=''; + for(var i=0;i' + this.res+='' + this.res+='' + } + + this.res+='' + this.res+='' + this.res+='
名称数量总占比
'+this.tishiData[i].count+''+countbi+'%
总计'+countall+''+allCountbi.toFixed(2)+'%
' + return this.res } } diff --git a/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts b/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts index e705a15..4cbd064 100644 --- a/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts +++ b/src/app/statistic-analysis/buildingType/building-type-two-reverse/building-type-two-reverse.component.ts @@ -296,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 }, @@ -337,27 +338,42 @@ export class BuildingTypeTwoReverseComponent implements OnInit { } //提示框表格 - tableTooltip(dataArr,title:string){ - let data = dataArr - var res = '
'+title+'
' - res+='
'; - res+=''; - res+=''; - res+='' - res+='' - res+='' - res+=''; - //var res='
'+biaotou+'
' - for(var i=0;i' - res+='
' - res+='' - } - - res+='' - res+='' - res+='
名称数量总占比
'+this.tableDataZhong[i].number+''+this.tableDataZhong[i].zhanbi+'
总计135619%
' - 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.res+='
'; + this.res+=''; + this.res+=''; + this.res+='' + this.res+='' + this.res+='' + this.res+=''; + for(var i=0;i' + this.res+='' + this.res+='' + } + + this.res+='' + this.res+='' + this.res+='
名称数量总占比
'+this.tishiData[i].count+''+countbi+'%
总计'+countall+''+allCountbi.toFixed(2)+'%
' + return this.res } } diff --git a/src/app/statistic-analysis/compang-info/compang-info.component.ts b/src/app/statistic-analysis/compang-info/compang-info.component.ts index 6d6c341..fe03854 100644 --- a/src/app/statistic-analysis/compang-info/compang-info.component.ts +++ b/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-11 16:59:01 + * @LastEditTime: 2021-03-12 10:05:29 */ import { Component, OnInit, ViewChild, Inject } from '@angular/core'; import { HttpClient } from '@angular/common/http' @@ -66,7 +66,7 @@ export class CompangInfoComponent implements OnInit{ if(this.type==1){ //重点单位 let paramsdata:any = { - //OrganizationId: this.jsId || '', + OrganizationId: this.jsId || '', PageNumber: this.PageNumber || '1', PageSize: this.pageSizeOptions[0], IntegrityScoreMin:0, diff --git a/src/app/statistic-analysis/echarts-data.service.ts b/src/app/statistic-analysis/echarts-data.service.ts index c672739..a25612f 100644 --- a/src/app/statistic-analysis/echarts-data.service.ts +++ b/src/app/statistic-analysis/echarts-data.service.ts @@ -405,9 +405,11 @@ export class EchartsDataService { */ res tishiData + localData biaogeTishiZhi(datas){ + console.log(datas) for(var a in this.obdata[0].buildingTypes){ - if(this.obdata[0].buildingTypes[a].buildingTypeId==datas.id){ + if(this.obdata[0].buildingTypes[a].buildingTypeName==datas.name){ this.tishiData=this.obdata[0].buildingTypes[a].organizations } } @@ -444,9 +446,10 @@ export class EchartsDataService { //支队表格提示 biaogeTishida(datas){ + console.log(datas) this.tishiData='' for(var a in this.obdata[0].organizations){ - if(this.obdata[0].organizations[a].organizationId==datas.id){ + if(this.obdata[0].organizations[a].organizationName==datas.name){ this.tishiData=this.obdata[0].organizations[a].subOrganizations } } @@ -478,6 +481,52 @@ export class EchartsDataService { this.res+='总计'+countall+''+allCountbi.toFixed(2)+'%' this.res+='' 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.res+='
'; + this.res+=''; + this.res+=''; + this.res+='' + this.res+='' + this.res+='' + this.res+=''; + for(var i=0;i' + this.res+='' + this.res+='' + } + this.res+='' + this.res+='' + this.res+='
名称数量总占比
'+this.tishiData[i].count+''+countbi+'%
总计'+countall+''+allCountbi.toFixed(2)+'%
' + return this.res + },1000) */ + } 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 8ad2a7c..e6285d0 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-03-10 14:50:23 + * @LastEditTime: 2021-03-12 16:25:28 */ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; @@ -55,10 +55,10 @@ export class PageOneComponent implements OnInit { }, tooltip: { trigger: 'item', - /* formatter: (params)=>{ - console.log(params) - return this.echartsData.biaogeTishiZhi(params.data) - } */ + formatter: (params)=>{ + this.echartsData.biaogeTishiyuan(params.data) + return this.echartsData.res + } }, legend: { orient: 'vertical', @@ -94,11 +94,11 @@ export class PageOneComponent implements OnInit { }, data: [ - {value: 45, name: '预案新增'}, - {value: this.tabledata[0].planningStatistics.approvedCount, name: '预案审核通过',itemStyle:{color:'#02A7F0'}}, - {value: 37, name: '预案编制'}, - {value: this.tabledata[0].planningStatistics.rejectedCount, name: '预案审核退回'}, - {value: this.tabledata[0].planningStatistics.auditingCount, 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: { @@ -111,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); } diff --git a/src/app/statistic-analysis/state/page-two-name/page-two-name.component.ts b/src/app/statistic-analysis/state/page-two-name/page-two-name.component.ts index 517ff40..f523879 100644 --- a/src/app/statistic-analysis/state/page-two-name/page-two-name.component.ts +++ b/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.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+"总数(102)", + 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%"},' diff --git a/src/app/statistic-analysis/state/page-two-time/page-two-time.component.ts b/src/app/statistic-analysis/state/page-two-time/page-two-time.component.ts index 43fc9ef..e625e30 100644 --- a/src/app/statistic-analysis/state/page-two-time/page-two-time.component.ts +++ b/src/app/statistic-analysis/state/page-two-time/page-two-time.component.ts @@ -143,6 +143,7 @@ export class echartsComponent implements OnInit { constructor(private router: Router,private activatedRoute: ActivatedRoute,public snackBar: MatSnackBar,private adapter: DateAdapter,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月'] @@ -159,18 +160,19 @@ 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 + } + this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Plans/Status`) window.setTimeout(()=>{ - this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.datayuey,this.datayuex) - this.activatedRoute.queryParams.subscribe(param=>{ - this.headtext=param.level - }); + 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 () { @@ -289,7 +291,10 @@ export class echartsComponent implements OnInit { 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 = { diff --git a/src/app/statistic-analysis/state/page-zhong-dui-details/page-zhong-dui-details.component.ts b/src/app/statistic-analysis/state/page-zhong-dui-details/page-zhong-dui-details.component.ts index 244d925..da1545a 100644 --- a/src/app/statistic-analysis/state/page-zhong-dui-details/page-zhong-dui-details.component.ts +++ b/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