Browse Source

[新增]统计分析点击

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

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

@ -165,6 +165,9 @@
(click)="goback()">返回</span>
</div>
<div class="completionOfTask">
<div class="textbox">
<span (click)="clickText(item)" [ngClass]="{'grey': !item.isSelected}" *ngFor="let item of textbox">{{item.name}}</span>
</div>
<div class="completionOfTask1" id="completionOfTask1">
</div>

22
src/app/home/statistic-analysis/home/home.component.scss

@ -188,9 +188,31 @@
.completionOfTask {
display: flex;
position: relative;
.textbox {
position: absolute;
left: 0;
top: 0;
z-index: 999;
color: #2eb485;
cursor: pointer;
margin-left: 18px;
margin-top: 6px;
span {
margin-right: 6px;
font-size: 14px;
}
.grey {
color: grey;
}
}
.completionOfTask1 {
flex: 1;
}
.completionOfTask2 {

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

@ -172,7 +172,7 @@ export class HomeComponent implements OnInit {
title: [
{
text: `{val|0}\n{name|任务总数}`,
top: 'center',
top: '42%',
left: '26%',
textStyle: {
rich: {
@ -223,7 +223,7 @@ export class HomeComponent implements OnInit {
{
type: 'pie',
radius: ['50%', '65%'],
center: ['35%', '50%'],
center: ['35%', '55%'],
avoidLabelOverlap: false,
label: {
show: false,
@ -422,7 +422,6 @@ export class HomeComponent implements OnInit {
if (taskBar[handleIndex].organization.level == 'battalion') {
//点击大队
this.leveldata = taskBar[handleIndex].organization;
this.completionOfTaskBar.clear();
this.getData_taskStatByOrg(taskBar[handleIndex].organization.id).then(
(data) => {
this.echartsSetData_taskStatByOrg();
@ -459,7 +458,6 @@ export class HomeComponent implements OnInit {
}
goback() {
this.completionOfTaskBar.clear();
this.getData_taskStatByOrg(this.leveldata.parentId).then((data) => {
this.echartsSetData_taskStatByOrg();
this.leveldata = null;
@ -611,10 +609,13 @@ export class HomeComponent implements OnInit {
async getData_taskStatByOrg(orid) {
this.isLoading2 = true;
return new Promise<void>((resolve, reject) => {
let arr = this.textbox.filter((item) => item.isSelected);
let creationTypes = arr.map((v) => taskName[v.name]);
this.http
.get('/api/PlanTasks/Dashboard_TaskStatByOrg', {
params: {
organizaionId: orid,
creationTypes: creationTypes,
},
})
.subscribe((data: any) => {
@ -626,7 +627,7 @@ export class HomeComponent implements OnInit {
});
}
top1_1_leftNum = 188; //任务总数
top1_1_leftNum = 0; //任务总数
buhegedata = {
badCount: 0,
@ -729,6 +730,8 @@ export class HomeComponent implements OnInit {
}
echartsSetData_taskStatByOrg() {
this.completionOfTaskPie.clear();
this.completionOfTaskBar.clear();
//任务完成情况两个echarts
let task = this.statisticalData_taskStatByOrg;
this.completionOfTaskPieOption.title[0].text = `{val|${task['总数']}}\n{name|任务总数}`;
@ -865,4 +868,28 @@ export class HomeComponent implements OnInit {
});
}
}
textbox = [
{ name: '上级派发任务', isSelected: true },
{ name: '自主任务', isSelected: true },
{ name: '协助任务', isSelected: true },
];
clickText(item) {
item.isSelected = !item.isSelected;
console.log(this.leveldata);
let id;
this.leveldata
? (id = this.leveldata.id)
: (id = JSON.parse(sessionStorage.getItem('userData')).organizationId);
this.getData_taskStatByOrg(id).then((data) => {
this.echartsSetData_taskStatByOrg();
});
}
}
enum taskName {
'上级派发任务' = '上级指派',
'自主任务' = '自主任务',
'协助任务' = '申领任务',
}

Loading…
Cancel
Save