Browse Source

[完善]完善统计分析

非煤矿山灾害智能感知和预警系统
邵佳豪 2 years ago
parent
commit
50e19317ec
  1. 2
      src/app/home/statistic-analysis/home/home.component.html
  2. 56
      src/app/home/statistic-analysis/home/home.component.ts
  3. 2
      src/app/home/task/da-oneself-plan/checkagain/checkagain.component.ts
  4. 9
      src/app/home/task/station-task-apply/station-task-apply.component.html
  5. 28
      src/app/home/task/station-task-apply/station-task-apply.component.ts
  6. 9
      src/app/home/task/station-task-execution/station-task-execution.component.html
  7. 24
      src/app/home/task/station-task-execution/station-task-execution.component.ts
  8. 19
      src/app/home/task/station-weekly-plan/station-weekly-plan.component.html
  9. 31
      src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts
  10. 2
      src/app/http-interceptors/base-interceptor.ts

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

@ -162,7 +162,7 @@
</div>
</div>
<div class="bottombox fffcard flexcolumn">
<div class="spin" *ngIf="isLoading">
<div class="spin" *ngIf="isLoading2">
<nz-spin nzSimple></nz-spin>
</div>
<div class="title">

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

@ -336,7 +336,13 @@ export class HomeComponent implements OnInit {
this.completionOfTaskBar = echarts.init(document.getElementById('completionOfTask2'), null, { devicePixelRatio: 2 });
await this.getData()
this.echartsSetData()
let orid = JSON.parse(sessionStorage.getItem('userData')).organizationId
Promise.all([this.getData(), this.getData_taskStatByOrg(orid)]).then(data => {
this.echartsSetData()
this.echartsSetData_taskStatByOrg()
})
}
assistTaskRankingData: any = [
@ -400,6 +406,26 @@ export class HomeComponent implements OnInit {
}
statisticalData_taskStatByOrg
isLoading2 = false
//按组织获取任务完成情况
async getData_taskStatByOrg(orid) {
this.isLoading2 = true
return new Promise<void>((resolve, reject) => {
this.http.get('/api/PlanTasks/Dashboard_TaskStatByOrg', {
params: {
organizaionId: orid
}
}).subscribe((data: any) => {
console.log('按组织获取任务完成情况', data)
this.statisticalData_taskStatByOrg = data
this.isLoading2 = false
resolve(data)
})
})
}
top1_1_leftNum = 188 //任务总数
buhegedata = {
@ -476,8 +502,12 @@ export class HomeComponent implements OnInit {
this.rankingList2.push(obj)
});
}
echartsSetData_taskStatByOrg() {
//任务完成情况两个echarts
let task = this.statisticalData['任务完成情况']
let task = this.statisticalData_taskStatByOrg
this.completionOfTaskPieOption.title[0].text = `{val|${task['总数']}}\n{name|任务总数}`
this.completionOfTaskPieOption.series[0].data = [
{ value: task['已完成'], name: '已完成' },
@ -498,9 +528,27 @@ export class HomeComponent implements OnInit {
this.completionOfTaskBarOption.series[0].data = taskBary1
this.completionOfTaskBarOption.series[1].data = taskBary2
this.completionOfTaskBar && this.completionOfTaskBar.setOption(this.completionOfTaskBarOption);
// this.completionOfTaskBar.on('click', (params) => {
// console.log(6666,params)
// });
this.completionOfTaskBar.getZr().on('click', (params) => {
let pointInPixel = [params.offsetX, params.offsetY];
if (this.completionOfTaskBar.containPixel('grid', pointInPixel)) {
let pointInGrid = this.completionOfTaskBar.convertFromPixel({
seriesIndex: 0
}, pointInPixel);
let xIndex = pointInGrid[0]; //索引
let handleIndex = Number(xIndex);
let seriesObj = this.completionOfTaskBar.getOption(); //图表object对象
var op = this.completionOfTaskBar.getOption();
//获得图表中点击的列
var month = op.xAxis[0].data[handleIndex]; //获取点击的列名
console.log(month);
// console.log(handleIndex, seriesObj);
console.log(taskBar[handleIndex].organization.id)
};
});
}
map
mapInit() {
//创建地图

2
src/app/home/task/da-oneself-plan/checkagain/checkagain.component.ts

@ -13,7 +13,7 @@ export class CheckagainComponent implements OnInit {
taskAlldataOfform = []
ngOnInit(): void {
this.data.form.forEach(element => {
if (element.data.shangbao != '否' && element.name != '实战演练' && element.name != '数字化预案') {
if (JSON.stringify(element.data) != "{}" && element.data.shangbao != '否' && element.name != '实战演练' && element.name != '数字化预案') {
this.taskAlldataOfform.push(element)
}
});

9
src/app/home/task/station-task-apply/station-task-apply.component.html

@ -101,8 +101,8 @@
</span>
</div>
<div class="flexcol flexcollevel">
<span class="ellipsi" [title]="item.company.useNature">
{{item.company.useNature}}
<span class="ellipsi" [title]="item.company.companyLevel">
{{item.company.companyLevel}}
</span>
<span>
级别
@ -189,7 +189,10 @@
<div class="flexcol">
<span>
<a class="blue" style="margin-right: 6px;" (click)="look(item)">查看</a>
<a class="red" (click)="deleteTask(item, taskLIst)">删除</a>
<a class="red" *ngIf="item.approvalStatus == '待处理'"
(click)="deleteTask(item, taskLIst)">删除</a>
<a class="red" *ngIf="item.approvalStatus == '待检查'"
(click)="revocationTask(item, taskLIst)">撤销</a>
</span>
<span>
操作

28
src/app/home/task/station-task-apply/station-task-apply.component.ts

@ -118,7 +118,7 @@ export class StationTaskApplyComponent implements OnInit {
ContainsChildren: "true",
PageNumber: 1,
PageSize: 9999,
code:'0000'
code: '0000'
}
var p = new Promise<void>((resolve, reject) => {
this.http.get('/api/Organizations', {
@ -408,6 +408,32 @@ export class StationTaskApplyComponent implements OnInit {
});
}
//待检查撤销
revocationTask(item, taskLIst) {
this.modal.confirm({
nzTitle: `确定要撤销该任务吗?`,
nzOkText: '确定',
nzOkType: 'default',
nzOnOk: () => {
this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: {
approvalStatus: '待处理'
}
}).subscribe({
next: (data) => {
this.message.create('success', '已撤销');
item.approvalStatus = '待处理'
},
error: (err) => {
this.message.create('warning', '撤销失败');
}
})
},
nzCancelText: '取消'
});
}
}
export enum ApprovalStatus {

9
src/app/home/task/station-task-execution/station-task-execution.component.html

@ -107,8 +107,8 @@
</span>
</div>
<div class="flexcol">
<span class="ellipsi" [title]="item.company.useNature">
{{item.company.useNature}}
<span class="ellipsi" [title]="item.company.companyLevel">
{{item.company.companyLevel}}
</span>
<span>
单位级别
@ -189,7 +189,10 @@
<span>
<a class="blue" (click)="look(item)" style="margin-right: 5px;">查看</a>
<a class="blue" (click)="complete(item)" style="margin-right: 5px;">完成</a>
<a class="red" (click)="cancel(item)">驳回</a>
<a *ngIf="item.creationType != '自主任务' && item.approvalStatus != '已检查'" class="red"
(click)="cancel(item)">驳回</a>
<a *ngIf="item.creationType == '自主任务' && item.approvalStatus != '已检查'" class="red"
(click)="delete(item)">删除</a>
</span>
<span>
操作

24
src/app/home/task/station-task-execution/station-task-execution.component.ts

@ -79,7 +79,31 @@ export class StationTaskExecutionComponent implements OnInit {
});
}
delete(item) {
console.log(item)
this.modal.confirm({
nzTitle: `确定要删除该任务吗?`,
nzOkText: '确定',
nzOkType: 'primary',
nzOnOk: () => {
this.http.delete(`/api/PlanTasks/${item.id}`).subscribe(data => {
for (let index = 0; index < this.taskLIst.length; index++) {
const element = this.taskLIst[index];
if (element.id == item.id) {
this.taskLIst.splice(index, 1)
index--
}
}
this.message.create('success', '删除成功!');
})
},
nzCancelText: '取消',
nzOnCancel: () => {
}
});
}
isloading = false

19
src/app/home/task/station-weekly-plan/station-weekly-plan.component.html

@ -97,25 +97,32 @@
<div class="itemtwocontent">
<div class="itemtwocontentitem" *ngFor="let i of item.data">
<p class="itemtwocontentitemp1">
<span class="itemtwocontentitemp1name">{{i.company.companyName}}</span>
<span
class="itemtwocontentitemp1name">{{i.company.companyName}}<span>({{i.creationType}})</span></span>
<span class="marginr5">
<span class="green"
*ngIf="isExpand && i.approvalStatus!='已检查' && (i.relatedTaskId || i.creationType == '自主任务')"
*ngIf="isExpand && i.approvalStatus!='已检查' && i.relatedTaskId&& i.approvalStatus!='待检查'"
(click)="accept(i,item)">接受</span>
<span class="red"
*ngIf="isExpand && i.approvalStatus!='已检查' && (i.relatedTaskId || i.creationType == '自主任务')"
*ngIf="isExpand && i.approvalStatus!='已检查' && i.relatedTaskId && i.approvalStatus!='待检查'"
(click)="reject(i,item)">拒绝</span>
<span class="red"
*ngIf="isExpand && i.creationType == '自主任务' && i.approvalStatus != '已检查'"
(click)="delete(i,item)">删除</span>
<span *ngIf="isExpand">({{i.approvalStatus}})</span>
</span>
</p>
<p>{{i.company.organization.name}}</p>
<p class="marginr5">
<span class=" green"
*ngIf="!isExpand && i.approvalStatus!='已检查' && (i.relatedTaskId || i.creationType == '自主任务')"
*ngIf="!isExpand && i.approvalStatus!='已检查' && i.relatedTaskId&& i.approvalStatus!='待检查'"
(click)="accept(i,item)">接受</span>
<span class="red"
*ngIf="!isExpand && i.approvalStatus!='已检查' && (i.relatedTaskId || i.creationType == '自主任务')"
*ngIf="!isExpand && i.approvalStatus!='已检查' && i.relatedTaskId && i.approvalStatus!='待检查'"
(click)="reject(i,item)">拒绝</span>
<span class="red"
*ngIf="!isExpand && i.creationType == '自主任务' && i.approvalStatus != '已检查'"
(click)="delete(i,item)">删除</span>
<span *ngIf="!isExpand">({{i.approvalStatus}})</span>
</p>
</div>
@ -183,7 +190,7 @@
</div>
<div class="flexcol">
<span>
{{i.company.useNature}}
{{i.company.companyLevel}}
</span>
<span>
级别

31
src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts

@ -403,6 +403,37 @@ export class StationWeeklyPlanComponent implements OnInit {
});
}
//删除任务
delete(i, item) {
console.log(i)
console.log(item)
this.modal.confirm({
nzTitle: `确定要删除该任务吗?`,
nzOkText: '确定',
nzOkType: 'primary',
nzOnOk: () => {
this.http.delete(`/api/PlanTasks/${i.id}`).subscribe(data => {
for (let index = 0; index < item.data.length; index++) {
const element = item.data[index];
if (element.id == i.id) {
item.data.splice(index, 1)
index--
}
}
this.message.create('success', '删除成功!');
})
},
nzCancelText: '取消',
nzOnCancel: () => {
}
});
}
userName
organizationName
ngOnInit(): void {

2
src/app/http-interceptors/base-interceptor.ts

@ -80,7 +80,7 @@ export class BaseInterceptor implements HttpInterceptor {
console.error(
`状态码${error.status}, ` +
`错误内容:${error.error}`);
this.message.create('error', error.error.detail);
this.message.create('error', error.error.detail || error.error || error);
}
// 返回带有面向用户的错误信息
return throwError(() => {

Loading…
Cancel
Save