Browse Source

[修改]预案状态分析增加一到五级预案查看

zhuzhou
chenjingyu 4 years ago
parent
commit
e964cf85ed
  1. 4
      src/app/plan-audit/plan-record/plan-record.component.html
  2. 15
      src/app/plan-audit/plan-record/plan-record.component.ts
  3. 2
      src/app/plan-audit/wait-examineer/wait-examineer.component.html
  4. 19
      src/app/statistic-analysis/addUnit/add-unit-one/add-unit-one.component.ts
  5. 4
      src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.ts
  6. 18
      src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.ts
  7. 2
      src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.scss
  8. 4
      src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.ts
  9. 7
      src/app/statistic-analysis/all-plan/all-plan.component.ts
  10. 11
      src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts
  11. 38
      src/app/statistic-analysis/echarts-data.service.ts
  12. 6
      src/app/statistic-analysis/state/page-one/page-one.component.html
  13. 15
      src/app/statistic-analysis/state/page-one/page-one.component.scss
  14. 108
      src/app/statistic-analysis/state/page-one/page-one.component.ts
  15. 16
      src/app/statistic-analysis/state/page-there-year/page-there-year.component.ts
  16. 13
      src/app/statistic-analysis/state/page-there/page-there.component.ts
  17. 11
      src/app/statistic-analysis/state/page-two-name/page-two-name.component.ts
  18. 61
      src/app/statistic-analysis/state/page-two-time/page-two-time.component.ts
  19. 11
      src/app/statistic-analysis/state/page-zhong-dui-details/page-zhong-dui-details.component.ts

4
src/app/plan-audit/plan-record/plan-record.component.html

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-12-25 10:19:31 * @Date: 2020-12-25 10:19:31
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-03-26 14:49:40 * @LastEditTime: 2021-04-21 15:24:43
--> -->
<div class="box"> <div class="box">
<div class="boxleft"> <div class="boxleft">
@ -112,7 +112,7 @@
'Ⅴ级预案':item.contentType=='6'?'应急预案(国家级)':item.contentType=='7'?'应急预案(市级)':item.contentType=='8'?'类型预案':item.contentType=='11'?'重点单位':item.contentType=='12'?'水源':item.contentType=='13'?'消防力量':item.contentType=='14'?'联动力量':'未知'}}</td> 'Ⅴ级预案':item.contentType=='6'?'应急预案(国家级)':item.contentType=='7'?'应急预案(市级)':item.contentType=='8'?'类型预案':item.contentType=='11'?'重点单位':item.contentType=='12'?'水源':item.contentType=='13'?'消防力量':item.contentType=='14'?'联动力量':'未知'}}</td>
<td style="width: 15%;">{{item.title}}</td> <td style="width: 15%;">{{item.title}}</td>
<td style="width: 10%;" [ngClass]="{'green': item.operation == '1','red':item.operation == '2','blue':item.operation == '0'}">{{item.operation=='0'?'新增':item.operation=='1'?'更新':'删除'}}</td> <td style="width: 10%;" [ngClass]="{'green': item.operation == '1','red':item.operation == '2','blue':item.operation == '0'}">{{item.operation=='0'?'新增':item.operation=='1'?'更新':'删除'}}</td>
<td style="width: 15%;">{{item.verifyOrganizationName}}</td> <td style="width: 15%;">{{item.organizationName}}</td>
<td style="width: 15%;" [ngClass]="{'green': item.verifyState == '1'||item.verifyState == '4','red':item.verifyState == '2'||item.verifyState == '5'}">{{item.verifyState=='0'?'待初审':item.verifyState=='1'? <td style="width: 15%;" [ngClass]="{'green': item.verifyState == '1'||item.verifyState == '4','red':item.verifyState == '2'||item.verifyState == '5'}">{{item.verifyState=='0'?'待初审':item.verifyState=='1'?
'初审通过':item.verifyState=='2'?'初审驳回':item.verifyState=='3'?'待终审':item.verifyState=='4'?'终审通过':'终审驳回'}}</td> '初审通过':item.verifyState=='2'?'初审驳回':item.verifyState=='3'?'待终审':item.verifyState=='4'?'终审通过':'终审驳回'}}</td>
<td style="width: 15%;">{{item.creatorName}}</td> <td style="width: 15%;">{{item.creatorName}}</td>

