Browse Source

[新增]统计分析真数据

非煤矿山灾害智能感知和预警系统
邵佳豪 2 years ago
parent
commit
7edb57a09a
  1. 5
      src/app/home/home.module.ts
  2. 16
      src/app/home/statistic-analysis/home/home.component.html
  3. 11
      src/app/home/statistic-analysis/home/home.component.ts
  4. 2
      src/app/home/task/zhi-indicators/zhi-indicators.component.ts
  5. 7
      src/app/pipe/pipe.ts

5
src/app/home/home.module.ts

@ -73,7 +73,7 @@ import { ChatWindowComponent } from './commonComponents/chat-window/chat-window.
import { AngularDraggableModule } from 'angular2-draggable';
import { HomeComponent } from './statistic-analysis/home/home.component';
import { UploadComponent } from './task/station-task-execution/upload/upload.component';
import { chineseNumbers, fileName } from '../pipe/pipe';
import { chineseNumbers, fileName, absoluteValue } from '../pipe/pipe';
import { TaskDetailsPagesComponent } from './task/station-task-execution/task-details/task-details.component';
import { NzTabsModule } from 'ng-zorro-antd/tabs';
import { CheckagainComponent } from './task/da-oneself-plan/checkagain/checkagain.component';
@ -121,7 +121,8 @@ import { CheckagainComponent } from './task/da-oneself-plan/checkagain/checkagai
UploadComponent,
fileName,
chineseNumbers,
CheckagainComponent
CheckagainComponent,
absoluteValue
],
imports: [
CommonModule,

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

@ -146,16 +146,14 @@
</div>
<div class="num">
<span>{{item.num}}</span>
<!-- <ng-container *ngIf="item.type == 'up'; else elseTemplate">
<img src="../../../../assets/statistic-analysis/up.png" alt="">
</ng-container>
<ng-template #elseTemplate>
<img src="../../../../assets/statistic-analysis/down.png" alt="">
</ng-template>
<span class="numchange"
<img *ngIf="item.type == 'up'" src="../../../../assets/statistic-analysis/up.png"
alt="">
<img *ngIf="item.type == 'down'" src="../../../../assets/statistic-analysis/down.png"
alt="">
<span *ngIf="item.changeNum != 0" class="numchange"
[ngClass]="{'numchangered': item.type == 'down','invariant': item.type == 'invariant','numchangegreen': item.type == 'up'}">
{{item.changeNum}}
</span> -->
{{item.changeNum | absoluteValue}}
</span>
</div>
</div>
</div>

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

@ -152,7 +152,8 @@ export class HomeComponent implements OnInit {
val: {
fontSize: 28,
fontWeight: 'bold',
color: '#333333'
color: '#333333',
},
name: {
fontSize: 14,
@ -464,8 +465,14 @@ export class HomeComponent implements OnInit {
obj.name = element.organization.name
obj.num = element.totalCount
obj.percentage = Math.round((element.totalCount / rankingList2[0].totalCount) * 100)
if (element.differenceCount == 0) {
obj.type = "="
} else if (element.differenceCount < 0) {
obj.type = "down"
} else if (element.differenceCount > 0) {
obj.type = "up"
obj.changeNum = 2
}
obj.changeNum = element.differenceCount
this.rankingList2.push(obj)
});

2
src/app/home/task/zhi-indicators/zhi-indicators.component.ts

@ -781,7 +781,7 @@ export class ZhiIndicatorsComponent implements OnInit {
if (instance.validateForm.valid) {
await new Promise((resolve, reject) => {
let body = {
supervisorIds: [...instance.validateForm.value.main, ...instance.validateForm.value.assitant]
supervisorIds: [instance.validateForm.value.main, instance.validateForm.value.assitant]
}
this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({
next: async (data) => {

7
src/app/pipe/pipe.ts

@ -16,3 +16,10 @@ export class chineseNumbers implements PipeTransform {
return arr[value]
}
}
@Pipe({ name: 'absoluteValue' })
export class absoluteValue implements PipeTransform {
transform(number: any): number {
return Math.abs(number)
}
}

Loading…
Cancel
Save