Browse Source

[完善]统计分析真数据

非煤矿山灾害智能感知和预警系统
邵佳豪 2 years ago
parent
commit
1d8234ff4c
  1. 20
      src/app/home/statistic-analysis/home/home.component.html
  2. 124
      src/app/home/statistic-analysis/home/home.component.ts

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

@ -8,7 +8,7 @@
<div class="top1-1item flexcolumn">
<div class="title">
任务总数&nbsp;&nbsp;&nbsp;188
任务总数&nbsp;&nbsp;&nbsp;{{top1_1_leftNum}}
</div>
<div class="taskNum" id="taskNumCharts">
@ -41,15 +41,15 @@
<div class="searchbox">
<div class="searchitem1">
<div class="titleblue">
27%
{{buhegedata.percentOfPass}}%
</div>
<span>9月合格率</span>
<span>{{buhegedata.month}}月合格率</span>
</div>
<div class="searchitem1">
<div class="titlered">
121
{{buhegedata.badCount}}
</div>
<span>9月不合格数量</span>
<span>{{buhegedata.month}}月不合格数量</span>
</div>
<!-- <div class="rangepicker">
<nz-range-picker></nz-range-picker>
@ -112,7 +112,7 @@
</div>
<div class="num">
<span>{{item.num}}%</span>
<ng-container *ngIf="item.type == 'up'; else elseTemplate">
<!-- <ng-container *ngIf="item.type == 'up'; else elseTemplate">
<img src="../../../../assets/statistic-analysis/up.png" alt="">
</ng-container>
<ng-template #elseTemplate>
@ -121,7 +121,7 @@
<span class="numchange"
[ngClass]="{'numchangered': item.type == 'down','invariant': item.type == 'invariant','numchangegreen': item.type == 'up'}">
{{item.changeNum}}
</span>
</span> -->
</div>
</div>
</div>
@ -142,11 +142,11 @@
</div>
<div class="progress">
<nz-progress [nzStrokeColor]="'#2C4DC0'" [nzStrokeLinecap]="'square'"
[nzShowInfo]="false" [nzPercent]="item.num"></nz-progress>
[nzShowInfo]="false" [nzPercent]="item.percentage"></nz-progress>
</div>
<div class="num">
<span>{{item.num}}</span>
<ng-container *ngIf="item.type == 'up'; else elseTemplate">
<!-- <ng-container *ngIf="item.type == 'up'; else elseTemplate">
<img src="../../../../assets/statistic-analysis/up.png" alt="">
</ng-container>
<ng-template #elseTemplate>
@ -155,7 +155,7 @@
<span class="numchange"
[ngClass]="{'numchangered': item.type == 'down','invariant': item.type == 'invariant','numchangegreen': item.type == 'up'}">
{{item.changeNum}}
</span>
</span> -->
</div>
</div>
</div>

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