15
src/app/plan-audit/plan-record/plan-record.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-12-25 10:19:31 * @Date: 2020-12-25 10:19:31
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-03-26 15:21:16 * @LastEditTime: 2021-04-22 10:47:06
*/ */
import { Component, OnInit,Inject } from '@angular/core'; import { Component, OnInit,Inject } from '@angular/core';
import { FormControl } from '@angular/forms'; import { FormControl } from '@angular/forms';
@ -123,18 +123,7 @@ export class PlanRecordComponent implements OnInit {
this.addtime='' this.addtime=''
this.endtime='' this.endtime=''
let level = sessionStorage.getItem("level"); let level = sessionStorage.getItem("level");
if(level == "0"){//如果是总队 this.PlanLevel=''
this.PlanLevel=0
}
if(level == "1"){//如果是支队
this.PlanLevel=1
}
if(level == "2"){//如果是大队
this.PlanLevel=2
}
if(level == "3"){//如果是中队
this.PlanLevel=3
}
this.getAlltabledate() this.getAlltabledate()
} }
//表格点击事件 //表格点击事件

2
src/app/plan-audit/wait-examineer/wait-examineer.component.html

@ -67,7 +67,7 @@
'Ⅴ级预案':item.contentType=='6'?'应急预案(国家级)':item.contentType=='7'?'应急预案(市级)':item.contentType=='8'?'类型预案':item.contentType=='11'?'重点单位':item.contentType=='12'?'水源':item.contentType=='13'?'消防力量':item.contentType=='14'?'联动力量':'未知'}}</td> 'Ⅴ级预案':item.contentType=='6'?'应急预案(国家级)':item.contentType=='7'?'应急预案(市级)':item.contentType=='8'?'类型预案':item.contentType=='11'?'重点单位':item.contentType=='12'?'水源':item.contentType=='13'?'消防力量':item.contentType=='14'?'联动力量':'未知'}}</td>
<td style="width: 15%;">{{item.title}}</td> <td style="width: 15%;">{{item.title}}</td>
<td style="width: 10%;" [ngClass]="{'green': item.operation == '1','red':item.operation == '2','blue':item.operation == '0'}">{{item.operation=='0'?'新增':item.operation=='1'?'更新':'删除'}}</td> <td style="width: 10%;" [ngClass]="{'green': item.operation == '1','red':item.operation == '2','blue':item.operation == '0'}">{{item.operation=='0'?'新增':item.operation=='1'?'更新':'删除'}}</td>
<td style="width: 15%;">{{item.verifyOrganizationName}}</td> <td style="width: 15%;">{{item.organizationName}}</td>
<td style="width: 15%;" [ngClass]="{'green': item.verifyState == '1'||item.verifyState == '4','red':item.verifyState == '2'||item.verifyState == '5'}">{{item.verifyState=='0'?'待初审':item.verifyState=='1'? <td style="width: 15%;" [ngClass]="{'green': item.verifyState == '1'||item.verifyState == '4','red':item.verifyState == '2'||item.verifyState == '5'}">{{item.verifyState=='0'?'待初审':item.verifyState=='1'?
'初审通过':item.verifyState=='2'?'初审驳回':item.verifyState=='3'?'待终审':item.verifyState=='4'?'终审通过':'终审驳回'}}</td> '初审通过':item.verifyState=='2'?'初审驳回':item.verifyState=='3'?'待终审':item.verifyState=='4'?'终审通过':'终审驳回'}}</td>
<td style="width: 15%;">{{item.creatorName}}</td> <td style="width: 15%;">{{item.creatorName}}</td>

