From bc10e1030781f3b0e0ed76c6caa314f7fabfa50a Mon Sep 17 00:00:00 2001
From: chenjingyu <1148019379@qq.com>
Date: Fri, 5 Nov 2021 09:09:17 +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=A1=E6=8C=89=E9=9C=80=E6=9F=A5=E8=AF=A2=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../combined-query.component.html | 28 +++-
.../combined-query.component.scss | 5 +-
.../combined-query.component.ts | 122 +++++++-----------
3 files changed, 74 insertions(+), 81 deletions(-)
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 b97bed7..be0d92f 100644
--- a/src/app/statistic-analysis/combined-query/combined-query.component.html
+++ b/src/app/statistic-analysis/combined-query/combined-query.component.html
@@ -54,10 +54,10 @@
- 文本预案
二维预案
三维预案
其他预案
+ 文本预案
@@ -72,17 +72,15 @@
-
-
- 新增
- 维护更新
+
+ 新增
+ 维护更新
-
@@ -95,6 +93,24 @@
+
+
+
+
+ 从高到低
+ 从低到高
+
+
+
+
+
+
+
+ 从高到低
+ 从低到高
+
+
+
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 675c92b..70a7520 100644
--- a/src/app/statistic-analysis/combined-query/combined-query.component.scss
+++ b/src/app/statistic-analysis/combined-query/combined-query.component.scss
@@ -90,8 +90,6 @@
.body{
height: 100%;
width: 100%;
- overflow-y: auto;
- overflow-x: auto;
.buttonbox{
padding-left: 50px;
button{
@@ -99,7 +97,8 @@
}
}
.tablebox{
- height: 100%;
+ height: 620px;
+ overflow-y: auto;
//margin-bottom: 15px;
table{
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 6c357a9..a15b602 100644
--- a/src/app/statistic-analysis/combined-query/combined-query.component.ts
+++ b/src/app/statistic-analysis/combined-query/combined-query.component.ts
@@ -10,6 +10,7 @@ import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dial
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { TreeService } from '../../http-interceptors/tree.service'
import { Viewer } from 'photo-sphere-viewer';
+import { timeStamp } from 'console';
@Component({
selector: 'app-combined-query',
@@ -94,6 +95,8 @@ export class CombinedQueryComponent implements OnInit {
//获得所有预案或单位信息
tableDataNull=false
async getAllPlanInfo() {
+ /* this.planCategory=new Array();
+ this.reservePlanType=new Array(); */
let paramsdata:any={
QueryMode:this.preparelevels,
OrganizationId:this.jsId||'',
@@ -101,31 +104,42 @@ export class CombinedQueryComponent implements OnInit {
TimeIntervalStart:this.dwaddtime||'',
TimeIntervalEnd:this.dwendtime||'',
BuildingTypeIds:this.unittype||[],
- CompanyStatus:this.preparelevel||''
+ CompanyStatus:this.preparelevel||[],
+ SortBy:'totalCount',
+ SortType:this.integritySort
}
let yuandata={
QueryMode:this.preparelevels,
- OrganizationId:this.jsId||'',
+ OrganizationId:this.yuanjsId||'',
HasChildren:this.yuanjscheck||'',
TimeIntervalStart:this.yuanaddtime||'',
TimeIntervalEnd:this.yuanendtime||'',
- PlanCategory:this.planCategory||[],
- PlanType:this.reservePlanType||[]
+ PlanCategories:this.planCategory||[],
+ PlanTypes:this.reservePlanType||[],
+ SortBy:'totalCount',
+ SortType:this.yuanintegritySort
}
let result = await new Promise((resolve, reject)=>{
this.http.get("/api/StatisticsAnalysis/ReportTable", { params:this.preparelevels==0? paramsdata:yuandata }).subscribe((data: any) => {
- //console.log(data)
+ console.log(data)
if(data.length==0){
this.tableDataNull=true
}else{
this.tableDataNull=false
if(this.preparelevels==0){
//单位查询
+ if(this.preparelevel.length==0){
+ //必须选择单位状态
+ let config = new MatSnackBarConfig();
+ config.verticalPosition = 'top';
+ config.duration = 3000
+ this.snackBar.open('请选择单位状态', '确定', config);
+ }else{
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){
+ if(value[0].companyStatistics.buildingTypesCounts!=null){
value[i].companyStatistics.buildingTypesCounts.forEach((build,bi,bvalue) => {
if(i==0){
this.displayedColumns.push(value[0].companyStatistics.buildingTypesCounts[bi].buildingTypeName)
@@ -140,52 +154,30 @@ export class CombinedQueryComponent implements OnInit {
}
});
+ }
}
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)
+ if(this.reservePlanType.length!=0){
this.reservePlanType.forEach(element => {
if(element==1){
- this.yuanColumns.push('二维预案')
+ this.yuanColumns.push('二维')
this.yuanTable[0].name.push(0)
}else if(element==2){
- this.yuanColumns.push('三维预案')
+ this.yuanColumns.push('三维')
this.yuanTable[0].name.push(0)
}else if(element==4){
- this.yuanColumns.push('其他预案')
+ this.yuanColumns.push('其他')
this.yuanTable[0].name.push(0)
}else if(element==16){
- this.yuanColumns.push('文本预案')
+ 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)
- }
- })
- }else if(this.planCategory.length!=0&&this.reservePlanType.length!=0){
+ }
+ if(this.planCategory.length!=0){
this.planCategory.forEach(element=>{
if(element==1){
this.yuanColumns.push('Ⅰ级预案')
@@ -204,23 +196,8 @@ export class CombinedQueryComponent implements OnInit {
this.yuanTable[0].name.push(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)
- }
- });
}
- //console.log(this.yuanTable)
+
data.forEach((element,i,value) => {
if(i==0){
this.yuanTable[0].name[0]=value[0].orgName
@@ -240,17 +217,22 @@ export class CombinedQueryComponent implements OnInit {
this.yuanColumns.forEach((th,thi,thvalu)=>{
data.forEach((element,i,value) => {
//预案级别数据
- value[i].planStatistics.planCategoryStatistics.planCategories.forEach((jibie,ji,jval) => {
- if(thvalu[thi].indexOf(jval[ji].planCategoryName)!=-1&&yuani==i){
- yuanval[yuani].name[thi]=jval[ji].count
- }
- });
- //预案类型数据
- value[i].planStatistics.planTypeStatistics.planTypes.forEach((planlx,lxi,lxval) => {
+ if(value[i].planStatistics.planCategoryStatistics!=null){
+ value[i].planStatistics.planCategoryStatistics.planCategories.forEach((jibie,ji,jval) => {
+ if(thvalu[thi].indexOf(jval[ji].planCategoryName)!=-1&&yuani==i){
+ yuanval[yuani].name[thi]=jval[ji].count
+ }
+ });
+ }
+ if(value[i].planStatistics.planTypeStatistics!=null){
+ //预案类型数据
+ value[i].planStatistics.planTypeStatistics.planTypes.forEach((planlx,lxi,lxval) => {
if(thvalu[thi].indexOf(lxval[lxi].planTypeName)!=-1&&yuani==i){
yuanval[yuani].name[thi]=lxval[lxi].count
}
});
+ }
+
});
})
@@ -259,8 +241,8 @@ export class CombinedQueryComponent implements OnInit {
}
//this.tabledataSource=data
- //console.log(this.yuanColumns)
- //console.log(this.yuanTable)
+ console.log(this.yuanColumns)
+ console.log(this.yuanTable)
this.excelData=data
resolve(this.excelData)
}
@@ -482,7 +464,7 @@ export class CombinedQueryComponent implements OnInit {
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
- if(this.dwendtimethis.yuanendtime){
this.snackBar.open('开始时间不能早于结束时间', '确定', config);
}
this.getAllPlanInfo();
@@ -496,9 +478,11 @@ export class CombinedQueryComponent implements OnInit {
yuanjscheck: boolean //预案所选组织机构勾选框
unittype=[] //单位类型
reservePlanType=[] //预案类型
- preparelevel: any //编制级别
+ preparelevel=[1] //单位状态
plcheck: boolean //编制级别勾选框
- planCategory = []//预案级别
+ planCategory=[] //预案级别
+ integritySort=1 //单位排序字段
+ yuanintegritySort=1 //预案排序字段
//重置
reset() {
if(this.preparelevels==0){
@@ -506,8 +490,7 @@ export class CombinedQueryComponent implements OnInit {
this.jsId = ''
this.jscheck = false
this.unittype = []
-
- this.preparelevel = ''
+ this.preparelevel = [0]
this.dwaddtime = ''
this.dwendtime = ''
}else if(this.preparelevels==1){
@@ -523,11 +506,6 @@ export class CombinedQueryComponent implements OnInit {
//重新获取初始化列表
this.getAllPlanInfo();
}
- //导出
- tableToexcel(){
- this.exal()(document.getElementById("table"), "导出表格")
- }
-
exal(){
var uri = 'data:application/vnd.ms-excel;base64,',
@@ -575,7 +553,7 @@ export class CombinedQueryComponent implements OnInit {
const link = document.createElement('a');
const blob = new Blob([data], {type: 'application/vnd.ms-excel'});
link.setAttribute('href', window.URL.createObjectURL(blob));
- link.setAttribute('download', '统计信息'+'.xls');
+ link.setAttribute('download', '报表统计'+'.xls');
link.style.visibility = 'hidden';
document.body.appendChild(link);
link.click();