From e964cf85ed2d31cd42b0012701607da4b208fca7 Mon Sep 17 00:00:00 2001 From: chenjingyu Date: Thu, 22 Apr 2021 14:42:11 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E9=A2=84=E6=A1=88=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=88=86=E6=9E=90=E5=A2=9E=E5=8A=A0=E4=B8=80=E5=88=B0?= =?UTF-8?q?=E4=BA=94=E7=BA=A7=E9=A2=84=E6=A1=88=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan-record/plan-record.component.html | 6 +- .../plan-record/plan-record.component.ts | 15 +-- .../wait-examineer.component.html | 4 +- .../add-unit-one/add-unit-one.component.ts | 21 +++- .../add-unit-three-line-details.component.ts | 4 +- .../add-unit-two-time.component.ts | 18 ++- ...dd-unit-two-type-statistics.component.scss | 2 +- .../add-unit-two-type-statistics.component.ts | 4 +- .../all-plan/all-plan.component.ts | 7 +- .../building-type-one.component.ts | 13 +- .../echarts-data.service.ts | 42 +++++-- .../state/page-one/page-one.component.html | 6 +- .../state/page-one/page-one.component.scss | 15 +++ .../state/page-one/page-one.component.ts | 116 +++++++++++++----- .../page-there-year.component.ts | 18 ++- .../state/page-there/page-there.component.ts | 13 +- .../page-two-name/page-two-name.component.ts | 11 +- .../page-two-time/page-two-time.component.ts | 61 ++++++--- .../page-zhong-dui-details.component.ts | 11 +- 19 files changed, 275 insertions(+), 112 deletions(-) diff --git a/src/app/plan-audit/plan-record/plan-record.component.html b/src/app/plan-audit/plan-record/plan-record.component.html index bb7363e..f61698a 100644 --- a/src/app/plan-audit/plan-record/plan-record.component.html +++ b/src/app/plan-audit/plan-record/plan-record.component.html @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-25 10:19:31 * @LastEditors: sueRimn - * @LastEditTime: 2021-03-26 14:49:40 + * @LastEditTime: 2021-04-21 15:24:43 -->
@@ -110,9 +110,9 @@ {{item.contentType=='1'?'Ⅰ级预案':item.contentType=='2'?'Ⅱ级预案':item.contentType=='3'?'Ⅲ级预案':item.contentType=='4'?'Ⅳ级预案':item.contentType=='5'? 'Ⅴ级预案':item.contentType=='6'?'应急预案(国家级)':item.contentType=='7'?'应急预案(市级)':item.contentType=='8'?'类型预案':item.contentType=='11'?'重点单位':item.contentType=='12'?'水源':item.contentType=='13'?'消防力量':item.contentType=='14'?'联动力量':'未知'}} - {{item.title}} + {{item.title}} {{item.operation=='0'?'新增':item.operation=='1'?'更新':'删除'}} - {{item.verifyOrganizationName}} + {{item.organizationName}} {{item.verifyState=='0'?'待初审':item.verifyState=='1'? '初审通过':item.verifyState=='2'?'初审驳回':item.verifyState=='3'?'待终审':item.verifyState=='4'?'终审通过':'终审驳回'}} {{item.creatorName}} diff --git a/src/app/plan-audit/plan-record/plan-record.component.ts b/src/app/plan-audit/plan-record/plan-record.component.ts index 9dbdeec..b27f11b 100644 --- a/src/app/plan-audit/plan-record/plan-record.component.ts +++ b/src/app/plan-audit/plan-record/plan-record.component.ts @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-12-25 10:19:31 * @LastEditors: sueRimn - * @LastEditTime: 2021-03-26 15:21:16 + * @LastEditTime: 2021-04-22 10:47:06 */ import { Component, OnInit,Inject } from '@angular/core'; import { FormControl } from '@angular/forms'; @@ -123,18 +123,7 @@ export class PlanRecordComponent implements OnInit { this.addtime='' this.endtime='' let level = sessionStorage.getItem("level"); - if(level == "0"){//如果是总队 - this.PlanLevel=0 - } - if(level == "1"){//如果是支队 - this.PlanLevel=1 - } - if(level == "2"){//如果是大队 - this.PlanLevel=2 - } - if(level == "3"){//如果是中队 - this.PlanLevel=3 - } + this.PlanLevel='' this.getAlltabledate() } //表格点击事件 diff --git a/src/app/plan-audit/wait-examineer/wait-examineer.component.html b/src/app/plan-audit/wait-examineer/wait-examineer.component.html index 75e0767..ebbc60d 100644 --- a/src/app/plan-audit/wait-examineer/wait-examineer.component.html +++ b/src/app/plan-audit/wait-examineer/wait-examineer.component.html @@ -65,9 +65,9 @@ {{item.contentType=='1'?'Ⅰ级预案':item.contentType=='2'?'Ⅱ级预案':item.contentType=='3'?'Ⅲ级预案':item.contentType=='4'?'Ⅳ级预案':item.contentType=='5'? 'Ⅴ级预案':item.contentType=='6'?'应急预案(国家级)':item.contentType=='7'?'应急预案(市级)':item.contentType=='8'?'类型预案':item.contentType=='11'?'重点单位':item.contentType=='12'?'水源':item.contentType=='13'?'消防力量':item.contentType=='14'?'联动力量':'未知'}} - {{item.title}} + {{item.title}} {{item.operation=='0'?'新增':item.operation=='1'?'更新':'删除'}} - {{item.verifyOrganizationName}} + {{item.organizationName}} {{item.verifyState=='0'?'待初审':item.verifyState=='1'? '初审通过':item.verifyState=='2'?'初审驳回':item.verifyState=='3'?'待终审':item.verifyState=='4'?'终审通过':'终审驳回'}} {{item.creatorName}} 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 1a021a0..122da53 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 @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import {EchartsDataService,} from '../../echarts-data.service'; declare var echarts: any; +declare var CryptoJS @Component({ selector: 'app-add-unit-one', templateUrl: './add-unit-one.component.html', @@ -14,6 +15,7 @@ export class AddUnitOneComponent implements OnInit { setTimeoutObj//延时器需要清除 tabledata padHw + orid//获取本组织id ngOnInit(): void { if(window.matchMedia("(max-width: 1400px)").matches){ @@ -28,7 +30,11 @@ export class AddUnitOneComponent implements OnInit { } /* this.buildData.push(this.echartsData.getData(null,`/api/StatisticsAnalysis/BuildingTypes`)) this.orData=this.echartsData.getData(null,`/api/StatisticsAnalysis/Companies`) */ - + 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 this.setTimeoutObj = window.setTimeout(()=>{ this.getechartsdata() }) @@ -150,7 +156,18 @@ export class AddUnitOneComponent implements OnInit { tid=="pieone"?this.echartsData.zuzhiorBuilding="zhi":this.echartsData.zuzhiorBuilding="building" if((this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2')&&this.tishiData.length>0){ //总队,支队,大队跳转 - this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':params.name,'id':params.data.id,'type':tid=="pieone"?'zhi':'build'}}); + this.tishiData.forEach((value,index,array) => { + if(array[index].organizationId==this.orid){ + array.splice(index,1) + } + if(array.length>0){ + this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':params.name,'id':params.data.id,'type':tid=="pieone"?'zhi':'build'}}); + } + else{ + this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1,'buildid':tid!="pieone"?params.data.id:'','jsid':tid=="pieone"?params.data.id:''}}); + } + }); + }else{ //中队跳转 this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1,'buildid':tid!="pieone"?params.data.id:'','jsid':tid=="pieone"?params.data.id:''}}); diff --git a/src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.ts b/src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.ts index 5046b2b..475ebd6 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.ts +++ b/src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.ts @@ -69,7 +69,9 @@ export class AddUnitThreeLineDetailsComponent implements OnInit { this.zongcount=this.zongcount+this.tabledata[0][i].count } } - + this.date.forEach((value,index,array)=>{ + this.date[index]=this.date[index]+'月' + }) //this.oneInit (this.date,this.dateNum) this.qopao=this.serviceData.qipao(this.qopao,this.dateNum,this.zhiNameData) diff --git a/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.ts b/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.ts index 9186f5e..dd87e4f 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.ts +++ b/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.ts @@ -55,7 +55,7 @@ export class AddUnitTwoTimeComponent implements OnInit { await this.serviceData.getData(this.zhiorbuild=="zhi"?parbuild:parzhi,`/api/StatisticsAnalysis/Trends`) this.setTimeoutObj = window.setTimeout(() => { this.tabledata=JSON.parse(JSON.stringify(this.serviceData.allDate)) - console.log(this.tabledata[0]) + //console.log(this.tabledata[0]) for(var i=0;i=this.serviceData.selectStartMonth||this.tabledata[0][i].month<=this.serviceData.selectEndMonth){ this.date.push(this.tabledata[0][i].month) @@ -63,7 +63,9 @@ export class AddUnitTwoTimeComponent implements OnInit { this.zongcount=this.zongcount+this.tabledata[0][i].count } } - + this.date.forEach((value,index,array)=>{ + this.date[index]=this.date[index]+'月' + }) //this.oneInit (this.date,this.dateNum) this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum,this.date) @@ -79,7 +81,7 @@ export class AddUnitTwoTimeComponent implements OnInit { selectType:string = 'month'; //选择当前的 查询类型 按月/年 //查询数据 - years:any = [2020,2021] + years= [] selectMonth:any = [1,2,3,4,5,6,7,8,9,10,11,12] //日期初始化 @@ -138,6 +140,7 @@ export class AddUnitTwoTimeComponent implements OnInit { this.zongcount=this.zongcount+this.tabledata[0][i].count } } + //this.oneInit (this.date,this.dateNum) this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum2,this.date2) this.twoInit (this.date2,this.dateNum2,'year') @@ -157,6 +160,9 @@ export class AddUnitTwoTimeComponent implements OnInit { if(this.selectType == "year"){ this.zongcount=0 + this.date2=[] + this.dateNum2=[] + this.years=[] this.serviceData.selectType=2 let parzhi={ objectType:0, @@ -175,12 +181,14 @@ export class AddUnitTwoTimeComponent implements OnInit { await this.serviceData.getData(this.zhiorbuild=="zhi"?parbuild:parzhi,`/api/StatisticsAnalysis/Trends`) this.setTimeoutObj = window.setTimeout(() => { this.tabledata=JSON.parse(JSON.stringify(this.serviceData.allDate)) - // console.log(this.tabledata) + console.log(this.tabledata) for(var i=0;i0){ //总队,支队,大队跳转 - this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_two_reverse'],{queryParams:{'level':params.name,'id':params.data.id}}); + this.tabledata[0].buildingTypes[i].organizations.forEach((value,index,array) => { + if(array[index].organizationId==this.echartsData.orid){ + array.splice(index,1) + } + if(array.length>0){ + this.router.navigate(['/statisticanalysis/buildingType_one/buildingType_two_reverse'],{queryParams:{'level':params.name,'id':params.data.id}}); + }else{ + this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1,'buildid':params.data.id}}); + } + }); + }else { //中队跳转 this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1,'buildid':params.data.id}}); diff --git a/src/app/statistic-analysis/echarts-data.service.ts b/src/app/statistic-analysis/echarts-data.service.ts index 7b059c7..28c9710 100644 --- a/src/app/statistic-analysis/echarts-data.service.ts +++ b/src/app/statistic-analysis/echarts-data.service.ts @@ -3,6 +3,7 @@ import { Observable, ReplaySubject } from 'rxjs'; import { HttpClient } from '@angular/common/http' import { promise } from 'selenium-webdriver'; import { resolve } from 'dns'; +declare var CryptoJS @Injectable({ providedIn: 'root' }) @@ -477,20 +478,36 @@ export class EchartsDataService { } //预案表格提示 apidata=[] - biaogeTishiyuan(datas){ + biaogeTishiyuan(datas,tid){ //localStorage.setItem('tishi',this.tishiData) this.tishiData='' - for(var a in this.obdata[0].plansStatuses){ - if(this.obdata[0].plansStatuses[a].planStatusName==datas.planStatusName){ - this.tishiData=this.obdata[0].plansStatuses[a].organizations - } - } var countall=0//总计 var countbi=0//站比 var allCountbi=0//总站比 - for(var i=0;i
' this.res+='
'; this.res+=''; @@ -548,7 +565,13 @@ export class EchartsDataService { //获取所有数据 allDate=[] obdata + orid async getData(paramsdata,api){ + 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 this.allDate=[] this.obdata=null let result = await new Promise((resolve, reject)=>{ @@ -558,7 +581,7 @@ export class EchartsDataService { }) this.allDate.push(result) this.obdata=JSON.parse(JSON.stringify(this.allDate)) - // console.log(this.obdata) + console.log(this.obdata) } selectType=0//选择年月 @@ -566,5 +589,6 @@ export class EchartsDataService { selectTwoYear selectStartMonth=1 selectEndMonth=12 + } 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 9ac3386..ff564e1 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 @@ -9,7 +9,11 @@ -
+
+
+
+
+ diff --git a/src/app/statistic-analysis/state/page-one/page-one.component.scss b/src/app/statistic-analysis/state/page-one/page-one.component.scss index 1bffad0..8ec7d96 100644 --- a/src/app/statistic-analysis/state/page-one/page-one.component.scss +++ b/src/app/statistic-analysis/state/page-one/page-one.component.scss @@ -5,4 +5,19 @@ font-size: 25px; text-align: center; } +} +#indexBzt{ + width: 100%; + height: 100%; + padding-top: 3%; + display: flex; + flex-direction: row; + .pieone{ + width: 50%; + height: 93%; + } + .pietwo{ + width: 50%; + height: 93%; + } } \ No newline at end of file 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 cd41681..9344ec4 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-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,21 +140,60 @@ export class PageOneComponent implements OnInit { }; this.indexBzt.on('click', (params) => { // console.log(params) - for(var i=0;i0){ - window.setTimeout(()=>{ - this.router.navigate(['/statisticanalysis/statePageOne/time'],{queryParams:{'level':params.name,'type':params.data.type}}); - }) + if(tid=='pieone'){ + for(var i=0;i0){ + 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 if(this.echartsData.level=='3'){ - //中队跳转 - this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'name':params.name,'id':null,'type':params.data.type}}); + } + }else{ + for(var i=0;i0){ + this.tabledata[0].planStatusStatistics.planStatuses[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':'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,'tid':'pietwo'}}); + } } } } + }); this.indexBzt.setOption(options); } diff --git a/src/app/statistic-analysis/state/page-there-year/page-there-year.component.ts b/src/app/statistic-analysis/state/page-there-year/page-there-year.component.ts index 3d815f5..32187a6 100644 --- a/src/app/statistic-analysis/state/page-there-year/page-there-year.component.ts +++ b/src/app/statistic-analysis/state/page-there-year/page-there-year.component.ts @@ -15,6 +15,7 @@ export class PageThereYearComponent implements OnInit { constructor(private router: Router,public dialog: MatDialog,public snackBar: MatSnackBar,private serviceData: EchartsDataService,public route: ActivatedRoute) { } + tid year:String buildingTypeName:String level:String @@ -22,13 +23,15 @@ export class PageThereYearComponent implements OnInit { type tabledata//获取所有数据 lastyears//上个页面传过来的年份 + count=0//总数 ngOnInit(): void { this.dateInit () this.route.queryParams.subscribe(params => { this.year = params['level']; this.buildingTypeName = params['headtext']; this.type=params['type'] - this.lastyears=params['years'] + //this.lastyears=params['years'] + this.tid=params.tid }); this.setTimeoutObj = window.setTimeout(()=>{ @@ -42,9 +45,10 @@ export class PageThereYearComponent implements OnInit { } async getechartsData(){ let paramdata={ - planStatus:this.type, + planStatus:this.tid=='pieone'?'': this.type, + PlanCategory:this.tid=='pieone'?this.type:'', TrendYear:this.lastyears||'', - objectType:1, + objectType:this.tid=='pieone'?2: 1, TrendType:0 } await this.serviceData.getData(paramdata,`/api/StatisticsAnalysis/Trends`) @@ -52,8 +56,12 @@ export class PageThereYearComponent implements OnInit { // console.log(this.tabledata) for(var i=0;i{ + this.date[index]=this.date[index]+'月' + }) this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum,this.date) this.detailEcharts() } @@ -124,7 +132,7 @@ export class PageThereYearComponent implements OnInit { }, // 标题 title: { - text: `${this.year}${this.buildingTypeName}`, + text: `${this.year}${this.buildingTypeName}总数(${this.count})`, //top: -14, left: 'center', textStyle:{ diff --git a/src/app/statistic-analysis/state/page-there/page-there.component.ts b/src/app/statistic-analysis/state/page-there/page-there.component.ts index 5e6c821..f43a9b9 100644 --- a/src/app/statistic-analysis/state/page-there/page-there.component.ts +++ b/src/app/statistic-analysis/state/page-there/page-there.component.ts @@ -25,6 +25,7 @@ export class PageThereComponent implements OnInit { tabledata organizationId=[] lastid + tid ngOnDestroy():void{ this.zhutu.clear() @@ -50,7 +51,8 @@ export class PageThereComponent implements OnInit { this.headtext=param.headtext datayuex=param.level this.zhong=param.zhong - this.headName=datayuex+'月'+this.headtext; + this.headName=datayuex+this.headtext; + this.tid=param.tid //console.log(headName) }); @@ -63,10 +65,11 @@ export class PageThereComponent implements OnInit { selectType:string = 'month'; //选择当前的 查询类型 按月/年 async getechartsdata(){ let paramdata={ - planStatus:this.type, + planStatus:this.tid=='pieone'?'': this.type, + PlanCategory:this.tid=='pieone'?this.type:'', OrganizationId:this.lastid } - await this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Plans/Status`) + await this.echartsData.getData(paramdata,this.tid=='pieone'?'/api/StatisticsAnalysis/Plans/Category': `/api/StatisticsAnalysis/Plans/Status`) this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) // console.log(this.tabledata) for(var i=0;i=1){ - this.router.navigate(['/statisticanalysis/PageZhongDuiDetails'],{queryParams:{'level':this.option.xAxis.data[xIndex],'id':this.option.xAxis.id[xIndex],'type':this.type}}); + this.router.navigate(['/statisticanalysis/PageZhongDuiDetails'],{queryParams:{'level':this.option.xAxis.data[xIndex]+this.headtext,'id':this.option.xAxis.id[xIndex],'type':this.type,'tid':this.tid}}); }else{ - this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'name':this.option.xAxis.data[xIndex],'id':this.option.xAxis.id[xIndex],'type':this.type}}); + this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'name':this.option.xAxis.data[xIndex],'id':this.option.xAxis.id[xIndex],'type':this.type,'tid':this.tid}}); } } 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 cdaeb2f..7084409 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 @@ -28,6 +28,7 @@ export class PageTwoNameComponent implements OnInit { this.route.queryParams.subscribe(param=>{ this.headname=param.level this.type=param.type + this.tid=param.tid }); @@ -40,9 +41,10 @@ export class PageTwoNameComponent implements OnInit { } async getechartsdata(){ let paramdata={ - planStatus:this.type + planStatus:this.tid=='pieone'?'': this.type, + PlanCategory:this.tid=='pieone'?this.type:'' } - await this.data.getData(paramdata,`/api/StatisticsAnalysis/Plans/Status`) + await this.data.getData(paramdata,this.tid=='pieone'?'/api/StatisticsAnalysis/Plans/Category': `/api/StatisticsAnalysis/Plans/Status`) this.tabledata=JSON.parse(JSON.stringify(this.data.allDate)) //console.log(this.tabledata) for(var i=0;i=1){ - this.router.navigate(['/statisticanalysis/stataPageThere'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':_this.headname,'id':option.xAxis.id[xIndex],'type':this.type}}); + this.router.navigate(['/statisticanalysis/stataPageThere'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':_this.headname,'id':option.xAxis.id[xIndex],'type':this.type,'tid':this.tid}}); }else{ - this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'name':option.xAxis.data[xIndex],'id':option.xAxis.id[xIndex],'type':this.type}}); + this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'name':option.xAxis.data[xIndex],'id':option.xAxis.id[xIndex],'type':this.type,'tid':this.tid}}); } //this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'name':option.xAxis.data[xIndex],'id':option.xAxis.id[xIndex],'type':this.type}}); 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 520f819..eec2c8a 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 @@ -6,6 +6,7 @@ import { FormControl } from '@angular/forms'; import { DateAdapter } from '@angular/material/core'; import { PageTwoNameComponent } from '../page-two-name/page-two-name.component'; import {EchartsDataService} from '../../echarts-data.service' +import { resolve } from 'dns'; declare var echarts: any; @Component({ @@ -60,19 +61,25 @@ export class PageTwoTimeComponent implements OnInit { selectType:string = 'month'; //选择当前的 查询类型 按月/年 - changeTime (e) { + async changeTime (e) { let data = e.value - this.appEcharts.changeTime(data) + await this.appEcharts.changeTime(data) if(e.value=='month'){ this.echartsData.selectType=0 } else if(e.value=='year'){ + this.years=[] this.echartsData.selectType=2 + this.appEcharts.tabledata[0].forEach((value,index,array) => { + this.years.push(array[index].year) + }); + this.years=Array.from(new Set(this.years)) + //console.log() } } //查询数据 - years:any = [2020,2021] + years= [] 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] @@ -150,6 +157,7 @@ export class echartsComponent implements OnInit { constructor(private router: Router,private activatedRoute: ActivatedRoute,public snackBar: MatSnackBar,private adapter: DateAdapter,public echartsData:EchartsDataService) { } + tid zongcount=0 type organizationId=[] @@ -177,6 +185,7 @@ export class echartsComponent implements OnInit { this.activatedRoute.queryParams.subscribe(param=>{ this.headtext=param.level this.type=param.type + this.tid=param.tid }); window.setTimeout(()=>{ @@ -192,13 +201,14 @@ export class echartsComponent implements OnInit { //获取数据 async getechartsData(){ let paramdata={ - planStatus:this.type, - objectType:1, + planStatus:this.tid=='pieone'?'': this.type, + PlanCategory:this.tid=='pieone'?this.type:'', + objectType:this.tid=='pieone'?2: 1, TrendType:0 } await this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Trends`) this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) - // console.log(this.tabledata) + console.log(this.tabledata) for(var i=0;i=this.echartsData.selectStartMonth||this.tabledata[0][i].month<=this.echartsData.selectEndMonth){ this.datayuex.push(this.tabledata[0][i].month) @@ -206,11 +216,13 @@ export class echartsComponent implements OnInit { this.zongcount=this.zongcount+this.tabledata[0][i].count } } - + this.datayuex.forEach((value,index,array)=>{ + array[index]=array[index]+'月' + }) this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.datayuey,this.datayuex) //this.oneInit() - this.twoInit() + this.twoInit(this.datayuex,this.datayuey) } async changeTime (e) { @@ -222,20 +234,24 @@ export class echartsComponent implements OnInit { this.echartsData.selectType=2 this.zongcount=0 let paramdata={ - objectType:1, - planStatus:this.type, + objectType:this.tid=='pieone'?2: 1, + planStatus:this.tid=='pieone'?'': this.type, + PlanCategory:this.tid=='pieone'?this.type:'', TrendType:this.echartsData.selectType } await this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Trends`) window.setTimeout(()=>{ this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) - // console.log(this.tabledata) + console.log(this.tabledata) + //resolve(this.tabledata) for(var i=0;i{ + this.dataYearX[index]=this.dataYearX[index]+'年' + }) this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.datayuey,this.datayuex) //this.oneInit() this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.dataYearY,this.dataYearX) @@ -247,7 +263,7 @@ export class echartsComponent implements OnInit { this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.datayuey,this.datayuex) //this.oneInit() this.echartsData.selectType=0 - this.twoInit() + this.twoInit(this.datayuex,this.datayuey) } } @@ -257,8 +273,9 @@ export class echartsComponent implements OnInit { this.datayuex=[] this.datayuey=[] let paramdata={ - objectType:1, - planStatus:this.type, + objectType:this.tid=='pieone'?2: 1, + planStatus:this.tid=='pieone'?'': this.type, + PlanCategory:this.tid=='pieone'?this.type:'', TrendType:this.echartsData.selectType } await this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Trends`) @@ -281,8 +298,9 @@ export class echartsComponent implements OnInit { this.dataYearX=[] this.dataYearY=[] let paramdata={ - objectType:1, - planStatus:this.type, + objectType:this.tid=='pieone'?2: 1, + planStatus:this.tid=='pieone'?'': this.type, + PlanCategory:this.tid=='pieone'?this.type:'', TrendType:this.echartsData.selectType } await this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Trends`) @@ -302,7 +320,10 @@ export class echartsComponent implements OnInit { headtext twoExample:any; tabledata - twoInit (X=this.datayuex, Y=this.datayuey) { + twoInit (X, Y) { + /* X.forEach((element,index,array) => { + array[index]=array[index]+'月' + }); */ let that = this this.twoExample = echarts.init(document.getElementById('two'), 'skinUpp'); var option = { @@ -393,7 +414,7 @@ export class echartsComponent implements OnInit { if (this.twoExample.containPixel('grid',pointInPixel)) { let xIndex=this.twoExample.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0]; if(this.echartsData.selectType==2){ - this.router.navigate(['/statisticanalysis/stataPageThereYearComponent'],{queryParams:{'level':this.headtext,'headtext':option.title.text,'type':this.type,'year':X[xIndex]}}); + this.router.navigate(['/statisticanalysis/stataPageThereYearComponent'],{queryParams:{'level':this.headtext,'headtext':X[xIndex],'type':this.type,'tid':this.tid}}); }else{ /*事件处理代码书写位置*/ if(this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2'){ @@ -403,7 +424,7 @@ export class echartsComponent implements OnInit { //this.router.navigate(['/statisticanalysis/statePageOne/name'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':this.headtext,'type':this.type}}); } else if(this.echartsData.level=='3'){ //中队跳转 - this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'name':params.name,'type':this.type}}); + this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'name':params.name,'type':this.type,'tid':this.tid}}); } } 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 d7a2ce8..a7f2b45 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: 2021-04-07 10:51:10 + * @LastEditTime: 2021-04-20 15:42:08 */ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; @@ -29,6 +29,7 @@ export class PageZhongDuiDetailsComponent implements OnInit { tabledata organizationId=[] padHw + tid ngOnInit(): void { if(sessionStorage.getItem('refresh') === 'true') { sessionStorage.removeItem('refresh'); @@ -47,6 +48,7 @@ export class PageZhongDuiDetailsComponent implements OnInit { this.headName=level; this.type=param.type this.lastid=param.id + this.tid=param.tid }); window.setTimeout(()=>{ @@ -59,10 +61,11 @@ export class PageZhongDuiDetailsComponent implements OnInit { } async getechartsdata(){ let paramdata={ - planStatus:this.type, + planStatus:this.tid=='pieone'?'': this.type, + PlanCategory:this.tid=='pieone'?this.type:'', OrganizationId:this.lastid } - await this.data.getData(paramdata,`/api/StatisticsAnalysis/Plans/Status`) + await this.data.getData(paramdata,this.tid=='pieone'?'/api/StatisticsAnalysis/Plans/Category': `/api/StatisticsAnalysis/Plans/Status`) this.tabledata=JSON.parse(JSON.stringify(this.data.allDate)) // console.log(this.tabledata) for(var i=0;i