19
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 { Router } from '@angular/router';
import {EchartsDataService,} from '../../echarts-data.service'; import {EchartsDataService,} from '../../echarts-data.service';
declare var echarts: any; declare var echarts: any;
declare var CryptoJS
@Component({ @Component({
selector: 'app-add-unit-one', selector: 'app-add-unit-one',
templateUrl: './add-unit-one.component.html', templateUrl: './add-unit-one.component.html',
@ -14,6 +15,7 @@ export class AddUnitOneComponent implements OnInit {
setTimeoutObj//延时器需要清除 setTimeoutObj//延时器需要清除
tabledata tabledata
padHw padHw
orid//获取本组织id
ngOnInit(): void { ngOnInit(): void {
if(window.matchMedia("(max-width: 1400px)").matches){ 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.buildData.push(this.echartsData.getData(null,`/api/StatisticsAnalysis/BuildingTypes`))
this.orData=this.echartsData.getData(null,`/api/StatisticsAnalysis/Companies`) */ 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.setTimeoutObj = window.setTimeout(()=>{
this.getechartsdata() this.getechartsdata()
}) })
@ -150,7 +156,18 @@ export class AddUnitOneComponent implements OnInit {
tid=="pieone"?this.echartsData.zuzhiorBuilding="zhi":this.echartsData.zuzhiorBuilding="building" 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){ if((this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2')&&this.tishiData.length>0){
//总队,支队,大队跳转 //总队,支队,大队跳转
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'}}); 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{ }else{
//中队跳转 //中队跳转
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1,'buildid':tid!="pieone"?params.data.id:'','jsid':tid=="pieone"?params.data.id:''}}); this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1,'buildid':tid!="pieone"?params.data.id:'','jsid':tid=="pieone"?params.data.id:''}});

4
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.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.oneInit (this.date,this.dateNum)
this.qopao=this.serviceData.qipao(this.qopao,this.dateNum,this.zhiNameData) this.qopao=this.serviceData.qipao(this.qopao,this.dateNum,this.zhiNameData)

18
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`) await this.serviceData.getData(this.zhiorbuild=="zhi"?parbuild:parzhi,`/api/StatisticsAnalysis/Trends`)
this.setTimeoutObj = window.setTimeout(() => { this.setTimeoutObj = window.setTimeout(() => {
this.tabledata=JSON.parse(JSON.stringify(this.serviceData.allDate)) 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.tabledata[0].length;i++){ for(var i=0;i<this.tabledata[0].length;i++){
if(this.tabledata[0][i].month>=this.serviceData.selectStartMonth||this.tabledata[0][i].month<=this.serviceData.selectEndMonth){ if(this.tabledata[0][i].month>=this.serviceData.selectStartMonth||this.tabledata[0][i].month<=this.serviceData.selectEndMonth){
this.date.push(this.tabledata[0][i].month) 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.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.oneInit (this.date,this.dateNum)
this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum,this.date) this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum,this.date)
@ -79,7 +81,7 @@ export class AddUnitTwoTimeComponent implements OnInit {
selectType:string = 'month'; //选择当前的 查询类型 按月/年 selectType:string = 'month'; //选择当前的 查询类型 按月/年
//查询数据 //查询数据
years:any = [2020,2021] years= []
selectMonth:any = [1,2,3,4,5,6,7,8,9,10,11,12] 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.zongcount=this.zongcount+this.tabledata[0][i].count
} }
} }
//this.oneInit (this.date,this.dateNum) //this.oneInit (this.date,this.dateNum)
this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum2,this.date2) this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum2,this.date2)
this.twoInit (this.date2,this.dateNum2,'year') this.twoInit (this.date2,this.dateNum2,'year')
@ -157,6 +160,9 @@ export class AddUnitTwoTimeComponent implements OnInit {
if(this.selectType == "year"){ if(this.selectType == "year"){
this.zongcount=0 this.zongcount=0
this.date2=[]
this.dateNum2=[]
this.years=[]
this.serviceData.selectType=2 this.serviceData.selectType=2
let parzhi={ let parzhi={
objectType:0, objectType:0,
@ -175,12 +181,14 @@ export class AddUnitTwoTimeComponent implements OnInit {
await this.serviceData.getData(this.zhiorbuild=="zhi"?parbuild:parzhi,`/api/StatisticsAnalysis/Trends`) await this.serviceData.getData(this.zhiorbuild=="zhi"?parbuild:parzhi,`/api/StatisticsAnalysis/Trends`)
this.setTimeoutObj = window.setTimeout(() => { this.setTimeoutObj = window.setTimeout(() => {
this.tabledata=JSON.parse(JSON.stringify(this.serviceData.allDate)) this.tabledata=JSON.parse(JSON.stringify(this.serviceData.allDate))
// console.log(this.tabledata) console.log(this.tabledata)
for(var i=0;i<this.tabledata[0].length;i++){ for(var i=0;i<this.tabledata[0].length;i++){
this.date2.push(this.tabledata[0][i].year)
this.dateNum2.push(this.tabledata[0][i].count) this.dateNum2.push(this.tabledata[0][i].count)
this.zongcount=this.zongcount+this.tabledata[0][i].count this.zongcount=this.zongcount+this.tabledata[0][i].count
this.years.push(this.tabledata[0][i].year)
} }
this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum,this.date) //this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum,this.date)
this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum2,this.date2) this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum2,this.date2)
this.twoInit (this.date2,this.dateNum2,'year') this.twoInit (this.date2,this.dateNum2,'year')
}); });

2
src/app/statistic-analysis/addUnit/add-unit-two-type-statistics/add-unit-two-type-statistics.component.scss

@ -38,7 +38,7 @@
.publicCss{ .publicCss{
width: 100%; width: 100%;
@media screen and (max-device-width:1400px){ @media screen and (max-device-width:1400px){
height: 600px; height: 550px;
top: 60%; top: 60%;
} }
@media screen and (min-device-width:1400px){ @media screen and (min-device-width:1400px){

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

@ -62,7 +62,7 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
} }
await this.data.getData(this.zhiorbuild=="zhi"?paramsdata:null,this.zhiorbuild=="zhi"?`/api/StatisticsAnalysis/Companies/Organizations/${this.lastId}`:`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.lastId}`) await this.data.getData(this.zhiorbuild=="zhi"?paramsdata:null,this.zhiorbuild=="zhi"?`/api/StatisticsAnalysis/Companies/Organizations/${this.lastId}`:`/api/StatisticsAnalysis/Companies/BuildingTypes/${this.lastId}`)
this.tabledata=JSON.parse(JSON.stringify(this.data.allDate)) this.tabledata=JSON.parse(JSON.stringify(this.data.allDate))
//console.log(this.tabledata) console.log(this.tabledata)
if(this.zhiorbuild=="zhi"){ if(this.zhiorbuild=="zhi"){
for(var i=0;i<this.tabledata[0].buildingTypes.length;i++){ for(var i=0;i<this.tabledata[0].buildingTypes.length;i++){
this.buildingData.push(this.tabledata[0].buildingTypes[i].buildingTypeName) this.buildingData.push(this.tabledata[0].buildingTypes[i].buildingTypeName)
@ -380,7 +380,7 @@ export class AddUnitTwoTypeStatisticsComponent implements OnInit {
}, },
grid: { grid: {
containLabel:true, containLabel:true,
top:90, top:80,
// top: 10 // top: 10
}, },
xAxis: { xAxis: {

7
src/app/statistic-analysis/all-plan/all-plan.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2021-03-15 11:32:30 * @Date: 2021-03-15 11:32:30
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-03-25 10:41:45 * @LastEditTime: 2021-04-20 17:14:54
*/ */
import { Component, OnInit, ViewChild, Inject } from '@angular/core'; import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http' import { HttpClient } from '@angular/common/http'
@ -35,9 +35,11 @@ export class AllPlanComponent implements OnInit {
this.titlename = params['name']; this.titlename = params['name'];
this.type = params['type']; this.type = params['type'];
this.jsId=params['id'] this.jsId=params['id']
this.tid=params.tid
}); });
this.getAlltabledate() this.getAlltabledate()
} }
tid
displayedColumns: string[] = ['unitname','modifiedTime','organizationName','buildingTypes','operation']; displayedColumns: string[] = ['unitname','modifiedTime','organizationName','buildingTypes','operation'];
tabledataSource tabledataSource
titlename //上个页面传过来的名称 titlename //上个页面传过来的名称
@ -66,7 +68,8 @@ export class AllPlanComponent implements OnInit {
getAlltabledate(){ getAlltabledate(){
let paramtedate:any={ let paramtedate:any={
organizationId:this.jsId||'', organizationId:this.jsId||'',
PlanStatus:this.type, planStatus:this.tid=='pieone'?'': this.type,
PlanCategory:this.tid=='pieone'?this.type:'',
PageNumber: this.PageNumber || '1', PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0] PageSize: this.pageSizeOptions[0]
} }

11
src/app/statistic-analysis/buildingType/building-type-one/building-type-one.component.ts

@ -47,6 +47,7 @@ export class BuildingTypeOneComponent implements OnInit {
} }
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
// console.log(this.tabledata) // console.log(this.tabledata)
//console.log(this.echartsData.orid)
for(var i=0;i<this.tabledata[0].buildingTypes.length;i++){ for(var i=0;i<this.tabledata[0].buildingTypes.length;i++){
this.lengthdata.push(this.tabledata[0].buildingTypes[i].buildingTypeName) this.lengthdata.push(this.tabledata[0].buildingTypes[i].buildingTypeName)
this.count=this.count+this.tabledata[0].buildingTypes[i].count this.count=this.count+this.tabledata[0].buildingTypes[i].count
@ -119,7 +120,17 @@ export class BuildingTypeOneComponent implements OnInit {
if(this.tabledata[0].buildingTypes[i].buildingTypeName==params.name){ if(this.tabledata[0].buildingTypes[i].buildingTypeName==params.name){
if((this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2')&&this.tabledata[0].buildingTypes[i].organizations.length>0){ if((this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2')&&this.tabledata[0].buildingTypes[i].organizations.length>0){
//总队,支队,大队跳转 //总队,支队,大队跳转
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}}); 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 { }else {
//中队跳转 //中队跳转
this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1,'buildid':params.data.id}}); this.router.navigate(['/statisticanalysis/CompangInfo'],{queryParams:{'name':params.name,'type':1,'buildid':params.data.id}});

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

@ -3,6 +3,7 @@ import { Observable, ReplaySubject } from 'rxjs';
import { HttpClient } from '@angular/common/http' import { HttpClient } from '@angular/common/http'
import { promise } from 'selenium-webdriver'; import { promise } from 'selenium-webdriver';
import { resolve } from 'dns'; import { resolve } from 'dns';
declare var CryptoJS
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
@ -477,20 +478,36 @@ export class EchartsDataService {
} }
//预案表格提示 //预案表格提示
apidata=[] apidata=[]
biaogeTishiyuan(datas){ biaogeTishiyuan(datas,tid){
//localStorage.setItem('tishi',this.tishiData) //localStorage.setItem('tishi',this.tishiData)
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 countall=0//总计
var countbi=0//站比 var countbi=0//站比
var allCountbi=0//总站比 var allCountbi=0//总站比
if(tid=='pieone'){
this.tishiData=''
for(var a in this.obdata[0].planCategoryStatistics.planCategories){
if(this.obdata[0].planCategoryStatistics.planCategories[a].planCategoryName==datas.planStatusName){
this.tishiData=this.obdata[0].planCategoryStatistics.planCategories[a].organizations
}
}
for(var i=0;i<this.tishiData.length;i++){ for(var i=0;i<this.tishiData.length;i++){
countall+=this.tishiData[i].count countall+=this.tishiData[i].count
} }
}else{
for(var a in this.obdata[0].planStatusStatistics.planStatuses){
if(this.obdata[0].planStatusStatistics.planStatuses[a].planStatusName==datas.planStatusName){
this.tishiData=this.obdata[0].planStatusStatistics.planStatuses[a].organizations
}
}
for(var i=0;i<this.tishiData.length;i++){
countall+=this.tishiData[i].count
}
}
//console.log(this.tishiData)
this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>' this.res= '<div class="tishi" style=" backgroundColor:rgba(255,255,255,1);width:100%;height:100%;"><div style="padding:10px 0 5px 0"><span style="color:#FFFFFF;font-size:27px;text-align: center;display:block;">'+datas.name+'</span></div>'
this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >'; this.res+='</br><div style="width:300px;height:100%;padding:0 20px 15px 20px"><table style="width:300px;font-size:16px; color:#FFFFFF;border-collapse:collapse;"cellspacing="0"; >';
this.res+='<thead style="font-size:18px;"><tr>'; this.res+='<thead style="font-size:18px;"><tr>';
@ -548,7 +565,13 @@ export class EchartsDataService {
//获取所有数据 //获取所有数据
allDate=[] allDate=[]
obdata obdata
orid
async getData(paramsdata,api){ 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.allDate=[]
this.obdata=null this.obdata=null
let result = await new Promise((resolve, reject)=>{ let result = await new Promise((resolve, reject)=>{
@ -558,7 +581,7 @@ export class EchartsDataService {
}) })
this.allDate.push(result) this.allDate.push(result)
this.obdata=JSON.parse(JSON.stringify(this.allDate)) this.obdata=JSON.parse(JSON.stringify(this.allDate))
// console.log(this.obdata) console.log(this.obdata)
} }
selectType=0//选择年月 selectType=0//选择年月
@ -567,4 +590,5 @@ export class EchartsDataService {
selectStartMonth=1 selectStartMonth=1
selectEndMonth=12 selectEndMonth=12
} }

6
src/app/statistic-analysis/state/page-one/page-one.component.html

@ -9,7 +9,11 @@
<body> <body>
<!--饼状图 --> <!--饼状图 -->
<div id="indexBzt" style="width: 100%;height: 100%;"></div> <div id="indexBzt" >
<div id="pieone" class="pieone"></div>
<div id="pietwo" class="pietwo"></div>
</div>
</body> </body>

15
src/app/statistic-analysis/state/page-one/page-one.component.scss

@ -6,3 +6,18 @@
text-align: center; 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%;
}
}

108
src/app/statistic-analysis/state/page-one/page-one.component.ts

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

16
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) { } constructor(private router: Router,public dialog: MatDialog,public snackBar: MatSnackBar,private serviceData: EchartsDataService,public route: ActivatedRoute) { }
tid
year:String year:String
buildingTypeName:String buildingTypeName:String
level:String level:String
@ -22,13 +23,15 @@ export class PageThereYearComponent implements OnInit {
type type
tabledata//获取所有数据 tabledata//获取所有数据
lastyears//上个页面传过来的年份 lastyears//上个页面传过来的年份
count=0//总数
ngOnInit(): void { ngOnInit(): void {
this.dateInit () this.dateInit ()
this.route.queryParams.subscribe(params => { this.route.queryParams.subscribe(params => {
this.year = params['level']; this.year = params['level'];
this.buildingTypeName = params['headtext']; this.buildingTypeName = params['headtext'];
this.type=params['type'] this.type=params['type']
this.lastyears=params['years'] //this.lastyears=params['years']
this.tid=params.tid
}); });
this.setTimeoutObj = window.setTimeout(()=>{ this.setTimeoutObj = window.setTimeout(()=>{
@ -42,9 +45,10 @@ export class PageThereYearComponent implements OnInit {
} }
async getechartsData(){ async getechartsData(){
let paramdata={ let paramdata={
planStatus:this.type, planStatus:this.tid=='pieone'?'': this.type,
PlanCategory:this.tid=='pieone'?this.type:'',
TrendYear:this.lastyears||'', TrendYear:this.lastyears||'',
objectType:1, objectType:this.tid=='pieone'?2: 1,
TrendType:0 TrendType:0
} }
await this.serviceData.getData(paramdata,`/api/StatisticsAnalysis/Trends`) await this.serviceData.getData(paramdata,`/api/StatisticsAnalysis/Trends`)
@ -53,7 +57,11 @@ export class PageThereYearComponent implements OnInit {
for(var i=0;i<this.tabledata[0].length;i++){ for(var i=0;i<this.tabledata[0].length;i++){
this.date.push(this.tabledata[0][i].month) this.date.push(this.tabledata[0][i].month)
this.dateNum.push(this.tabledata[0][i].count) this.dateNum.push(this.tabledata[0][i].count)
this.count+=this.tabledata[0][i].count
} }
this.date.forEach((value,index,array)=>{
this.date[index]=this.date[index]+'月'
})
this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum,this.date) this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum,this.date)
this.detailEcharts() this.detailEcharts()
} }
@ -124,7 +132,7 @@ export class PageThereYearComponent implements OnInit {
}, },
// 标题 // 标题
title: { title: {
text: `${this.year}${this.buildingTypeName}`, text: `${this.year}${this.buildingTypeName}总数(${this.count}`,
//top: -14, //top: -14,
left: 'center', left: 'center',
textStyle:{ textStyle:{

13
src/app/statistic-analysis/state/page-there/page-there.component.ts

@ -25,6 +25,7 @@ export class PageThereComponent implements OnInit {
tabledata tabledata
organizationId=[] organizationId=[]
lastid lastid
tid
ngOnDestroy():void{ ngOnDestroy():void{
this.zhutu.clear() this.zhutu.clear()
@ -50,7 +51,8 @@ export class PageThereComponent implements OnInit {
this.headtext=param.headtext this.headtext=param.headtext
datayuex=param.level datayuex=param.level
this.zhong=param.zhong this.zhong=param.zhong
this.headName=datayuex+'月'+this.headtext; this.headName=datayuex+this.headtext;
this.tid=param.tid
//console.log(headName) //console.log(headName)
}); });
@ -63,10 +65,11 @@ export class PageThereComponent implements OnInit {
selectType:string = 'month'; //选择当前的 查询类型 按月/年 selectType:string = 'month'; //选择当前的 查询类型 按月/年
async getechartsdata(){ async getechartsdata(){
let paramdata={ let paramdata={
planStatus:this.type, planStatus:this.tid=='pieone'?'': this.type,
PlanCategory:this.tid=='pieone'?this.type:'',
OrganizationId:this.lastid 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)) this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
// console.log(this.tabledata) // console.log(this.tabledata)
for(var i=0;i<this.tabledata[0].organizations.length;i++){ for(var i=0;i<this.tabledata[0].organizations.length;i++){
@ -230,9 +233,9 @@ export class PageThereComponent implements OnInit {
let xIndex=this.zhutu.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0]; let xIndex=this.zhutu.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
/*事件处理代码书写位置*/ /*事件处理代码书写位置*/
if((this.echartsData.level=='0'||this.echartsData.level=='1')&&this.tabledata[0].organizations[xIndex].subOrganizations.length>=1){ if((this.echartsData.level=='0'||this.echartsData.level=='1')&&this.tabledata[0].organizations[xIndex].subOrganizations.length>=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{ }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}});
} }
} }

11
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.route.queryParams.subscribe(param=>{
this.headname=param.level this.headname=param.level
this.type=param.type this.type=param.type
this.tid=param.tid
}); });
@ -40,9 +41,10 @@ export class PageTwoNameComponent implements OnInit {
} }
async getechartsdata(){ async getechartsdata(){
let paramdata={ 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)) this.tabledata=JSON.parse(JSON.stringify(this.data.allDate))
//console.log(this.tabledata) //console.log(this.tabledata)
for(var i=0;i<this.tabledata[0].organizations.length;i++){ for(var i=0;i<this.tabledata[0].organizations.length;i++){
@ -53,6 +55,7 @@ export class PageTwoNameComponent implements OnInit {
this.tiaoshiPao=this.data.qipao(this.tiaoshiPao,this.zhiNumData,this.zhiNameData) this.tiaoshiPao=this.data.qipao(this.tiaoshiPao,this.zhiNumData,this.zhiNameData)
this.planAdd() this.planAdd()
} }
tid//上个页面点的第几个饼状图
padHw padHw
headname//标题 headname//标题
type//预案类型 type//预案类型
@ -183,9 +186,9 @@ export class PageTwoNameComponent implements OnInit {
let xIndex=this.addEchart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0]; let xIndex=this.addEchart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
/*事件处理代码书写位置*/ /*事件处理代码书写位置*/
if((this.data.level=='0'||this.data.level=='1')&&this.tabledata[0].organizations[xIndex].subOrganizations.length>=1){ if((this.data.level=='0'||this.data.level=='1')&&this.tabledata[0].organizations[xIndex].subOrganizations.length>=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{ }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}}); //this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'name':option.xAxis.data[xIndex],'id':option.xAxis.id[xIndex],'type':this.type}});

61
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 { DateAdapter } from '@angular/material/core';
import { PageTwoNameComponent } from '../page-two-name/page-two-name.component'; import { PageTwoNameComponent } from '../page-two-name/page-two-name.component';
import {EchartsDataService} from '../../echarts-data.service' import {EchartsDataService} from '../../echarts-data.service'
import { resolve } from 'dns';
declare var echarts: any; declare var echarts: any;
@Component({ @Component({
@ -60,19 +61,25 @@ export class PageTwoTimeComponent implements OnInit {
selectType:string = 'month'; //选择当前的 查询类型 按月/年 selectType:string = 'month'; //选择当前的 查询类型 按月/年
changeTime (e) { async changeTime (e) {
let data = e.value let data = e.value
this.appEcharts.changeTime(data) await this.appEcharts.changeTime(data)
if(e.value=='month'){ if(e.value=='month'){
this.echartsData.selectType=0 this.echartsData.selectType=0
} }
else if(e.value=='year'){ else if(e.value=='year'){
this.years=[]
this.echartsData.selectType=2 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] selectMonth:any = [1,2,3,4,5,6,7,8,9,10,11,12]
tiaoshiPao:any tiaoshiPao:any
datayuey=[270, 253, 244, 199, 189, 173, 160, 198,200] 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<any>,public echartsData:EchartsDataService) { } constructor(private router: Router,private activatedRoute: ActivatedRoute,public snackBar: MatSnackBar,private adapter: DateAdapter<any>,public echartsData:EchartsDataService) { }
tid
zongcount=0 zongcount=0
type type
organizationId=[] organizationId=[]
@ -177,6 +185,7 @@ export class echartsComponent implements OnInit {
this.activatedRoute.queryParams.subscribe(param=>{ this.activatedRoute.queryParams.subscribe(param=>{
this.headtext=param.level this.headtext=param.level
this.type=param.type this.type=param.type
this.tid=param.tid
}); });
window.setTimeout(()=>{ window.setTimeout(()=>{
@ -192,13 +201,14 @@ export class echartsComponent implements OnInit {
//获取数据 //获取数据
async getechartsData(){ async getechartsData(){
let paramdata={ let paramdata={
planStatus:this.type, planStatus:this.tid=='pieone'?'': this.type,
objectType:1, PlanCategory:this.tid=='pieone'?this.type:'',
objectType:this.tid=='pieone'?2: 1,
TrendType:0 TrendType:0
} }
await this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Trends`) await this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Trends`)
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate))
// console.log(this.tabledata) console.log(this.tabledata)
for(var i=0;i<this.tabledata[0].length;i++){ for(var i=0;i<this.tabledata[0].length;i++){
if(this.tabledata[0][i].month>=this.echartsData.selectStartMonth||this.tabledata[0][i].month<=this.echartsData.selectEndMonth){ if(this.tabledata[0][i].month>=this.echartsData.selectStartMonth||this.tabledata[0][i].month<=this.echartsData.selectEndMonth){
this.datayuex.push(this.tabledata[0][i].month) 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.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.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.datayuey,this.datayuex)
//this.oneInit() //this.oneInit()
this.twoInit() this.twoInit(this.datayuex,this.datayuey)
} }
async changeTime (e) { async changeTime (e) {
@ -222,20 +234,24 @@ export class echartsComponent implements OnInit {
this.echartsData.selectType=2 this.echartsData.selectType=2
this.zongcount=0 this.zongcount=0
let paramdata={ let paramdata={
objectType:1, objectType:this.tid=='pieone'?2: 1,
planStatus:this.type, planStatus:this.tid=='pieone'?'': this.type,
PlanCategory:this.tid=='pieone'?this.type:'',
TrendType:this.echartsData.selectType TrendType:this.echartsData.selectType
} }
await this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Trends`) await this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Trends`)
window.setTimeout(()=>{ window.setTimeout(()=>{
this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) 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.tabledata[0].length;i++){ for(var i=0;i<this.tabledata[0].length;i++){
this.dataYearX.push(this.tabledata[0][i].year) this.dataYearX.push(this.tabledata[0][i].year)
this.dataYearY.push(this.tabledata[0][i].count) this.dataYearY.push(this.tabledata[0][i].count)
this.zongcount=this.zongcount+this.tabledata[0][i].count this.zongcount=this.zongcount+this.tabledata[0][i].count
} }
this.dataYearX.forEach((value,index,array)=>{
this.dataYearX[index]=this.dataYearX[index]+'年'
})
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.datayuey,this.datayuex) this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.datayuey,this.datayuex)
//this.oneInit() //this.oneInit()
this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.dataYearY,this.dataYearX) 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.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.datayuey,this.datayuex)
//this.oneInit() //this.oneInit()
this.echartsData.selectType=0 this.echartsData.selectType=0
this.twoInit() this.twoInit(this.datayuex,this.datayuey)
} }
} }
@ -257,8 +273,9 @@ export class echartsComponent implements OnInit {
this.datayuex=[] this.datayuex=[]
this.datayuey=[] this.datayuey=[]
let paramdata={ let paramdata={
objectType:1, objectType:this.tid=='pieone'?2: 1,
planStatus:this.type, planStatus:this.tid=='pieone'?'': this.type,
PlanCategory:this.tid=='pieone'?this.type:'',
TrendType:this.echartsData.selectType TrendType:this.echartsData.selectType
} }
await this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Trends`) await this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Trends`)
@ -281,8 +298,9 @@ export class echartsComponent implements OnInit {
this.dataYearX=[] this.dataYearX=[]
this.dataYearY=[] this.dataYearY=[]
let paramdata={ let paramdata={
objectType:1, objectType:this.tid=='pieone'?2: 1,
planStatus:this.type, planStatus:this.tid=='pieone'?'': this.type,
PlanCategory:this.tid=='pieone'?this.type:'',
TrendType:this.echartsData.selectType TrendType:this.echartsData.selectType
} }
await this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Trends`) await this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Trends`)
@ -302,7 +320,10 @@ export class echartsComponent implements OnInit {
headtext headtext
twoExample:any; twoExample:any;
tabledata tabledata
twoInit (X=this.datayuex, Y=this.datayuey) { twoInit (X, Y) {
/* X.forEach((element,index,array) => {
array[index]=array[index]+'月'
}); */
let that = this let that = this
this.twoExample = echarts.init(document.getElementById('two'), 'skinUpp'); this.twoExample = echarts.init(document.getElementById('two'), 'skinUpp');
var option = { var option = {
@ -393,7 +414,7 @@ export class echartsComponent implements OnInit {
if (this.twoExample.containPixel('grid',pointInPixel)) { if (this.twoExample.containPixel('grid',pointInPixel)) {
let xIndex=this.twoExample.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0]; let xIndex=this.twoExample.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
if(this.echartsData.selectType==2){ 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{ }else{
/*事件处理代码书写位置*/ /*事件处理代码书写位置*/
if(this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2'){ 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}}); //this.router.navigate(['/statisticanalysis/statePageOne/name'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':this.headtext,'type':this.type}});
} else if(this.echartsData.level=='3'){ } 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}});
} }
} }

11
src/app/statistic-analysis/state/page-zhong-dui-details/page-zhong-dui-details.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2020-09-05 13:50:45 * @Date: 2020-09-05 13:50:45
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-04-07 10:51:10 * @LastEditTime: 2021-04-20 15:42:08
*/ */
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
@ -29,6 +29,7 @@ export class PageZhongDuiDetailsComponent implements OnInit {
tabledata tabledata
organizationId=[] organizationId=[]
padHw padHw
tid
ngOnInit(): void { ngOnInit(): void {
if(sessionStorage.getItem('refresh') === 'true') { if(sessionStorage.getItem('refresh') === 'true') {
sessionStorage.removeItem('refresh'); sessionStorage.removeItem('refresh');
@ -47,6 +48,7 @@ export class PageZhongDuiDetailsComponent implements OnInit {
this.headName=level; this.headName=level;
this.type=param.type this.type=param.type
this.lastid=param.id this.lastid=param.id
this.tid=param.tid
}); });
window.setTimeout(()=>{ window.setTimeout(()=>{
@ -59,10 +61,11 @@ export class PageZhongDuiDetailsComponent implements OnInit {
} }
async getechartsdata(){ async getechartsdata(){
let paramdata={ let paramdata={
planStatus:this.type, planStatus:this.tid=='pieone'?'': this.type,
PlanCategory:this.tid=='pieone'?this.type:'',
OrganizationId:this.lastid 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)) this.tabledata=JSON.parse(JSON.stringify(this.data.allDate))
// console.log(this.tabledata) // console.log(this.tabledata)
for(var i=0;i<this.tabledata[0].organizations.length;i++){ for(var i=0;i<this.tabledata[0].organizations.length;i++){
@ -176,7 +179,7 @@ export class PageZhongDuiDetailsComponent implements OnInit {
const pointInPixel= [params.offsetX, params.offsetY]; const pointInPixel= [params.offsetX, params.offsetY];
if (this.detailPlanEchart.containPixel('grid',pointInPixel)){ if (this.detailPlanEchart.containPixel('grid',pointInPixel)){
let xIndex=this.detailPlanEchart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0]; let xIndex=this.detailPlanEchart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
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}});
} }
}); });

Loading…
Cancel
Save