邵佳豪
2 years ago
19 changed files with 967 additions and 37 deletions
@ -1,25 +0,0 @@
|
||||
"use strict"; |
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
||||
return c > 3 && r && Object.defineProperty(target, key, r), r; |
||||
}; |
||||
exports.__esModule = true; |
||||
exports.StatisticAnalysisComponent = void 0; |
||||
var core_1 = require("@angular/core"); |
||||
var StatisticAnalysisComponent = /** @class */ (function () { |
||||
function StatisticAnalysisComponent() { |
||||
} |
||||
StatisticAnalysisComponent.prototype.ngOnInit = function () { |
||||
}; |
||||
StatisticAnalysisComponent = __decorate([ |
||||
core_1.Component({ |
||||
selector: 'app-statistic-analysis', |
||||
templateUrl: './statistic-analysis.component.html', |
||||
styleUrls: ['./statistic-analysis.component.scss'] |
||||
}) |
||||
], StatisticAnalysisComponent); |
||||
return StatisticAnalysisComponent; |
||||
}()); |
||||
exports.StatisticAnalysisComponent = StatisticAnalysisComponent; |
@ -0,0 +1,70 @@
|
||||
<div class="box"> |
||||
<div class="searchbox"> |
||||
<div class="search"> |
||||
<nz-tree-select [nzExpandedKeys]="expandKeys" [nzNodes]="nodes" nzShowSearch nzPlaceHolder="所属机构" |
||||
[(ngModel)]="searchForm.or" [nzDropdownClassName]="'maxHeightTreeSelect'" [nzAllowClear]="false"> |
||||
</nz-tree-select> |
||||
<nz-range-picker [(ngModel)]="searchForm.date" [nzSize]="'small'"></nz-range-picker> |
||||
<button (click)="search()" nz-button nzType="primary"><i nz-icon nzType="search" |
||||
nzTheme="outline"></i>查询</button> |
||||
<button (click)="reset()" nz-button nzType="default"><i nz-icon nzType="reload" |
||||
nzTheme="outline"></i>重置</button> |
||||
|
||||
</div> |
||||
|
||||
|
||||
<button class="goback" (click)="goback()" nz-button nzType="primary">返回</button> |
||||
</div> |
||||
|
||||
<div class="table"> |
||||
<nz-table #basicTable [nzData]="listOfData" [nzShowPagination]="false" [nzLoading]="isLoading"> |
||||
<thead> |
||||
<tr> |
||||
<th>组织机构名称 <span *ngIf="isSubordinate" (click)="tableBack()" style="margin-left: 3px;" class="blue" |
||||
nz-icon nzType="rollback" nzTheme="outline"></span></th> |
||||
<th>总隐患数</th> |
||||
<th>当场整改总数</th> |
||||
<th>推送大队总数</th> |
||||
<th>大队排除隐患数</th> |
||||
<th>社会单位总数</th> |
||||
<th>隐患复查合格率</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let item of basicTable.data"> |
||||
<td> |
||||
<span (click)="openSubordinate(item['组织机构'])" style="cursor: pointer;"> |
||||
{{item['组织机构'].name}} |
||||
</span> |
||||
</td> |
||||
<td> |
||||
{{item['总隐患数']}} |
||||
</td> |
||||
<td> |
||||
{{item['当场整改数']}} |
||||
</td> |
||||
<td> |
||||
{{item['上报数量']}} |
||||
</td> |
||||
<td> |
||||
{{item['消除隐患数量']}} |
||||
</td> |
||||
<td> |
||||
{{item['单位数量']}} |
||||
</td> |
||||
<td> |
||||
{{item['总隐患数'] == 0 ? '0.0' : ((item['消除隐患数量']/item['总隐患数'])*100).toFixed(1) }}% |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
<div class="echartsbox"> |
||||
<div class="spin spin2" *ngIf="isLoading"> |
||||
<nz-spin nzSimple></nz-spin> |
||||
</div> |
||||
<div id="echarts"> |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
@ -0,0 +1,50 @@
|
||||
.box { |
||||
box-sizing: border-box; |
||||
padding: 16px; |
||||
background-color: #fff; |
||||
} |
||||
|
||||
.searchbox { |
||||
width: 100%; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
margin-bottom: 16px; |
||||
|
||||
.search { |
||||
display: flex; |
||||
|
||||
nz-tree-select { |
||||
text-align: left; |
||||
width: 220px; |
||||
margin-right: 12px; |
||||
} |
||||
|
||||
nz-range-picker { |
||||
width: 300px; |
||||
margin-right: 12px; |
||||
} |
||||
|
||||
button { |
||||
margin-right: 12px; |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
||||
.table { |
||||
margin-bottom: 16px; |
||||
} |
||||
|
||||
.echartsbox { |
||||
width: 100%; |
||||
height: 320px; |
||||
overflow: hidden; |
||||
position: relative; |
||||
|
||||
#echarts { |
||||
overflow-x: auto; |
||||
overflow-y: hidden; |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
} |
@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { ExamineComponent } from './examine.component'; |
||||
|
||||
describe('ExamineComponent', () => { |
||||
let component: ExamineComponent; |
||||
let fixture: ComponentFixture<ExamineComponent>; |
||||
|
||||
beforeEach(async () => { |
||||
await TestBed.configureTestingModule({ |
||||
declarations: [ ExamineComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
}); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(ExamineComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,288 @@
|
||||
import { HttpClient } from '@angular/common/http'; |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { MethodService } from 'src/app/service/method.service'; |
||||
import { TreeService } from 'src/app/service/tree.service'; |
||||
import * as moment from 'moment'; |
||||
import * as echarts from 'echarts'; |
||||
import { Router } from '@angular/router'; |
||||
@Component({ |
||||
selector: 'app-examine', |
||||
templateUrl: './examine.component.html', |
||||
styleUrls: ['./examine.component.scss'] |
||||
}) |
||||
export class ExamineComponent implements OnInit { |
||||
|
||||
constructor(private http: HttpClient, private toTree: TreeService, private methodService: MethodService, private router: Router) { } |
||||
|
||||
|
||||
echartsOfBar |
||||
echartsOfBarOption = { |
||||
grid: { |
||||
left: '2%', |
||||
right: '2%', |
||||
top: '18%', |
||||
bottom: '16%' |
||||
}, |
||||
legend: { |
||||
top: '3%', |
||||
left: 'center', |
||||
itemGap: 15, |
||||
itemWidth: 10, |
||||
itemHeight: 10, |
||||
orient: 'horizontal' |
||||
}, |
||||
tooltip: { |
||||
trigger: 'axis', |
||||
axisPointer: { |
||||
type: 'shadow' |
||||
} |
||||
}, |
||||
xAxis: { |
||||
type: 'category', |
||||
data: [], |
||||
axisTick: { //x轴刻度尺
|
||||
show: false |
||||
}, |
||||
axisLine: {//x轴线条颜色
|
||||
show: false, |
||||
lineStyle: { |
||||
color: '#C7CAD0' |
||||
} |
||||
}, |
||||
axisLabel: { |
||||
show: true, |
||||
interval: 0,//使x轴上的文字显示完全,
|
||||
//设置一行显示几个字,自己设置
|
||||
formatter: function (params) { |
||||
var newParamsName = ""; |
||||
var paramsNameNumber = params.length; |
||||
var provideNumber = 6; |
||||
var rowNumber = Math.ceil(paramsNameNumber / provideNumber); |
||||
if (paramsNameNumber > provideNumber) { |
||||
for (var p = 0; p < rowNumber; p++) { |
||||
var tempStr = ""; |
||||
var start = p * provideNumber; |
||||
var end = start + provideNumber; |
||||
if (p == rowNumber - 1) { |
||||
tempStr = params.substring(start, paramsNameNumber); |
||||
} else { |
||||
tempStr = params.substring(start, end) + "\n"; |
||||
} |
||||
newParamsName += tempStr; |
||||
} |
||||
} else { |
||||
newParamsName = params; |
||||
} |
||||
return newParamsName; |
||||
} |
||||
} |
||||
}, |
||||
yAxis: { |
||||
type: 'value', |
||||
splitLine: {//网格线
|
||||
lineStyle: { |
||||
type: 'solid', //设置网格线类型 dotted:虚线 solid:实线
|
||||
color: '#ECEFF1' //网格线颜色
|
||||
}, |
||||
}, |
||||
axisLine: {//y轴线条颜色
|
||||
show: false, |
||||
lineStyle: { |
||||
color: '#C7CAD0' |
||||
} |
||||
}, |
||||
}, |
||||
series: [ |
||||
{ |
||||
name: '隐患数', |
||||
type: 'bar', |
||||
barWidth: 16, // 柱子宽度
|
||||
label: { |
||||
show: false |
||||
}, |
||||
emphasis: { |
||||
focus: 'series' |
||||
}, |
||||
data: [] |
||||
}, |
||||
{ |
||||
name: '当场整改', |
||||
type: 'bar', |
||||
barWidth: 16, // 柱子宽度
|
||||
label: { |
||||
show: false |
||||
}, |
||||
emphasis: { |
||||
focus: 'series' |
||||
}, |
||||
data: [] |
||||
}, |
||||
{ |
||||
name: '推送大队', |
||||
type: 'bar', |
||||
barWidth: 16, // 柱子宽度
|
||||
label: { |
||||
show: false |
||||
}, |
||||
emphasis: { |
||||
focus: 'series' |
||||
}, |
||||
data: [] |
||||
}, |
||||
{ |
||||
name: '社会单位数量', |
||||
type: 'bar', |
||||
barWidth: 16, // 柱子宽度
|
||||
label: { |
||||
show: false |
||||
}, |
||||
emphasis: { |
||||
focus: 'series' |
||||
}, |
||||
data: [] |
||||
} |
||||
] |
||||
}; |
||||
|
||||
|
||||
|
||||
searchForm = { |
||||
or: '', |
||||
date: null |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.searchForm.date = this.methodService.getDateOf30() |
||||
this.getAllOrganization() |
||||
|
||||
setTimeout(() => { |
||||
this.echartsOfBar = echarts.init(document.getElementById('echarts'), null, { devicePixelRatio: 2 }); |
||||
}, 0); |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
isLoading = false |
||||
expandKeys |
||||
defaultOrId: string |
||||
//获取所有组织机构
|
||||
nodes: any = [] |
||||
getAllOrganization() { |
||||
this.isLoading = true |
||||
let organizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId |
||||
let params = { |
||||
ContainsChildren: "true", |
||||
PageNumber: 1, |
||||
PageSize: 9999, |
||||
code: '0000' |
||||
} |
||||
this.http.get('/api/Organizations', { |
||||
params: params |
||||
}).subscribe((data: any) => { |
||||
console.log(data.items) |
||||
data.items.forEach(element => { |
||||
if (element.id == organizationId) { |
||||
element.parentId = null |
||||
} |
||||
element.key = element.id |
||||
element.title = element.name |
||||
if (element.level == 'squadron') { |
||||
element.isLeaf = true |
||||
} |
||||
}); |
||||
this.nodes = [...this.toTree.toTree(data.items)] |
||||
this.searchForm.or = JSON.parse(sessionStorage.getItem('userData')).organizationId |
||||
|
||||
|
||||
this.getRecord() |
||||
}) |
||||
} |
||||
|
||||
search() { |
||||
this.getRecord() |
||||
} |
||||
reset() { |
||||
this.searchForm = { |
||||
date: this.methodService.getDateOf30(), |
||||
or: JSON.parse(sessionStorage.getItem('userData')).organizationId |
||||
} |
||||
this.getRecord() |
||||
} |
||||
|
||||
listOfData = []; |
||||
|
||||
getRecord() { |
||||
this.isLoading = true |
||||
this.http.get('/api/PlanTasks/GetOrgRecheckStat', { |
||||
params: { |
||||
OrganizationId: this.searchForm.or, |
||||
CheckStartTime: moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00', |
||||
CheckEndTime: moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59' |
||||
} |
||||
}).subscribe({ |
||||
next: (data: any) => { |
||||
this.listOfData = [...data] |
||||
console.log('统计表格', data) |
||||
this.isLoading = false |
||||
setTimeout(() => { |
||||
this.echartsSetData(this.listOfData) |
||||
}, 0); |
||||
|
||||
}, |
||||
error: (err) => { |
||||
|
||||
} |
||||
}) |
||||
} |
||||
|
||||
|
||||
echartsSetData(data) { |
||||
this.echartsOfBar.clear(); |
||||
|
||||
let barData = data |
||||
let Barx = [] |
||||
let Bary1 = [] |
||||
let Bary2 = [] |
||||
let Bary3 = [] |
||||
let Bary4 = [] |
||||
barData.forEach(element => { |
||||
Barx.push(element['组织机构'].name) |
||||
Bary1.push(element['总隐患数'])//已完成
|
||||
Bary2.push(element['当场整改数'])//未完成
|
||||
Bary3.push(element['上报数量'])//已完成
|
||||
Bary4.push(element['单位数量'])//未完成
|
||||
}); |
||||
this.echartsOfBarOption.xAxis.data = Barx |
||||
this.echartsOfBarOption.series[0].data = Bary1 |
||||
this.echartsOfBarOption.series[1].data = Bary2 |
||||
this.echartsOfBarOption.series[2].data = Bary3 |
||||
this.echartsOfBarOption.series[3].data = Bary4 |
||||
|
||||
|
||||
setTimeout(() => { |
||||
this.echartsOfBar && this.echartsOfBar.setOption(this.echartsOfBarOption); |
||||
}, 0); |
||||
|
||||
|
||||
} |
||||
|
||||
|
||||
isSubordinate = false |
||||
openSubordinate(item) { |
||||
if (item.id != this.searchForm.or && item.level === 'battalion') { |
||||
this.isSubordinate = true |
||||
this.searchForm.or = item.id |
||||
this.getRecord() |
||||
} |
||||
} |
||||
tableBack() { |
||||
this.isSubordinate = false |
||||
this.searchForm.or = JSON.parse(sessionStorage.getItem('userData')).organizationId |
||||
this.getRecord() |
||||
} |
||||
|
||||
goback() { |
||||
this.router.navigate(['/statistic/home']) |
||||
} |
||||
} |
@ -0,0 +1,22 @@
|
||||
<nz-layout> |
||||
<nz-sider nzCollapsible [(nzCollapsed)]="isCollapsed" [nzTrigger]="null" nzTheme="light"> |
||||
|
||||
|
||||
|
||||
<ul nz-menu nzMode="inline"> |
||||
<li nz-menu-item nzMatchRouter [routerLink]="['/statistic/form/examine']"> |
||||
<span nz-icon nzType="file"></span> |
||||
<span>检查情况统计</span> |
||||
</li> |
||||
<li nz-menu-item nzMatchRouter [routerLink]="['/statistic/form/review']"> |
||||
<span nz-icon nzType="file"></span> |
||||
<span>复查情况统计</span> |
||||
</li> |
||||
</ul> |
||||
</nz-sider> |
||||
<nz-layout> |
||||
<nz-content> |
||||
<router-outlet></router-outlet> |
||||
</nz-content> |
||||
</nz-layout> |
||||
</nz-layout> |
@ -0,0 +1,12 @@
|
||||
nz-layout{ |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
nz-content{ |
||||
box-sizing: border-box; |
||||
padding: 16px; |
||||
} |
||||
.goback{ |
||||
margin-top: 15px; |
||||
margin-bottom: 12px; |
||||
} |
@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { FormComponent } from './form.component'; |
||||
|
||||
describe('FormComponent', () => { |
||||
let component: FormComponent; |
||||
let fixture: ComponentFixture<FormComponent>; |
||||
|
||||
beforeEach(async () => { |
||||
await TestBed.configureTestingModule({ |
||||
declarations: [ FormComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
}); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(FormComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,16 @@
|
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { Router } from '@angular/router'; |
||||
|
||||
@Component({ |
||||
selector: 'app-form', |
||||
templateUrl: './form.component.html', |
||||
styleUrls: ['./form.component.scss'] |
||||
}) |
||||
export class FormComponent implements OnInit { |
||||
isCollapsed = false; |
||||
constructor(private router: Router) { } |
||||
|
||||
ngOnInit(): void { |
||||
} |
||||
|
||||
} |
@ -0,0 +1,62 @@
|
||||
<div class="box"> |
||||
<div class="searchbox"> |
||||
<div class="search"> |
||||
<nz-tree-select [nzExpandedKeys]="expandKeys" [nzNodes]="nodes" nzShowSearch nzPlaceHolder="所属机构" |
||||
[(ngModel)]="searchForm.or" [nzDropdownClassName]="'maxHeightTreeSelect'" [nzAllowClear]="false"> |
||||
</nz-tree-select> |
||||
<nz-range-picker [(ngModel)]="searchForm.date" [nzSize]="'small'"></nz-range-picker> |
||||
<button (click)="search()" nz-button nzType="primary"><i nz-icon nzType="search" |
||||
nzTheme="outline"></i>查询</button> |
||||
<button (click)="reset()" nz-button nzType="default"><i nz-icon nzType="reload" |
||||
nzTheme="outline"></i>重置</button> |
||||
|
||||
</div> |
||||
|
||||
|
||||
<button class="goback" (click)="goback()" nz-button nzType="primary">返回</button> |
||||
</div> |
||||
|
||||
<div class="table"> |
||||
<nz-table #basicTable [nzData]="listOfData" [nzShowPagination]="false" [nzLoading]="isLoading"> |
||||
<thead> |
||||
<tr> |
||||
<th>组织机构名称 <span *ngIf="isSubordinate" (click)="tableBack()" style="margin-left: 3px;" class="blue" |
||||
nz-icon nzType="rollback" nzTheme="outline"></span></th> |
||||
<th>完成任务总数</th> |
||||
<th>大队需复查总数</th> |
||||
<th>大队已复查总数</th> |
||||
<th>任务复查合格率</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let item of basicTable.data"> |
||||
<td> |
||||
<span (click)="openSubordinate(item['组织机构'])" style="cursor: pointer;"> |
||||
{{item['组织机构'].name}} |
||||
</span> |
||||
</td> |
||||
<td> |
||||
{{item['完成数']}} |
||||
</td> |
||||
<td> |
||||
{{item['需要复查数']}} |
||||
</td> |
||||
<td> |
||||
{{item['复查通过数']}} |
||||
</td> |
||||
<td> |
||||
{{item['需要复查数'] == 0 ? '0.0' : ((item['复查通过数']/item['需要复查数'])*100).toFixed(1) }}% |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
<div class="echartsbox"> |
||||
<div class="spin spin2" *ngIf="isLoading"> |
||||
<nz-spin nzSimple></nz-spin> |
||||
</div> |
||||
<div id="echarts"> |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
@ -0,0 +1,50 @@
|
||||
.box { |
||||
box-sizing: border-box; |
||||
padding: 16px; |
||||
background-color: #fff; |
||||
} |
||||
|
||||
.searchbox { |
||||
width: 100%; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
margin-bottom: 16px; |
||||
|
||||
.search { |
||||
display: flex; |
||||
|
||||
nz-tree-select { |
||||
text-align: left; |
||||
width: 220px; |
||||
margin-right: 12px; |
||||
} |
||||
|
||||
nz-range-picker { |
||||
width: 300px; |
||||
margin-right: 12px; |
||||
} |
||||
|
||||
button { |
||||
margin-right: 12px; |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
||||
.table { |
||||
margin-bottom: 16px; |
||||
} |
||||
|
||||
.echartsbox { |
||||
width: 100%; |
||||
height: 320px; |
||||
overflow: hidden; |
||||
position: relative; |
||||
|
||||
#echarts { |
||||
overflow-x: auto; |
||||
overflow-y: hidden; |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
} |
@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { ReviewComponent } from './review.component'; |
||||
|
||||
describe('ReviewComponent', () => { |
||||
let component: ReviewComponent; |
||||
let fixture: ComponentFixture<ReviewComponent>; |
||||
|
||||
beforeEach(async () => { |
||||
await TestBed.configureTestingModule({ |
||||
declarations: [ ReviewComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
}); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(ReviewComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,260 @@
|
||||
import { HttpClient } from '@angular/common/http'; |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import { MethodService } from 'src/app/service/method.service'; |
||||
import { TreeService } from 'src/app/service/tree.service'; |
||||
import * as moment from 'moment'; |
||||
import * as echarts from 'echarts'; |
||||
import { Router } from '@angular/router'; |
||||
@Component({ |
||||
selector: 'app-review', |
||||
templateUrl: './review.component.html', |
||||
styleUrls: ['./review.component.scss'] |
||||
}) |
||||
export class ReviewComponent implements OnInit { |
||||
|
||||
|
||||
constructor(private http: HttpClient, private toTree: TreeService, private methodService: MethodService, private router: Router) { } |
||||
|
||||
|
||||
echartsOfBar |
||||
echartsOfBarOption = { |
||||
grid: { |
||||
left: '2%', |
||||
right: '2%', |
||||
top: '18%', |
||||
bottom: '16%' |
||||
}, |
||||
legend: { |
||||
top: '3%', |
||||
left: 'center', |
||||
itemGap: 15, |
||||
itemWidth: 10, |
||||
itemHeight: 10, |
||||
orient: 'horizontal' |
||||
}, |
||||
tooltip: { |
||||
trigger: 'axis', |
||||
axisPointer: { |
||||
type: 'shadow' |
||||
} |
||||
}, |
||||
xAxis: { |
||||
type: 'category', |
||||
data: [], |
||||
axisTick: { //x轴刻度尺
|
||||
show: false |
||||
}, |
||||
axisLine: {//x轴线条颜色
|
||||
show: false, |
||||
lineStyle: { |
||||
color: '#C7CAD0' |
||||
} |
||||
}, |
||||
axisLabel: { |
||||
show: true, |
||||
interval: 0,//使x轴上的文字显示完全,
|
||||
//设置一行显示几个字,自己设置
|
||||
formatter: function (params) { |
||||
var newParamsName = ""; |
||||
var paramsNameNumber = params.length; |
||||
var provideNumber = 6; |
||||
var rowNumber = Math.ceil(paramsNameNumber / provideNumber); |
||||
if (paramsNameNumber > provideNumber) { |
||||
for (var p = 0; p < rowNumber; p++) { |
||||
var tempStr = ""; |
||||
var start = p * provideNumber; |
||||
var end = start + provideNumber; |
||||
if (p == rowNumber - 1) { |
||||
tempStr = params.substring(start, paramsNameNumber); |
||||
} else { |
||||
tempStr = params.substring(start, end) + "\n"; |
||||
} |
||||
newParamsName += tempStr; |
||||
} |
||||
} else { |
||||
newParamsName = params; |
||||
} |
||||
return newParamsName; |
||||
} |
||||
} |
||||
}, |
||||
yAxis: { |
||||
type: 'value', |
||||
splitLine: {//网格线
|
||||
lineStyle: { |
||||
type: 'solid', //设置网格线类型 dotted:虚线 solid:实线
|
||||
color: '#ECEFF1' //网格线颜色
|
||||
}, |
||||
}, |
||||
axisLine: {//y轴线条颜色
|
||||
show: false, |
||||
lineStyle: { |
||||
color: '#C7CAD0' |
||||
} |
||||
}, |
||||
}, |
||||
series: [ |
||||
{ |
||||
name: '需复查隐患', |
||||
type: 'bar', |
||||
barWidth: 16, // 柱子宽度
|
||||
label: { |
||||
show: false |
||||
}, |
||||
emphasis: { |
||||
focus: 'series' |
||||
}, |
||||
data: [] |
||||
}, |
||||
{ |
||||
name: '已复查隐患', |
||||
type: 'bar', |
||||
barWidth: 16, // 柱子宽度
|
||||
label: { |
||||
show: false |
||||
}, |
||||
emphasis: { |
||||
focus: 'series' |
||||
}, |
||||
data: [] |
||||
} |
||||
] |
||||
}; |
||||
|
||||
|
||||
|
||||
searchForm = { |
||||
or: '', |
||||
date: null |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.searchForm.date = this.methodService.getDateOf30() |
||||
this.getAllOrganization() |
||||
|
||||
setTimeout(() => { |
||||
this.echartsOfBar = echarts.init(document.getElementById('echarts'), null, { devicePixelRatio: 2 }); |
||||
}, 0); |
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
isLoading = false |
||||
expandKeys |
||||
defaultOrId: string |
||||
//获取所有组织机构
|
||||
nodes: any = [] |
||||
getAllOrganization() { |
||||
this.isLoading = true |
||||
let organizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId |
||||
let params = { |
||||
ContainsChildren: "true", |
||||
PageNumber: 1, |
||||
PageSize: 9999, |
||||
code: '0000' |
||||
} |
||||
this.http.get('/api/Organizations', { |
||||
params: params |
||||
}).subscribe((data: any) => { |
||||
console.log(data.items) |
||||
data.items.forEach(element => { |
||||
if (element.id == organizationId) { |
||||
element.parentId = null |
||||
} |
||||
element.key = element.id |
||||
element.title = element.name |
||||
if (element.level == 'squadron') { |
||||
element.isLeaf = true |
||||
} |
||||
}); |
||||
this.nodes = [...this.toTree.toTree(data.items)] |
||||
this.searchForm.or = JSON.parse(sessionStorage.getItem('userData')).organizationId |
||||
|
||||
|
||||
this.getRecord() |
||||
}) |
||||
} |
||||
|
||||
search() { |
||||
this.getRecord() |
||||
} |
||||
reset() { |
||||
this.searchForm = { |
||||
date: this.methodService.getDateOf30(), |
||||
or: JSON.parse(sessionStorage.getItem('userData')).organizationId |
||||
} |
||||
this.getRecord() |
||||
} |
||||
|
||||
listOfData = []; |
||||
|
||||
getRecord() { |
||||
this.isLoading = true |
||||
this.http.get('/api/PlanTasks/GetOrgRecheckStat', { |
||||
params: { |
||||
OrganizationId: this.searchForm.or, |
||||
CheckStartTime: moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00', |
||||
CheckEndTime: moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59' |
||||
} |
||||
}).subscribe({ |
||||
next: (data: any) => { |
||||
this.listOfData = [...data] |
||||
console.log('统计表格', data) |
||||
this.isLoading = false |
||||
setTimeout(() => { |
||||
this.echartsSetData(this.listOfData) |
||||
}, 0); |
||||
|
||||
}, |
||||
error: (err) => { |
||||
|
||||
} |
||||
}) |
||||
} |
||||
|
||||
|
||||
echartsSetData(data) { |
||||
this.echartsOfBar.clear(); |
||||
|
||||
let barData = data |
||||
let Barx = [] |
||||
let Bary1 = [] |
||||
let Bary2 = [] |
||||
barData.forEach(element => { |
||||
Barx.push(element['组织机构'].name) |
||||
Bary1.push(element['需要复查数'])//已完成
|
||||
Bary2.push(element['复查通过数'])//未完成
|
||||
}); |
||||
this.echartsOfBarOption.xAxis.data = Barx |
||||
this.echartsOfBarOption.series[0].data = Bary1 |
||||
this.echartsOfBarOption.series[1].data = Bary2 |
||||
|
||||
|
||||
setTimeout(() => { |
||||
this.echartsOfBar && this.echartsOfBar.setOption(this.echartsOfBarOption); |
||||
}, 0); |
||||
|
||||
|
||||
} |
||||
|
||||
|
||||
isSubordinate = false |
||||
openSubordinate(item) { |
||||
if (item.id != this.searchForm.or && item.level === 'battalion') { |
||||
this.isSubordinate = true |
||||
this.searchForm.or = item.id |
||||
this.getRecord() |
||||
} |
||||
} |
||||
tableBack() { |
||||
this.isSubordinate = false |
||||
this.searchForm.or = JSON.parse(sessionStorage.getItem('userData')).organizationId |
||||
this.getRecord() |
||||
} |
||||
|
||||
goback() { |
||||
this.router.navigate(['/statistic/home']) |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue