Browse Source

[新增]统计报表

非煤矿山灾害智能感知和预警系统
邵佳豪 2 years ago
parent
commit
e87b6697ba
  1. 20
      src/app/home/home-routing.module.ts
  2. 8
      src/app/home/home.module.ts
  3. 25
      src/app/home/statistic-analysis/dist/statistic-analysis.component.js
  4. 70
      src/app/home/statistic-analysis/form/examine/examine.component.html
  5. 50
      src/app/home/statistic-analysis/form/examine/examine.component.scss
  6. 25
      src/app/home/statistic-analysis/form/examine/examine.component.spec.ts
  7. 288
      src/app/home/statistic-analysis/form/examine/examine.component.ts
  8. 22
      src/app/home/statistic-analysis/form/form.component.html
  9. 12
      src/app/home/statistic-analysis/form/form.component.scss
  10. 25
      src/app/home/statistic-analysis/form/form.component.spec.ts
  11. 16
      src/app/home/statistic-analysis/form/form.component.ts
  12. 62
      src/app/home/statistic-analysis/form/review/review.component.html
  13. 50
      src/app/home/statistic-analysis/form/review/review.component.scss
  14. 25
      src/app/home/statistic-analysis/form/review/review.component.spec.ts
  15. 260
      src/app/home/statistic-analysis/form/review/review.component.ts
  16. 2
      src/app/home/statistic-analysis/home/home.component.html
  17. 8
      src/app/home/statistic-analysis/home/home.component.ts
  18. 20
      src/app/service/method.service.ts
  19. 12
      src/styles.scss

20
src/app/home/home-routing.module.ts

@ -3,6 +3,9 @@ import { RouterModule, Routes } from '@angular/router';
import { BasicInfoComponent } from './basic-info/basic-info.component';
import { UnitDetailsComponent } from './basic-info/unit-details/unit-details.component';
import { UnitComponent } from './basic-info/unit/unit.component';
import { ExamineComponent } from './statistic-analysis/form/examine/examine.component';
import { FormComponent } from './statistic-analysis/form/form.component';
import { ReviewComponent } from './statistic-analysis/form/review/review.component';
import { HomeComponent } from './statistic-analysis/home/home.component';
import { StatisticAnalysisComponent } from './statistic-analysis/statistic-analysis.component';
import { OrComponent } from './system-management/or/or.component';
@ -87,7 +90,22 @@ const routes: Routes = [
{
path: 'taskdetails',
component: TaskDetailsPagesComponent,
}
},
{
path: 'form',
component: FormComponent,
children: [
{ path: '', redirectTo: 'examine', pathMatch: 'full' },
{
path: 'examine',
component: ExamineComponent,
},
{
path: 'review',
component: ReviewComponent,
}
],
},
],
},
{

8
src/app/home/home.module.ts

@ -78,6 +78,9 @@ import { TaskDetailsPagesComponent } from './task/station-task-execution/task-de
import { NzTabsModule } from 'ng-zorro-antd/tabs';
import { CheckagainComponent } from './task/da-oneself-plan/checkagain/checkagain.component';
import { TaskListComponent } from './statistic-analysis/home/task-list/task-list.component';
import { FormComponent } from './statistic-analysis/form/form.component';
import { ExamineComponent } from './statistic-analysis/form/examine/examine.component';
import { ReviewComponent } from './statistic-analysis/form/review/review.component';
@NgModule({
declarations: [
NavComponent,
@ -124,7 +127,10 @@ import { TaskListComponent } from './statistic-analysis/home/task-list/task-list
chineseNumbers,
CheckagainComponent,
absoluteValue,
TaskListComponent
TaskListComponent,
FormComponent,
ExamineComponent,
ReviewComponent
],
imports: [
CommonModule,

25
src/app/home/statistic-analysis/dist/statistic-analysis.component.js vendored

@ -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;

70
src/app/home/statistic-analysis/form/examine/examine.component.html

@ -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>

50
src/app/home/statistic-analysis/form/examine/examine.component.scss

@ -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%;
}
}

25
src/app/home/statistic-analysis/form/examine/examine.component.spec.ts

@ -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();
});
});

288
src/app/home/statistic-analysis/form/examine/examine.component.ts

@ -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'])
}
}

22
src/app/home/statistic-analysis/form/form.component.html

@ -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>

12
src/app/home/statistic-analysis/form/form.component.scss

@ -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;
}

25
src/app/home/statistic-analysis/form/form.component.spec.ts

@ -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();
});
});

16
src/app/home/statistic-analysis/form/form.component.ts

@ -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 {
}
}

62
src/app/home/statistic-analysis/form/review/review.component.html

@ -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>

50
src/app/home/statistic-analysis/form/review/review.component.scss

@ -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%;
}
}

25
src/app/home/statistic-analysis/form/review/review.component.spec.ts

@ -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();
});
});

260
src/app/home/statistic-analysis/form/review/review.component.ts

@ -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'])
}
}

2
src/app/home/statistic-analysis/home/home.component.html

@ -9,6 +9,8 @@
<div class="top1-1item flexcolumn">
<div class="title">
任务总数&nbsp;&nbsp;&nbsp;{{top1_1_leftNum}}个
<i (click)="formroute()" style="margin-left: 6px;cursor: pointer;" nz-icon nzType="bar-chart"
nzTheme="outline"></i>
</div>
<div class="taskNum" id="taskNumCharts">

8
src/app/home/statistic-analysis/home/home.component.ts

@ -1,5 +1,6 @@
import { HttpClient } from '@angular/common/http';
import { Component, OnInit, ViewContainerRef } from '@angular/core';
import { Router } from '@angular/router';
declare var AMap: any;
declare var AMapUI: any;
import * as echarts from 'echarts';
@ -12,7 +13,7 @@ import { TaskListComponent } from './task-list/task-list.component';
})
export class HomeComponent implements OnInit {
constructor(private http: HttpClient, private modal: NzModalService, private viewContainerRef: ViewContainerRef) { }
constructor(private http: HttpClient, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private router: Router) { }
taskNumCharts
taskNumChartsOption = {
title: [
@ -676,4 +677,9 @@ export class HomeComponent implements OnInit {
}
formroute() {
this.router.navigate(['/statistic/form'])
}
}

20
src/app/service/method.service.ts

@ -205,4 +205,24 @@ export class MethodService {
// console.log('完整度', integrity)
return integrity
}
getDateOf30() {
//当前日期
let myDate: any = new Date();
let nowY = myDate.getFullYear();
let nowM = myDate.getMonth() + 1;
let nowD = myDate.getDate();
//获取三十天前日期
let lw = new Date(myDate - 1000 * 60 * 60 * 24 * 29);//最后一个数字30可改,30天的意思
let lastY = lw.getFullYear();
let lastM = lw.getMonth() + 1;
let lastD = lw.getDate();
let startdate = lastY + "-" + (lastM < 10 ? "0" + lastM : lastM) + "-" + (lastD < 10 ? "0" + lastD : lastD);
let enddate = nowY + "-" + (nowM < 10 ? "0" + nowM : nowM) + "-" + (nowD < 10 ? "0" + nowD : nowD)
return [startdate, enddate]
}
}

12
src/styles.scss

@ -102,11 +102,7 @@ textarea {
}
::-webkit-scrollbar {
width: 5px;
}
::-webkit-scrollbar-track {
// background-color: #999;
width: 5px !important;
}
app-root {
@ -128,7 +124,7 @@ app-root {
color: #FF0000 !important;
}
.orange{
.orange {
color: orange !important;
}
@ -229,7 +225,9 @@ app-root {
left: 0;
top: 0;
}
.spin2{
background: rgba(230, 225, 225, 0.1);
}
#setPosition {
.custom-content-marker {
position: relative;

Loading…
Cancel
Save