diff --git a/src/app/home/statistic-analysis/home/home.component.html b/src/app/home/statistic-analysis/home/home.component.html index 8a8ad37..95357a2 100644 --- a/src/app/home/statistic-analysis/home/home.component.html +++ b/src/app/home/statistic-analysis/home/home.component.html @@ -165,6 +165,9 @@ (click)="goback()">返回
+
+ {{item.name}} +
diff --git a/src/app/home/statistic-analysis/home/home.component.scss b/src/app/home/statistic-analysis/home/home.component.scss index b5675b4..e5b64a5 100644 --- a/src/app/home/statistic-analysis/home/home.component.scss +++ b/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 { diff --git a/src/app/home/statistic-analysis/home/home.component.ts b/src/app/home/statistic-analysis/home/home.component.ts index c138d60..bb91e38 100644 --- a/src/app/home/statistic-analysis/home/home.component.ts +++ b/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((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 { + '上级派发任务' = '上级指派', + '自主任务' = '自主任务', + '协助任务' = '申领任务', }