From 33af6afb9ed5c040983c0913da0663840d850e79 Mon Sep 17 00:00:00 2001
From: chenjingyu <1148019379@qq.com>
Date: Sat, 30 Oct 2021 15:33:23 +0800
Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E6=8A=A5=E8=A1=A8=E7=BB=9F?=
=?UTF-8?q?=E8=AE=A1json=E5=AD=97=E6=AE=B5=E9=81=8D=E5=8E=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app/pipes/boolean.pipe.ts | 18 +++
.../combined-query.component.html | 29 +++-
.../combined-query.component.scss | 33 ++++-
.../combined-query.component.ts | 133 ++++++++++++++++--
4 files changed, 196 insertions(+), 17 deletions(-)
diff --git a/src/app/pipes/boolean.pipe.ts b/src/app/pipes/boolean.pipe.ts
index 025507f..a2e8c63 100644
--- a/src/app/pipes/boolean.pipe.ts
+++ b/src/app/pipes/boolean.pipe.ts
@@ -63,3 +63,21 @@ export class differentContentTitle implements PipeTransform {
}
}
+@Pipe({ name: 'yuan' })
+export class yuan implements PipeTransform {
+ transform(value: string): string {
+ if (value == 'LevelOne') {
+ return '一级预案'
+ } else if (value == 'LevelTwo') {
+ return '二级预案'
+ } else if (value == 'LevelThree') {
+ return '三级预案'
+ }else if (value == 'LevelFour') {
+ return '四级预案'
+ }else if (value == 'LevelFive') {
+ return '五级预案'
+ }else if (value == 'PlanText') {
+ return '文本预案'
+ }
+ }
+}
diff --git a/src/app/statistic-analysis/combined-query/combined-query.component.html b/src/app/statistic-analysis/combined-query/combined-query.component.html
index 30db40c..f78fac7 100644
--- a/src/app/statistic-analysis/combined-query/combined-query.component.html
+++ b/src/app/statistic-analysis/combined-query/combined-query.component.html
@@ -72,8 +72,8 @@
- 新增
- 维护更新
+ 新增
+ 维护更新
@@ -82,9 +82,6 @@
- 应急预案(国家级)
- 应急预案(市级)
- 类型预案
Ⅰ级预案
Ⅱ级预案
Ⅲ级预案
@@ -105,13 +102,33 @@
-
+
+
+
+ {{item}} |
+
+
+
+ {{eletd}} |
+
+
+
+
+
+ {{item}} |
+
+
+
+ {{eletd}} |
+
+
diff --git a/src/app/statistic-analysis/combined-query/combined-query.component.scss b/src/app/statistic-analysis/combined-query/combined-query.component.scss
index 6b834aa..a82c777 100644
--- a/src/app/statistic-analysis/combined-query/combined-query.component.scss
+++ b/src/app/statistic-analysis/combined-query/combined-query.component.scss
@@ -88,6 +88,10 @@
}
}
.body{
+ height: 100%;
+ width: 100%;
+ overflow-y: auto;
+ overflow-x: auto;
.buttonbox{
padding-left: 50px;
button{
@@ -97,8 +101,35 @@
.tablebox{
table{
width: 100%;
- // margin-left: 2%;
+ background-color: white;
margin-top: 15px;
+ table-layout: fixed;
+ thead,tr{
+ border-bottom: 1px solid grey;
+ }
+ th {
+ border-bottom: 1px solid #999;
+ //width: 30%;
+ font-size: 16px;
+ text-align: center;
+ height: 60px;
+ line-height: 60px;
+ }
+ td {
+
+ height: 50px;
+ line-height: 50px;
+ text-align: center;
+ font-size: 16px;
+ margin-left: 3px;
+ border-bottom: 1px solid #999;
+ .spantext{
+ margin-left: 7px;
+ }
+ .buleColor{
+ color: #2196f3;
+ }
+ }
}
mat-paginator{
width:100%;
diff --git a/src/app/statistic-analysis/combined-query/combined-query.component.ts b/src/app/statistic-analysis/combined-query/combined-query.component.ts
index 5a37e7e..2204428 100644
--- a/src/app/statistic-analysis/combined-query/combined-query.component.ts
+++ b/src/app/statistic-analysis/combined-query/combined-query.component.ts
@@ -54,10 +54,12 @@ export class CombinedQueryComponent implements OnInit {
dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
myControl = new FormControl();
hasChild = (_: number, node: any) => node.expandable;
- displayedColumns: string[] = ['组织名称', 'addpeople', 'level'];//, 'addtime', 'plantype', 'auditStatus', 'openRange', 'projectlevel', 'operation'
+ displayedColumns: string[] = ['组织名称', '总数'];//, 'addtime', 'plantype', 'auditStatus', 'openRange', 'projectlevel', 'operation'
+ yuanColumns:string[]=['组织名称', '总数'];
allorganizations: any //所有组织机构
allunittype: any //所有单位类型
- tabledataSource: any //表格数据
+ tabledataSource=[] //单位表格数据
+ yuanTable=[]//预案表格数据
url
findTj=0//查询条件
@@ -85,7 +87,6 @@ export class CombinedQueryComponent implements OnInit {
//判断选了哪一个
selectedIndexChange(e){
this.selected.setValue(e)
- console.log(e)
this.preparelevels=Number(e)
}
//获得所有预案或单位信息
@@ -97,16 +98,128 @@ export class CombinedQueryComponent implements OnInit {
TimeIntervalStart:this.addtime||'',
TimeIntervalEnd:this.endtime||'',
BuildingTypeIds:this.unittype||'',
+ CompanyStatus:this.preparelevel||''
}
- this.http.get("/api/StatisticsAnalysis/ReportTable", { params: paramsdata }).subscribe((data: any) => {
+ let yuandata={
+ QueryMode:this.preparelevels,
+ OrganizationId:this.jsId||'',
+ HasChildren:this.jscheck||'',
+ TimeIntervalStart:this.addtime||'',
+ TimeIntervalEnd:this.endtime||'',
+ PlanCategory:this.planCategory||'',
+ PlanType:this.reservePlanType||''
+ }
+ this.http.get("/api/StatisticsAnalysis/ReportTable", { params:this.preparelevels==0? paramsdata:yuandata }).subscribe((data: any) => {
console.log(data)
- this.tabledataSource=data
+ //this.tabledataSource=data
if(this.preparelevels==0){
- this.tabledataSource.forEach(element => {
- this.displayedColumns.push(element)
+ this.tabledataSource=[]
+ this.displayedColumns=['组织名称', '总数']
+ data.forEach((element,i,value) => {
+ this.tabledataSource.push({name:[element.orgName,element.companyStatistics.totalCount]})
+ if(value[0].companyStatistics.buildingTypesCounts.length>0){
+ value[i].companyStatistics.buildingTypesCounts.forEach((build,bi,bvalue) => {
+ if(i==0){
+ this.displayedColumns.push(value[0].companyStatistics.buildingTypesCounts[bi].buildingTypeName||'111')
+ this.tabledataSource[0].name.push(value[0].companyStatistics.buildingTypesCounts[bi].count)
+ }else{
+ this.tabledataSource[i].name.push(bvalue[bi].count)
+ }
+ /* this.tabledataSource.forEach((td,ti,tval)=>{
+ tval[ti].name.push(item.count)
+ }) */
+ });
+
+ }
});
}
-
+ else if(this.preparelevels==1){
+ this.yuanColumns=['组织名称', '总数']
+ this.yuanTable=[{name:[0,0]}]
+ //console.log(this.planCategory,this.reservePlanType)
+ if(this.planCategory.length==0&&this.reservePlanType.length!=0){
+ this.yuanColumns.push('Ⅰ级预案','Ⅱ级预案','Ⅲ级预案','Ⅳ级预案','Ⅴ级预案')
+ this.yuanTable[0].name.push(0,0,0,0,0)
+ this.reservePlanType.forEach(element => {
+ if(element==1){
+ this.yuanColumns.push('二维预案')
+ this.yuanTable[0].name.push(0)
+ }else if(element==2){
+ this.yuanColumns.push('三维预案')
+ this.yuanTable[0].name.push(0)
+ }else if(element==4){
+ this.yuanColumns.push('其他预案')
+ this.yuanTable[0].name.push(0)
+ }else if(element==16){
+ this.yuanColumns.push('文本预案')
+ this.yuanTable[0].name.push(0)
+ }
+ });
+ }else if(this.planCategory.length!=0&&this.reservePlanType.length==0){
+ this.yuanColumns.push('文本预案','二维预案','三维预案','其他预案')
+ this.yuanTable[0].name.push(0,0,0,0)
+ }this.planCategory.forEach(element=>{
+ if(element==1){
+ this.yuanColumns.push('Ⅰ级预案')
+ this.yuanTable[0].name.push(0)
+ }else if(element==2){
+ this.yuanColumns.push('Ⅱ级预案')
+ this.yuanTable[0].name.push(0)
+ }else if(element==3){
+ this.yuanColumns.push('Ⅲ级预案')
+ this.yuanTable[0].name.push(0)
+ }else if(element==4){
+ this.yuanColumns.push('Ⅳ级预案')
+ this.yuanTable[0].name.push(0)
+ }else if(element==5){
+ this.yuanColumns.push('Ⅴ级预案')
+ this.yuanTable[0].name.push(0)
+ }
+ })
+ console.log(this.yuanTable)
+ data.forEach((element,i,value) => {
+ if(i==0){
+ this.yuanTable[0].name[0]=value[0].orgName
+ this.yuanTable[0].name[1]=value[0].planStatistics.totalCount
+ }else{
+ this.yuanTable.push({name:[value[i].orgName,value[i].planStatistics.totalCount]})
+ }
+
+ /* if(value[0].planStatistics.planCategoryStatistics.planCategories.length>0){
+ value[i].planStatistics.planCategoryStatistics.planCategories.forEach((build,bi,bvalue) => {
+ if(i==0){
+ this.yuanColumns.push(value[0].planStatistics.planCategoryStatistics.planCategories[bi].planCategoryName)
+ this.yuanTable[0].name.push(value[0].planStatistics.planCategoryStatistics.planCategories[bi].count)
+ }else{
+ this.yuanTable[i].name.push(bvalue[bi].count)
+ }
+ });
+
+ } */
+ /* if(value[0].planStatistics.planTypeStatistics.length>0){
+ value[i].planStatistics.planTypeStatistics.forEach((build,bi,bvalue) => {
+ if(i==0){
+ this.yuanColumns.push(value[0].planStatistics.planTypeStatistics[bi].planCategoryName)
+ this.yuanTable[0].name.push(value[0].planStatistics.planCategoryStatistics[bi].count)
+ }else{
+ this.yuanTable[i].name.push(bvalue[bi].count)
+ }
+ });
+ } */
+ });
+ this.yuanTable.forEach((element,i,value)=>{
+ if(i>0){
+ for(let a=value[i].name.length;a{
+
+ })
+ }
+ console.log(this.yuanColumns)
+ console.log(this.yuanTable)
}
)
}
@@ -326,7 +439,7 @@ export class CombinedQueryComponent implements OnInit {
jsId: any //所选组织机构的id
jscheck: boolean //所选组织机构勾选框
unittype: any //单位类型
- reservePlanType: any //预案类型
+ reservePlanType=[] //预案类型
preparelevel: any //编制级别
plcheck: boolean //编制级别勾选框
planCategory = []//预案级别
@@ -337,7 +450,7 @@ export class CombinedQueryComponent implements OnInit {
this.jsId = ''
this.jscheck = false
this.unittype = ''
- this.reservePlanType = ''
+ this.reservePlanType = []
this.preparelevel = ''
this.addtime = ''
this.endtime = ''