diff --git a/src/app/home/home.module.ts b/src/app/home/home.module.ts index 2fceae0..ad4d497 100644 --- a/src/app/home/home.module.ts +++ b/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, @@ -163,6 +164,6 @@ import { CheckagainComponent } from './task/da-oneself-plan/checkagain/checkagai NzTabsModule ], providers: [StationTaskExecutionComponent, StationWeeklyPlanComponent], - entryComponents: [AddroleComponent, EditroleComponent, AdduserComponent, EdituserComponent, AddorComponent, EditorComponent, ApplyComponent, ApplyLookComponent, LookTaskComponent, AllotPersonComponent, EditOrComponent, CreateTaskComponent, UploadComponent,CheckagainComponent] + entryComponents: [AddroleComponent, EditroleComponent, AdduserComponent, EdituserComponent, AddorComponent, EditorComponent, ApplyComponent, ApplyLookComponent, LookTaskComponent, AllotPersonComponent, EditOrComponent, CreateTaskComponent, UploadComponent, CheckagainComponent] }) export class HomeModule { } diff --git a/src/app/home/statistic-analysis/home/home.component.html b/src/app/home/statistic-analysis/home/home.component.html index 507e476..036df76 100644 --- a/src/app/home/statistic-analysis/home/home.component.html +++ b/src/app/home/statistic-analysis/home/home.component.html @@ -146,16 +146,14 @@
{{item.num}} - + {{item.changeNum | absoluteValue}} +
diff --git a/src/app/home/statistic-analysis/home/home.component.ts b/src/app/home/statistic-analysis/home/home.component.ts index fa2e2e1..f6562bf 100644 --- a/src/app/home/statistic-analysis/home/home.component.ts +++ b/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) - obj.type = "up" - obj.changeNum = 2 + if (element.differenceCount == 0) { + obj.type = "=" + } else if (element.differenceCount < 0) { + obj.type = "down" + } else if (element.differenceCount > 0) { + obj.type = "up" + } + obj.changeNum = element.differenceCount this.rankingList2.push(obj) }); @@ -483,7 +490,7 @@ export class HomeComponent implements OnInit { let taskBary1 = [] let taskBary2 = [] taskBar.forEach(element => { - taskBarx.push(element.organization.name) + taskBarx.push(element.organization.name) taskBary1.push(element.completeCount)//已完成 taskBary2.push(element.uncompleteCount)//未完成 }); diff --git a/src/app/home/task/zhi-indicators/zhi-indicators.component.ts b/src/app/home/task/zhi-indicators/zhi-indicators.component.ts index 67e16b1..aef5a4f 100644 --- a/src/app/home/task/zhi-indicators/zhi-indicators.component.ts +++ b/src/app/home/task/zhi-indicators/zhi-indicators.component.ts @@ -304,7 +304,7 @@ export class ZhiIndicatorsComponent implements OnInit { ContainsChildren: "true", PageNumber: 1, PageSize: 9999, - code:'0000' + code: '0000' } return new Promise((resolve, reject) => { this.http.get('/api/Organizations', { @@ -498,10 +498,10 @@ export class ZhiIndicatorsComponent implements OnInit { let iszhanxun = roles.find(item => { return item.name.indexOf('战训') != -1 }) - if(iszhanxun){ + if (iszhanxun) { this.iszhanxun = true } - console.log('iszhanxun',iszhanxun) + console.log('iszhanxun', iszhanxun) } //投诉举报/行政许可 选择单位 确认按钮 selectedUnit(data, type) { @@ -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) => { diff --git a/src/app/pipe/pipe.ts b/src/app/pipe/pipe.ts index 4186498..dbab254 100644 --- a/src/app/pipe/pipe.ts +++ b/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) + } +}