@ -62,7 +62,6 @@ export class HomeComponent implements OnInit {
//name是名称,v是数值
},
},
series: [
{
@ -339,7 +338,7 @@ export class HomeComponent implements OnInit {
this.echartsSetData()
}
assistTaskRankingData = [
assistTaskRankingData: any = [
{ name: '济南市消防救援支队', num: 28, url: "../../../../assets/statistic-analysis/one.png" },
{ name: '历下区大队', num: 25, url: "../../../../assets/statistic-analysis/two.png" },
{ name: '南部山区大队', num: 18, url: "../../../../assets/statistic-analysis/three.png" },
@ -358,22 +357,22 @@ export class HomeComponent implements OnInit {
rankingList2 = [
{ name: '历下区大队', num: 100, type: "up", changeNum: 2 },
{ name: '高新技术产业开发区大队', num: 90, type: "down", changeNum: 1 },
{ name: '槐荫区大队', num: 88, type: "down", changeNum: 1 },
{ name: '天桥区大队', num: 80, type: "up", changeNum: 2 },
{ name: '历城区大队', num: 70, type: "up", changeNum: 1 },
{ name: '长清区大队', num: 53, type: "up", changeNum: 2 },
{ name: '南部山区大队', num: 80, type: "up", changeNum: 1 },
{ name: '章丘区大队', num: 70, type: "up", changeNum: 1 },
{ name: '平阴县大队', num: 53, type: "down", changeNum: 1 },
{ name: '济阳区大队', num: 80, type: "up", changeNum: 1 },
{ name: '市中区大队', num: 70, type: "down", changeNum: 2 },
{ name: '商河县大队', num: 53, type: "down", changeNum: 3 },
{ name: '莱芜区大队', num: 80, type: "down", changeNum: 1 },
{ name: '钢城区大队', num: 70, type: "up", changeNum: 3 },
{ name: '起步区大队', num: 50, type: "down", changeNum: 2 },
{ name: '特勤大队', num: 50, type: "up", changeNum: 2 },
{ name: '历下区大队', num: 100, percentage: 100, type: "up", changeNum: 2 },
{ name: '高新技术产业开发区大队', num: 90, percentage: 100, type: "down", changeNum: 1 },
{ name: '槐荫区大队', num: 88, percentage: 100, type: "down", changeNum: 1 },
{ name: '天桥区大队', num: 80, percentage: 100, type: "up", changeNum: 2 },
{ name: '历城区大队', num: 70, percentage: 100, type: "up", changeNum: 1 },
{ name: '长清区大队', num: 53, percentage: 100, type: "up", changeNum: 2 },
{ name: '南部山区大队', num: 80, percentage: 100, type: "up", changeNum: 1 },
{ name: '章丘区大队', num: 70, percentage: 100, type: "up", changeNum: 1 },
{ name: '平阴县大队', num: 53, percentage: 100, type: "down", changeNum: 1 },
{ name: '济阳区大队', num: 80, percentage: 100, type: "up", changeNum: 1 },
{ name: '市中区大队', num: 70, percentage: 100, type: "down", changeNum: 2 },
{ name: '商河县大队', num: 53, percentage: 100, type: "down", changeNum: 3 },
{ name: '莱芜区大队', num: 80, percentage: 100, type: "down", changeNum: 1 },
{ name: '钢城区大队', num: 70, percentage: 100, type: "up", changeNum: 3 },
{ name: '起步区大队', num: 50, percentage: 100, type: "down", changeNum: 2 },
{ name: '特勤大队', num: 50, percentage: 100, type: "up", changeNum: 2 },
]
mapcard = [
@ -399,21 +398,102 @@ export class HomeComponent implements OnInit {
}
top1_1_leftNum = 188 //任务总数
buhegedata = {
badCount: 0,
date: "2022-06-01T00:00:00",
month: 6,
totalCount: 0,
percentOfPass: 0
}
echartsSetData() {
console.log('统计数据', this.statisticalData)
//左上角 任务总数 + 协助任务数量排名TOP5
let top1_1_left = this.statisticalData['任务']
this.top1_1_leftNum = top1_1_left['上级派发任务'] + top1_1_left['申领任务'] + top1_1_left['自主任务']
this.taskNumChartsOption.title[0].text = `{val|${this.top1_1_leftNum}}\n{name|任务总数}`
this.taskNumChartsOption.series[0].data = [
{ value: top1_1_left['上级派发任务'], name: '上级派发任务' },
{ value: top1_1_left['自主任务'], name: '自主任务' },
{ value: top1_1_left['申领任务'], name: '协助任务' }
]
this.taskNumCharts && this.taskNumCharts.setOption(this.taskNumChartsOption);
let top1_1_right = this.statisticalData['协助任务Top5']
let top1_2 = this.statisticalData['任务']
this.assistTaskRankingData.forEach((element, key) => {
if (top1_1_right[key]) {
element.name = top1_1_right[key].organization.name
element.num = top1_1_right[key].totalCount
} else {
element.name = '暂无机构'
element.num = 0
}
});
this.taskNumCharts && this.taskNumCharts.setOption(this.taskNumChartsOption);
//左边中间不合格单位趋势图
let center_left = this.statisticalData['不合格单位趋势']
let xAxis = []
let yAxis = []
center_left.forEach(element => {
let monthnum = new Date(element.date).getMonth() + 1
if (monthnum == new Date().getMonth() + 1) {
element.percentOfPass = Math.round(((element.totalCount - element.badCount) / element.totalCount) * 100)
this.buhegedata = element
}
element.month = monthnum
xAxis.push(monthnum + '月')
yAxis.push(element.badCount)
});
this.disqualificationUnitChartsOption.xAxis.data = xAxis
this.disqualificationUnitChartsOption.series[0].data = yAxis
this.disqualificationUnitCharts && this.disqualificationUnitCharts.setOption(this.disqualificationUnitChartsOption);
//地图上方卡片
let mapcard = this.statisticalData['单位']
this.mapcard[0].num = mapcard['不合格数量'] || 0
this.mapcard[1].num = mapcard['隐患单位数量'] || 0
this.mapcard[2].num = mapcard['协作任务数量'] || 0
//持证人数排名
let rankingList2 = this.statisticalData['持证人数排名']
this.rankingList2 = []
rankingList2.forEach(element => {
let obj: any = {}
obj.name = element.organization.name
obj.num = element.totalCount
obj.percentage = Math.round((element.totalCount / rankingList2[0].totalCount) * 100)
obj.type = "up"
obj.changeNum = 2
this.rankingList2.push(obj)
});
//任务完成情况两个echarts
let task = this.statisticalData['任务完成情况']
this.completionOfTaskPieOption.title[0].text = `{val|${task['总数']}}\n{name|任务总数}`
this.completionOfTaskPieOption.series[0].data = [
{ value: task['已完成'], name: '已完成' },
{ value: task['未完成'], name: '未完成' }
]
this.completionOfTaskPie && this.completionOfTaskPie.setOption(this.completionOfTaskPieOption);
let taskBar = task['组织机构数据']
let taskBarx = []
let taskBary1 = []
let taskBary2 = []
taskBar.forEach(element => {
taskBarx.push(element.organization.name)
taskBary1.push(element.completeCount)//已完成
taskBary2.push(element.uncompleteCount)//未完成
});
this.completionOfTaskBarOption.xAxis.data = taskBarx
this.completionOfTaskBarOption.series[0].data = taskBary1
this.completionOfTaskBarOption.series[1].data = taskBary2
this.completionOfTaskBar && this.completionOfTaskBar.setOption(this.completionOfTaskBarOption);
}
map
mapInit() {
//创建地图

Loading…
Cancel
Save