Commit 92edcc8c authored by wangqinghua's avatar wangqinghua

update

parent a1bb99eb
...@@ -12,17 +12,17 @@ export class AnalysisService { ...@@ -12,17 +12,17 @@ export class AnalysisService {
//按事件分类导出报表 //按事件分类导出报表
exportByType(data): Observable<any>{ 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>{ 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>{ 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,24 +10,32 @@ ...@@ -10,24 +10,32 @@
<label nz-radio-button nzValue="4">自定义</label> <label nz-radio-button nzValue="4">自定义</label>
</nz-radio-group> </nz-radio-group>
</div> </div>
<div nz-col nzSpan="8" *ngIf="timeType == '4'"> <div nz-col nzSpan="8" >
<nz-date-picker <ng-container *ngIf="timeType == '4'">
nzShowTime <nz-date-picker
[(ngModel)]="startTime" nzShowTime
nzPlaceHolder="开始时间" [(ngModel)]="startTime"
></nz-date-picker> nzPlaceHolder="开始时间"
<nz-date-picker ></nz-date-picker>
nzShowTime <nz-date-picker
nzFormat="yyyy-MM-dd HH:mm:ss" nzShowTime
[(ngModel)]="endTime" nzFormat="yyyy-MM-dd HH:mm:ss"
nzPlaceHolder="结束时间" [(ngModel)]="endTime"
></nz-date-picker> nzPlaceHolder="结束时间"
></nz-date-picker>
</ng-container>
</div> </div>
<div nz-col nzSpan="6"></div>
<div nz-col nzSpan="2" class="text-right"> <div nz-col nzSpan="2" class="text-right">
<button (click)="search()" nz-button nzType="default"><i class="anticon anticon-search" <button (click)="search()" nz-button nzType="default"><i class="anticon anticon-search"
style="color: #6097b7"></i>搜索 style="color: #6097b7"></i>搜索
</button> </button>
</div> </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>
</div> </div>
...@@ -68,4 +76,6 @@ ...@@ -68,4 +76,6 @@
</tr> </tr>
</ng-container> </ng-container>
</tbody> </tbody>
</nz-table> </nz-table>
\ No newline at end of file
<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 {DatePipe} from '@angular/common';
import {AnalysisService} from '../../analysis.service'; import {AnalysisService} from '../../analysis.service';
import {OverAllService} from '../../../overAll/overAll.service'; import {OverAllService} from '../../../overAll/overAll.service';
import {NzMessageService} from 'ng-zorro-antd'; import {NzMessageService} from 'ng-zorro-antd';
import {CommonService} from '../../../shared/common/common.service';
@Component({ @Component({
selector: 'smart-analysis-deal', selector: 'smart-analysis-deal',
templateUrl: './analysis-deal.component.html', templateUrl: './analysis-deal.component.html',
styles: [] styles: []
}) })
export class AnalysisDealComponent implements OnInit { export class AnalysisDealComponent implements OnInit {
isLoading = false; isLoading = false;
startTime; startTime;
endTime; endTime;
timeType = "1"; timeType = '1';
dealList; dealList;
chartOption; chartOption;
...@@ -24,9 +25,10 @@ export class AnalysisDealComponent implements OnInit { ...@@ -24,9 +25,10 @@ export class AnalysisDealComponent implements OnInit {
}; };
noData = false; noData = false;
isDownload = false;
constructor(private analysisSer: AnalysisService, private message: NzMessageService, private datePipe: DatePipe, constructor(private analysisSer: AnalysisService, private message: NzMessageService, private datePipe: DatePipe,
private overAllSer: OverAllService,) { private overAllSer: OverAllService, private commonSer: CommonService) {
} }
ngOnInit() { ngOnInit() {
...@@ -41,49 +43,49 @@ export class AnalysisDealComponent implements OnInit { ...@@ -41,49 +43,49 @@ export class AnalysisDealComponent implements OnInit {
this.isLoading = true; this.isLoading = true;
this.analysisSer.operateUser(this.obj).subscribe( this.analysisSer.operateUser(this.obj).subscribe(
(res) => { (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
if(res.data.length > 0 ){ if (res.data.length > 0) {
this.dealList = res.data; this.dealList = res.data;
this.setEcharts(); this.setEcharts();
this.noData = false; this.noData = false;
}else{ } else {
this.noData = true; this.noData = true;
}
}else{
this.message.error(res.errMsg);
} }
this.isLoading = false; } else {
this.message.error(res.errMsg);
}
this.isLoading = false;
} }
); );
} }
setEcharts(){ setEcharts() {
this.chartOption = { this.chartOption = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效 axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}, },
formatter: "{b} : {c}个" formatter: '{b} : {c}个'
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
data: this.dealList.map(e=>{ data: this.dealList.map(e => {
return e.username; return e.username;
}) })
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
minInterval : 1, minInterval: 1,
axisLabel: { axisLabel: {
show: true, show: true,
interval: 'auto', interval: 'auto',
formatter: '{value} 个' formatter: '{value} 个'
}, },
boundaryGap : [ 0,0.1 ], boundaryGap: [0, 0.1],
}, },
series: [{ series: [{
data: this.dealList.map(e=>{ data: this.dealList.map(e => {
return e.num; return e.num;
}), }),
type: 'bar' type: 'bar'
...@@ -102,13 +104,13 @@ export class AnalysisDealComponent implements OnInit { ...@@ -102,13 +104,13 @@ export class AnalysisDealComponent implements OnInit {
break; break;
} }
case'2': { //周报 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.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 23:59:59'; this.obj.endTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 23:59:59';
break; break;
} }
case'3': { //月报 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.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 23:59:59'; this.obj.endTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 23:59:59';
break; break;
...@@ -128,4 +130,19 @@ export class AnalysisDealComponent implements OnInit { ...@@ -128,4 +130,19 @@ export class AnalysisDealComponent implements OnInit {
this.getEcharts(); 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,29 +2,39 @@ ...@@ -2,29 +2,39 @@
<div class="releative"> <div class="releative">
<div class="time-div"> <div class="time-div">
<div nz-col nzSpan="6"> <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="1">日报</label>
<label nz-radio-button nzValue="2">周报</label> <label nz-radio-button nzValue="2">周报</label>
<label nz-radio-button nzValue="3">月报</label> <label nz-radio-button nzValue="3">月报</label>
<label nz-radio-button nzValue="4">自定义</label> <label nz-radio-button nzValue="4">自定义</label>
</nz-radio-group> </nz-radio-group>
</div> </div>
<div nz-col nzSpan="8" *ngIf="timeType == '4'"> <div nz-col nzSpan="8" >
<nz-date-picker <ng-container *ngIf="timeType == '4'">
nzShowTime <nz-date-picker
[(ngModel)]="startTime" nzShowTime
nzPlaceHolder="开始时间" [(ngModel)]="startTime"
></nz-date-picker> nzPlaceHolder="开始时间"
<nz-date-picker ></nz-date-picker>
nzShowTime <nz-date-picker
nzFormat="yyyy-MM-dd HH:mm:ss" nzShowTime
[(ngModel)]="endTime" nzFormat="yyyy-MM-dd HH:mm:ss"
nzPlaceHolder="结束时间" [(ngModel)]="endTime"
></nz-date-picker> nzPlaceHolder="结束时间"
></nz-date-picker>
</ng-container>
</div> </div>
<div nz-col nzSpan="6"></div>
<div nz-col nzSpan="2" class="text-right"> <div nz-col nzSpan="2" class="text-right">
<button (click)="search()" nz-button nzType="default"><i class="anticon anticon-search" <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> </div>
</div> </div>
...@@ -66,3 +76,6 @@ ...@@ -66,3 +76,6 @@
</ng-container> </ng-container>
</tbody> </tbody>
</nz-table> </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'; ...@@ -3,6 +3,7 @@ import {DatePipe} from '@angular/common';
import {AnalysisService} from '../../analysis.service'; import {AnalysisService} from '../../analysis.service';
import {OverAllService} from '../../../overAll/overAll.service'; import {OverAllService} from '../../../overAll/overAll.service';
import {NzMessageService} from 'ng-zorro-antd'; import {NzMessageService} from 'ng-zorro-antd';
import {CommonService} from '../../../shared/common/common.service';
@Component({ @Component({
selector: 'smart-analysis-event', selector: 'smart-analysis-event',
...@@ -24,9 +25,11 @@ export class AnalysisEventComponent implements OnInit { ...@@ -24,9 +25,11 @@ export class AnalysisEventComponent implements OnInit {
}; };
noData = false; noData = false;
isDownload = false;
constructor(private analysisSer: AnalysisService, private message: NzMessageService, private datePipe: DatePipe, constructor(private analysisSer: AnalysisService, private message: NzMessageService, private datePipe: DatePipe,
private overAllSer: OverAllService,) { private overAllSer: OverAllService,private commonSer:CommonService) {
} }
ngOnInit() { ngOnInit() {
...@@ -127,4 +130,19 @@ export class AnalysisEventComponent implements OnInit { ...@@ -127,4 +130,19 @@ export class AnalysisEventComponent implements OnInit {
} }
this.getEcharts(); 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,29 +2,39 @@ ...@@ -2,29 +2,39 @@
<div class="releative"> <div class="releative">
<div class="time-div"> <div class="time-div">
<div nz-col nzSpan="6"> <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="1">日报</label>
<label nz-radio-button nzValue="2">周报</label> <label nz-radio-button nzValue="2">周报</label>
<label nz-radio-button nzValue="3">月报</label> <label nz-radio-button nzValue="3">月报</label>
<label nz-radio-button nzValue="4">自定义</label> <label nz-radio-button nzValue="4">自定义</label>
</nz-radio-group> </nz-radio-group>
</div> </div>
<div nz-col nzSpan="8" *ngIf="timeType == '4'"> <div nz-col nzSpan="8" >
<nz-date-picker <ng-container *ngIf="timeType == '4'">
nzShowTime <nz-date-picker
[(ngModel)]="startTime" nzShowTime
nzPlaceHolder="开始时间" [(ngModel)]="startTime"
></nz-date-picker> nzPlaceHolder="开始时间"
<nz-date-picker ></nz-date-picker>
nzShowTime <nz-date-picker
nzFormat="yyyy-MM-dd HH:mm:ss" nzShowTime
[(ngModel)]="endTime" nzFormat="yyyy-MM-dd HH:mm:ss"
nzPlaceHolder="结束时间" [(ngModel)]="endTime"
></nz-date-picker> nzPlaceHolder="结束时间"
></nz-date-picker>
</ng-container>
</div> </div>
<div nz-col nzSpan="6"></div>
<div nz-col nzSpan="2" class="text-right"> <div nz-col nzSpan="2" class="text-right">
<button (click)="search()" nz-button nzType="default"><i class="anticon anticon-search" <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> </div>
</div> </div>
...@@ -70,4 +80,6 @@ ...@@ -70,4 +80,6 @@
</tr> </tr>
</ng-container> </ng-container>
</tbody> </tbody>
</nz-table> </nz-table>
\ No newline at end of file
<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'; ...@@ -3,6 +3,7 @@ import {DatePipe} from '@angular/common';
import {AnalysisService} from '../../analysis.service'; import {AnalysisService} from '../../analysis.service';
import {OverAllService} from '../../../overAll/overAll.service'; import {OverAllService} from '../../../overAll/overAll.service';
import {NzMessageService} from 'ng-zorro-antd'; import {NzMessageService} from 'ng-zorro-antd';
import {CommonService} from '../../../shared/common/common.service';
@Component({ @Component({
selector: 'smart-analysis-status', selector: 'smart-analysis-status',
...@@ -24,9 +25,10 @@ export class AnalysisStatusComponent implements OnInit { ...@@ -24,9 +25,10 @@ export class AnalysisStatusComponent implements OnInit {
}; };
noData = false; noData = false;
isDownload = false;
constructor(private analysisSer: AnalysisService, private message: NzMessageService, private datePipe: DatePipe, constructor(private analysisSer: AnalysisService, private message: NzMessageService, private datePipe: DatePipe,
private overAllSer: OverAllService,) { private overAllSer: OverAllService,private commonSer:CommonService) {
} }
ngOnInit() { ngOnInit() {
...@@ -127,4 +129,18 @@ export class AnalysisStatusComponent implements OnInit { ...@@ -127,4 +129,18 @@ export class AnalysisStatusComponent implements OnInit {
this.getEcharts(); 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 @@ ...@@ -74,7 +74,7 @@
<div echarts [options]="chartTopOption" style="height: 400px;width: 100%"></div> <div echarts [options]="chartTopOption" style="height: 400px;width: 100%"></div>
</ng-container> </ng-container>
</div> </div>
<div nz-col nzSpan="12" style="height: 500px"> <div nz-col nzSpan="12" style="height: 500px;">
<ng-container *ngIf="data.right"> <ng-container *ngIf="data.right">
<div class="img-noData"> <div class="img-noData">
<div class="noData" title="暂无数据"></div> <div class="noData" title="暂无数据"></div>
......
...@@ -330,7 +330,7 @@ ui bootstrap tweaks ...@@ -330,7 +330,7 @@ ui bootstrap tweaks
.time-div{ .time-div{
position: absolute; position: absolute;
z-index: 9; z-index: 9;
left: 35%; left: 0%;
top: 0; top: 0;
width: 100%; 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