Commit 92edcc8c authored by wangqinghua's avatar wangqinghua

update

parent a1bb99eb
......@@ -12,17 +12,17 @@ export class AnalysisService {
//按事件分类导出报表
exportByType(data): Observable<any>{
return this.http.get(SERVER_API_URL + '/syseventCount/export/type?'+this.commonSer.toQuery(data) );
return this.http.get( SERVER_API_URL + "/syseventCount/export/type?"+this.commonSer.toQuery(data),{responseType: 'blob'});
}
//按事件处理人导出报表
exportByuser(data): Observable<any>{
return this.http.get(SERVER_API_URL + '/syseventCount/export/user?'+this.commonSer.toQuery(data));
return this.http.get( SERVER_API_URL + "/syseventCount/export/user?"+this.commonSer.toQuery(data),{responseType: 'blob'});
}
//按事件解决状态导出报表
exportByStatus(data): Observable<any>{
return this.http.get(SERVER_API_URL + '/syseventCount/export/status?'+this.commonSer.toQuery(data));
return this.http.get( SERVER_API_URL + "/syseventCount/export/status?"+this.commonSer.toQuery(data),{responseType: 'blob'});
}
//按事件分类统计
......
......@@ -10,7 +10,8 @@
<label nz-radio-button nzValue="4">自定义</label>
</nz-radio-group>
</div>
<div nz-col nzSpan="8" *ngIf="timeType == '4'">
<div nz-col nzSpan="8" >
<ng-container *ngIf="timeType == '4'">
<nz-date-picker
nzShowTime
[(ngModel)]="startTime"
......@@ -22,12 +23,19 @@
[(ngModel)]="endTime"
nzPlaceHolder="结束时间"
></nz-date-picker>
</ng-container>
</div>
<div nz-col nzSpan="6"></div>
<div nz-col nzSpan="2" class="text-right">
<button (click)="search()" nz-button nzType="default"><i class="anticon anticon-search"
style="color: #6097b7"></i>搜索
</button>
</div>
<div nz-col nzSpan="2" class="text-center">
<nz-spin [nzIndicator]="indicatorTemplate" nzTip='下载中...' [nzSpinning]="isDownload">
<button (click)="downLoad()" nz-button nzType="default"><i class="anticon anticon-download"></i>下载</button>
</nz-spin>
</div>
</div>
</div>
......@@ -69,3 +77,5 @@
</ng-container>
</tbody>
</nz-table>
<ng-template #indicatorTemplate><i class="anticon anticon-spin anticon-loading" style="font-size: 24px;"></i></ng-template>
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {DatePipe} from '@angular/common';
import {AnalysisService} from '../../analysis.service';
import {OverAllService} from '../../../overAll/overAll.service';
import {NzMessageService} from 'ng-zorro-antd';
import {CommonService} from '../../../shared/common/common.service';
@Component({
selector: 'smart-analysis-deal',
......@@ -14,7 +15,7 @@ export class AnalysisDealComponent implements OnInit {
isLoading = false;
startTime;
endTime;
timeType = "1";
timeType = '1';
dealList;
chartOption;
......@@ -24,9 +25,10 @@ export class AnalysisDealComponent implements OnInit {
};
noData = false;
isDownload = false;
constructor(private analysisSer: AnalysisService, private message: NzMessageService, private datePipe: DatePipe,
private overAllSer: OverAllService,) {
private overAllSer: OverAllService, private commonSer: CommonService) {
}
ngOnInit() {
......@@ -41,15 +43,15 @@ export class AnalysisDealComponent implements OnInit {
this.isLoading = true;
this.analysisSer.operateUser(this.obj).subscribe(
(res) => {
if(res.errCode == 10000){
if(res.data.length > 0 ){
if (res.errCode == 10000) {
if (res.data.length > 0) {
this.dealList = res.data;
this.setEcharts();
this.noData = false;
}else{
} else {
this.noData = true;
}
}else{
} else {
this.message.error(res.errMsg);
}
this.isLoading = false;
......@@ -57,33 +59,33 @@ export class AnalysisDealComponent implements OnInit {
);
}
setEcharts(){
setEcharts() {
this.chartOption = {
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
},
formatter: "{b} : {c}个"
formatter: '{b} : {c}个'
},
xAxis: {
type: 'category',
data: this.dealList.map(e=>{
data: this.dealList.map(e => {
return e.username;
})
},
yAxis: {
type: 'value',
minInterval : 1,
minInterval: 1,
axisLabel: {
show: true,
interval: 'auto',
formatter: '{value} 个'
},
boundaryGap : [ 0,0.1 ],
boundaryGap: [0, 0.1],
},
series: [{
data: this.dealList.map(e=>{
data: this.dealList.map(e => {
return e.num;
}),
type: 'bar'
......@@ -102,13 +104,13 @@ export class AnalysisDealComponent implements OnInit {
break;
}
case'2': { //周报
day1 = new Date(nowDate.getTime() - (nowDate.getDay()-1)*86400000);
day1 = new Date(nowDate.getTime() - (nowDate.getDay() - 1) * 86400000);
this.obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 23:59:59';
break;
}
case'3': { //月报
day1 = new Date(nowDate.getFullYear(),nowDate.getMonth(),1);
day1 = new Date(nowDate.getFullYear(), nowDate.getMonth(), 1);
this.obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 23:59:59';
break;
......@@ -128,4 +130,19 @@ export class AnalysisDealComponent implements OnInit {
this.getEcharts();
}
//下载
downLoad() {
this.isDownload = true;
const data = {
startTime: this.obj.startTime,
endTime: this.obj.endTime,
};
this.analysisSer.exportByuser(data).subscribe(
(data) => {
this.isDownload = false;
this.commonSer.downloadFile('处理人统计', data);
}
);
}
}
......@@ -2,14 +2,16 @@
<div class="releative">
<div class="time-div">
<div nz-col nzSpan="6">
<nz-radio-group style="width: 100%;" [(ngModel)]="timeType" (ngModelChange)="changeType()" [nzButtonStyle]="'solid'">
<nz-radio-group style="width: 100%;" [(ngModel)]="timeType" (ngModelChange)="changeType()"
[nzButtonStyle]="'solid'">
<label nz-radio-button nzValue="1">日报</label>
<label nz-radio-button nzValue="2">周报</label>
<label nz-radio-button nzValue="3">月报</label>
<label nz-radio-button nzValue="4">自定义</label>
</nz-radio-group>
</div>
<div nz-col nzSpan="8" *ngIf="timeType == '4'">
<div nz-col nzSpan="8" >
<ng-container *ngIf="timeType == '4'">
<nz-date-picker
nzShowTime
[(ngModel)]="startTime"
......@@ -21,10 +23,18 @@
[(ngModel)]="endTime"
nzPlaceHolder="结束时间"
></nz-date-picker>
</ng-container>
</div>
<div nz-col nzSpan="6"></div>
<div nz-col nzSpan="2" class="text-right">
<button (click)="search()" nz-button nzType="default"><i class="anticon anticon-search"
style="color: #6097b7"></i>搜索</button>
style="color: #6097b7"></i>搜索
</button>
</div>
<div nz-col nzSpan="2" class="text-center">
<nz-spin [nzIndicator]="indicatorTemplate" nzTip='下载中...' [nzSpinning]="isDownload">
<button (click)="downLoad()" nz-button nzType="default"><i class="anticon anticon-download"></i>下载</button>
</nz-spin>
</div>
</div>
</div>
......@@ -66,3 +76,6 @@
</ng-container>
</tbody>
</nz-table>
<ng-template #indicatorTemplate><i class="anticon anticon-spin anticon-loading" style="font-size: 24px;"></i></ng-template>
......@@ -3,6 +3,7 @@ import {DatePipe} from '@angular/common';
import {AnalysisService} from '../../analysis.service';
import {OverAllService} from '../../../overAll/overAll.service';
import {NzMessageService} from 'ng-zorro-antd';
import {CommonService} from '../../../shared/common/common.service';
@Component({
selector: 'smart-analysis-event',
......@@ -24,9 +25,11 @@ export class AnalysisEventComponent implements OnInit {
};
noData = false;
isDownload = false;
constructor(private analysisSer: AnalysisService, private message: NzMessageService, private datePipe: DatePipe,
private overAllSer: OverAllService,) {
private overAllSer: OverAllService,private commonSer:CommonService) {
}
ngOnInit() {
......@@ -127,4 +130,19 @@ export class AnalysisEventComponent implements OnInit {
}
this.getEcharts();
}
//下载
downLoad() {
this.isDownload = true;
const data = {
startTime: this.obj.startTime,
endTime: this.obj.endTime,
};
this.analysisSer.exportByType(data).subscribe(
(data) => {
this.isDownload = false;
this.commonSer.downloadFile('事件分类统计', data);
}
);
}
}
......@@ -2,14 +2,16 @@
<div class="releative">
<div class="time-div">
<div nz-col nzSpan="6">
<nz-radio-group style="width: 100%;" [(ngModel)]="timeType" (ngModelChange)="changeType()" [nzButtonStyle]="'solid'">
<nz-radio-group style="width: 100%;" [(ngModel)]="timeType" (ngModelChange)="changeType()"
[nzButtonStyle]="'solid'">
<label nz-radio-button nzValue="1">日报</label>
<label nz-radio-button nzValue="2">周报</label>
<label nz-radio-button nzValue="3">月报</label>
<label nz-radio-button nzValue="4">自定义</label>
</nz-radio-group>
</div>
<div nz-col nzSpan="8" *ngIf="timeType == '4'">
<div nz-col nzSpan="8" >
<ng-container *ngIf="timeType == '4'">
<nz-date-picker
nzShowTime
[(ngModel)]="startTime"
......@@ -21,10 +23,18 @@
[(ngModel)]="endTime"
nzPlaceHolder="结束时间"
></nz-date-picker>
</ng-container>
</div>
<div nz-col nzSpan="6"></div>
<div nz-col nzSpan="2" class="text-right">
<button (click)="search()" nz-button nzType="default"><i class="anticon anticon-search"
style="color: #6097b7"></i>搜索</button>
style="color: #6097b7"></i>搜索
</button>
</div>
<div nz-col nzSpan="2" class="text-center">
<nz-spin [nzIndicator]="indicatorTemplate" nzTip='下载中...' [nzSpinning]="isDownload">
<button (click)="downLoad()" nz-button nzType="default"><i class="anticon anticon-download"></i>下载</button>
</nz-spin>
</div>
</div>
</div>
......@@ -71,3 +81,5 @@
</ng-container>
</tbody>
</nz-table>
<ng-template #indicatorTemplate><i class="anticon anticon-spin anticon-loading" style="font-size: 24px;"></i></ng-template>
......@@ -3,6 +3,7 @@ import {DatePipe} from '@angular/common';
import {AnalysisService} from '../../analysis.service';
import {OverAllService} from '../../../overAll/overAll.service';
import {NzMessageService} from 'ng-zorro-antd';
import {CommonService} from '../../../shared/common/common.service';
@Component({
selector: 'smart-analysis-status',
......@@ -24,9 +25,10 @@ export class AnalysisStatusComponent implements OnInit {
};
noData = false;
isDownload = false;
constructor(private analysisSer: AnalysisService, private message: NzMessageService, private datePipe: DatePipe,
private overAllSer: OverAllService,) {
private overAllSer: OverAllService,private commonSer:CommonService) {
}
ngOnInit() {
......@@ -127,4 +129,18 @@ export class AnalysisStatusComponent implements OnInit {
this.getEcharts();
}
//下载
downLoad() {
this.isDownload = true;
const data = {
startTime: this.obj.startTime,
endTime: this.obj.endTime,
};
this.analysisSer.exportByStatus(data).subscribe(
(data) => {
this.isDownload = false;
this.commonSer.downloadFile('解决状态', data);
}
);
}
}
......@@ -74,7 +74,7 @@
<div echarts [options]="chartTopOption" style="height: 400px;width: 100%"></div>
</ng-container>
</div>
<div nz-col nzSpan="12" style="height: 500px">
<div nz-col nzSpan="12" style="height: 500px;">
<ng-container *ngIf="data.right">
<div class="img-noData">
<div class="noData" title="暂无数据"></div>
......
......@@ -330,7 +330,7 @@ ui bootstrap tweaks
.time-div{
position: absolute;
z-index: 9;
left: 35%;
left: 0%;
top: 0;
width: 100%;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment