Commit 78038505 authored by wangqinghua's avatar wangqinghua

update

parent 5731132e
<!--处理人统计--> <!--处理人统计-->
<nz-spin> <div class="releative">
<div class="time-div">
<div nz-col nzSpan="6">
<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'">
<nz-date-picker
nzShowTime
[(ngModel)]="startTime"
nzPlaceHolder="开始时间"
></nz-date-picker>
<nz-date-picker
nzShowTime
nzFormat="yyyy-MM-dd HH:mm:ss"
[(ngModel)]="endTime"
nzPlaceHolder="结束时间"
></nz-date-picker>
</div>
</div>
</div>
<nz-spin [nzSpinning]="isLoading">
<div echarts [options]="chartOption" style="height: 400px;width: 100%"></div> <div echarts [options]="chartOption" style="height: 400px;width: 100%"></div>
</nz-spin> </nz-spin>
......
...@@ -11,9 +11,10 @@ import {NzMessageService} from 'ng-zorro-antd'; ...@@ -11,9 +11,10 @@ import {NzMessageService} from 'ng-zorro-antd';
}) })
export class AnalysisDealComponent implements OnInit { export class AnalysisDealComponent implements OnInit {
isLoading = false;
startTime; startTime;
endTime; endTime;
timeType; timeType = "1";
dealList; dealList;
chartOption; chartOption;
...@@ -67,35 +68,27 @@ export class AnalysisDealComponent implements OnInit { ...@@ -67,35 +68,27 @@ export class AnalysisDealComponent implements OnInit {
//时间改变 //时间改变
changeType() { changeType() {
const nowDate = new Date().getTime(); const nowDate = new Date();
let day1, day2; let day1, day2;
switch (this.timeType) { switch (this.timeType) {
case'1': { case'1': { //日报
this.obj.startTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 00:00:00'; this.obj.startTime = this.datePipe.transform(nowDate, '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'2': { case'2': { //周报
day1 = nowDate - 1 * 24 * 60 * 60 * 1000; 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(day1, 'yyyy-MM-dd') + ' 23:59:59'; this.obj.endTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 23:59:59';
break;
}
case'3': {
day1 = nowDate - 3 * 24 * 60 * 60 * 1000;
day2 = nowDate - 1 * 24 * 60 * 60 * 1000;
this.obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endTime = this.datePipe.transform(day2, 'yyyy-MM-dd') + ' 23:59:59';
break; break;
} }
case'4': { case'3': { //月报
day1 = nowDate - 7 * 24 * 60 * 60 * 1000; day1 = new Date(nowDate.getFullYear(),nowDate.getMonth(),1);
day2 = nowDate - 1 * 24 * 60 * 60 * 1000;
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(day2, 'yyyy-MM-dd') + ' 23:59:59'; this.obj.endTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 23:59:59';
break; break;
} }
case'5': { case'4': { //自定义
break; break;
} }
} }
...@@ -103,7 +96,7 @@ export class AnalysisDealComponent implements OnInit { ...@@ -103,7 +96,7 @@ export class AnalysisDealComponent implements OnInit {
//搜索 //搜索
search() { search() {
if (this.timeType == '5') { if (this.timeType == '4') {
this.obj.startTime = this.datePipe.transform(this.startTime, 'yyyy-MM-dd HH:mm:ss'); this.obj.startTime = this.datePipe.transform(this.startTime, 'yyyy-MM-dd HH:mm:ss');
this.obj.endTime = this.datePipe.transform(this.endTime, 'yyyy-MM-dd HH:mm:ss'); this.obj.endTime = this.datePipe.transform(this.endTime, 'yyyy-MM-dd HH:mm:ss');
} }
......
<!--事件分类统计--> <!--事件分类统计-->
<nz-spin> <div class="releative">
<div class="time-div">
<div nz-col nzSpan="6">
<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'">
<nz-date-picker
nzShowTime
[(ngModel)]="startTime"
nzPlaceHolder="开始时间"
></nz-date-picker>
<nz-date-picker
nzShowTime
nzFormat="yyyy-MM-dd HH:mm:ss"
[(ngModel)]="endTime"
nzPlaceHolder="结束时间"
></nz-date-picker>
</div>
</div>
</div>
<nz-spin [nzSpinning]="isLoading">
<div echarts [options]="chartOption" style="height: 400px;width: 100%"></div> <div echarts [options]="chartOption" style="height: 400px;width: 100%"></div>
</nz-spin> </nz-spin>
<nz-table #nzTable [nzData]="eventList"> <nz-table #nzTable [nzData]="eventList">
<thead> <thead>
<tr> <tr>
......
...@@ -11,9 +11,10 @@ import {NzMessageService} from 'ng-zorro-antd'; ...@@ -11,9 +11,10 @@ import {NzMessageService} from 'ng-zorro-antd';
}) })
export class AnalysisEventComponent implements OnInit { export class AnalysisEventComponent implements OnInit {
isLoading = false;
startTime; startTime;
endTime; endTime;
timeType; timeType = "1";
chartOption; chartOption;
eventList; eventList;
...@@ -67,35 +68,27 @@ export class AnalysisEventComponent implements OnInit { ...@@ -67,35 +68,27 @@ export class AnalysisEventComponent implements OnInit {
//时间改变 //时间改变
changeType() { changeType() {
const nowDate = new Date().getTime(); const nowDate = new Date();
let day1, day2; let day1, day2;
switch (this.timeType) { switch (this.timeType) {
case'1': { case'1': { //日报
this.obj.startTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 00:00:00'; this.obj.startTime = this.datePipe.transform(nowDate, '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'2': { case'2': { //周报
day1 = nowDate - 1 * 24 * 60 * 60 * 1000; 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(day1, 'yyyy-MM-dd') + ' 23:59:59'; this.obj.endTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 23:59:59';
break;
}
case'3': {
day1 = nowDate - 3 * 24 * 60 * 60 * 1000;
day2 = nowDate - 1 * 24 * 60 * 60 * 1000;
this.obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endTime = this.datePipe.transform(day2, 'yyyy-MM-dd') + ' 23:59:59';
break; break;
} }
case'4': { case'3': { //月报
day1 = nowDate - 7 * 24 * 60 * 60 * 1000; day1 = new Date(nowDate.getFullYear(),nowDate.getMonth(),1);
day2 = nowDate - 1 * 24 * 60 * 60 * 1000;
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(day2, 'yyyy-MM-dd') + ' 23:59:59'; this.obj.endTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 23:59:59';
break; break;
} }
case'5': { case'4': { //自定义
break; break;
} }
} }
...@@ -103,7 +96,7 @@ export class AnalysisEventComponent implements OnInit { ...@@ -103,7 +96,7 @@ export class AnalysisEventComponent implements OnInit {
//搜索 //搜索
search() { search() {
if (this.timeType == '5') { if (this.timeType == '4') {
this.obj.startTime = this.datePipe.transform(this.startTime, 'yyyy-MM-dd HH:mm:ss'); this.obj.startTime = this.datePipe.transform(this.startTime, 'yyyy-MM-dd HH:mm:ss');
this.obj.endTime = this.datePipe.transform(this.endTime, 'yyyy-MM-dd HH:mm:ss'); this.obj.endTime = this.datePipe.transform(this.endTime, 'yyyy-MM-dd HH:mm:ss');
} }
......
<!--解决状态统计--> <!--解决状态统计-->
<!--处理人统计--> <div class="releative">
<nz-spin> <div class="time-div">
<div nz-col nzSpan="6">
<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'">
<nz-date-picker
nzShowTime
[(ngModel)]="startTime"
nzPlaceHolder="开始时间"
></nz-date-picker>
<nz-date-picker
nzShowTime
nzFormat="yyyy-MM-dd HH:mm:ss"
[(ngModel)]="endTime"
nzPlaceHolder="结束时间"
></nz-date-picker>
</div>
</div>
</div>
<nz-spin [nzSpinning]="isLoading">
<div echarts [options]="chartOption" style="height: 400px;width: 100%"></div> <div echarts [options]="chartOption" style="height: 400px;width: 100%"></div>
</nz-spin> </nz-spin>
......
...@@ -11,9 +11,10 @@ import {NzMessageService} from 'ng-zorro-antd'; ...@@ -11,9 +11,10 @@ import {NzMessageService} from 'ng-zorro-antd';
}) })
export class AnalysisStatusComponent implements OnInit { export class AnalysisStatusComponent implements OnInit {
isLoading = false;
startTime; startTime;
endTime; endTime;
timeType; timeType = "1";
chartOption; chartOption;
statusList; statusList;
...@@ -67,35 +68,27 @@ export class AnalysisStatusComponent implements OnInit { ...@@ -67,35 +68,27 @@ export class AnalysisStatusComponent implements OnInit {
//时间改变 //时间改变
changeType() { changeType() {
const nowDate = new Date().getTime(); const nowDate = new Date();
let day1, day2; let day1, day2;
switch (this.timeType) { switch (this.timeType) {
case'1': { case'1': { //日报
this.obj.startTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 00:00:00'; this.obj.startTime = this.datePipe.transform(nowDate, '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'2': { case'2': { //周报
day1 = nowDate - 1 * 24 * 60 * 60 * 1000; 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(day1, 'yyyy-MM-dd') + ' 23:59:59'; this.obj.endTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 23:59:59';
break;
}
case'3': {
day1 = nowDate - 3 * 24 * 60 * 60 * 1000;
day2 = nowDate - 1 * 24 * 60 * 60 * 1000;
this.obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endTime = this.datePipe.transform(day2, 'yyyy-MM-dd') + ' 23:59:59';
break; break;
} }
case'4': { case'3': { //月报
day1 = nowDate - 7 * 24 * 60 * 60 * 1000; day1 = new Date(nowDate.getFullYear(),nowDate.getMonth(),1);
day2 = nowDate - 1 * 24 * 60 * 60 * 1000;
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(day2, 'yyyy-MM-dd') + ' 23:59:59'; this.obj.endTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 23:59:59';
break; break;
} }
case'5': { case'4': { //自定义
break; break;
} }
} }
...@@ -103,7 +96,7 @@ export class AnalysisStatusComponent implements OnInit { ...@@ -103,7 +96,7 @@ export class AnalysisStatusComponent implements OnInit {
//搜索 //搜索
search() { search() {
if (this.timeType == '5') { if (this.timeType == '4') {
this.obj.startTime = this.datePipe.transform(this.startTime, 'yyyy-MM-dd HH:mm:ss'); this.obj.startTime = this.datePipe.transform(this.startTime, 'yyyy-MM-dd HH:mm:ss');
this.obj.endTime = this.datePipe.transform(this.endTime, 'yyyy-MM-dd HH:mm:ss'); this.obj.endTime = this.datePipe.transform(this.endTime, 'yyyy-MM-dd HH:mm:ss');
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</nz-breadcrumb> </nz-breadcrumb>
</div> </div>
<div nz-col nzSpan="8" class="text-right"> <div nz-col nzSpan="8" class="text-right">
<button nz-button nzType="primary"><i class="anticon anticon-search"></i></button> <button (click)="search()" nz-button nzType="primary"><i class="anticon anticon-search"></i></button>
<button nz-button nzType="primary"><i class="anticon anticon-sync"></i></button> <button nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
<button nz-button nzType="primary"><i class="anticon anticon-arrows-alt"></i></button> <button nz-button nzType="primary"><i class="anticon anticon-arrows-alt"></i></button>
</div> </div>
...@@ -30,15 +30,15 @@ ...@@ -30,15 +30,15 @@
</div> </div>
<!--解决状态--> <!--解决状态-->
<ng-container *ngIf="type == '1'"> <ng-container *ngIf="type == '1'">
<smart-analysis-status></smart-analysis-status> <smart-analysis-status #smartAnalysisstatus></smart-analysis-status>
</ng-container> </ng-container>
<!--事件分类统计--> <!--事件分类统计-->
<ng-container *ngIf="type == '2'"> <ng-container *ngIf="type == '2'">
<smart-analysis-event></smart-analysis-event> <smart-analysis-event #smartAnalysisEvent></smart-analysis-event>
</ng-container> </ng-container>
<!--处理人统计--> <!--处理人统计-->
<ng-container *ngIf="type == '3'"> <ng-container *ngIf="type == '3'">
<smart-analysis-deal></smart-analysis-deal> <smart-analysis-deal #smartAnalysisDeal></smart-analysis-deal>
</ng-container> </ng-container>
import { Component, OnInit } from '@angular/core'; import {Component, OnInit, ViewChild} from '@angular/core';
import {AnalysisStatusComponent} from './analysis-status/analysis-status.component';
import {AnalysisEventComponent} from './analysis-event/analysis-event.component';
import {AnalysisDealComponent} from './analysis-deal/analysis-deal.component';
@Component({ @Component({
selector: 'smart-operation-work', selector: 'smart-operation-work',
templateUrl: './operation-work.component.html', templateUrl: './operation-work.component.html',
styles: [] styles: [
`
.time-div{
position: absolute;
z-index: 9;
left: 35%;
top: 0;
}
`
]
}) })
export class OperationWorkComponent implements OnInit { export class OperationWorkComponent implements OnInit {
@ViewChild('smartAnalysisstatus') smartAnalysisstatus:AnalysisStatusComponent;
@ViewChild('smartAnalysisEvent') smartAnalysisEvent:AnalysisEventComponent;
@ViewChild('smartAnalysisDeal') smartAnalysisDeal:AnalysisDealComponent;
type = "1"; type = "1";
constructor() { } constructor() { }
...@@ -13,4 +28,16 @@ export class OperationWorkComponent implements OnInit { ...@@ -13,4 +28,16 @@ export class OperationWorkComponent implements OnInit {
ngOnInit() { ngOnInit() {
} }
search(){
if(this.type == "1"){
this.smartAnalysisstatus.search();
}
if(this.type == "2"){
this.smartAnalysisEvent.search();
}
if(this.type == "3"){
this.smartAnalysisDeal.search();
}
}
} }
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
</tbody> </tbody>
</nz-table> </nz-table>
<h3 style="margin-top: 20px">统计报告</h3> <h3 style="margin-top: 20px">统计报告</h3>
<nz-table #nzTable1 [nzData]="reportList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageCount" (nzPageIndexChange)="change($event)" [nzLoading]="loading"> <nz-table #nzTable1 [nzData]="reportList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageCount" (nzPageIndexChange)="change($event)">
<thead> <thead>
<tr> <tr>
<th nzWidth="20%">时间</th> <th nzWidth="20%">时间</th>
......
...@@ -208,6 +208,12 @@ export class ResourceAlarmComponent implements OnInit { ...@@ -208,6 +208,12 @@ export class ResourceAlarmComponent implements OnInit {
); );
} }
//翻页
change(e){
this.pageNum = e;
this.getAnalysis();
}
//时间改变 //时间改变
changeType() { changeType() {
const nowDate = new Date().getTime(); const nowDate = new Date().getTime();
......
...@@ -52,12 +52,12 @@ ...@@ -52,12 +52,12 @@
</div> </div>
<div nz-row nzGutter="4"> <div nz-row nzGutter="4">
<div nz-col nzSpan="12"> <div nz-col nzSpan="12">
<nz-spin> <nz-spin [nzSpinning]="isTopLoading">
<div echarts [options]="chartTopOption" style="height: 400px;width: 100%"></div> <div echarts [options]="chartTopOption" style="height: 400px;width: 100%"></div>
</nz-spin> </nz-spin>
</div> </div>
<div nz-col nzSpan="12"> <div nz-col nzSpan="12">
<nz-spin> <nz-spin [nzSpinning]="isLastLoading">
<div echarts [options]="chartLastOption" style="height: 400px;width: 100%"></div> <div echarts [options]="chartLastOption" style="height: 400px;width: 100%"></div>
</nz-spin> </nz-spin>
</div> </div>
......
...@@ -17,9 +17,11 @@ export class ResourceUsabilComponent implements OnInit { ...@@ -17,9 +17,11 @@ export class ResourceUsabilComponent implements OnInit {
chartTopOption; chartTopOption;
topList; topList;
isTopLoading = false;
chartLastOption; chartLastOption;
lastList; lastList;
isLastLoading = false;
obj = { obj = {
type: '', type: '',
...@@ -75,7 +77,7 @@ export class ResourceUsabilComponent implements OnInit { ...@@ -75,7 +77,7 @@ export class ResourceUsabilComponent implements OnInit {
xAxis: { xAxis: {
type: 'category', type: 'category',
data: this.topList.map(e=>{ data: this.topList.map(e=>{
return e.operateStatusName; return e.name;
}) })
}, },
yAxis: { yAxis: {
...@@ -83,7 +85,7 @@ export class ResourceUsabilComponent implements OnInit { ...@@ -83,7 +85,7 @@ export class ResourceUsabilComponent implements OnInit {
}, },
series: [{ series: [{
data: this.topList.map(e=>{ data: this.topList.map(e=>{
return e.num; return e.value;
}), }),
type: 'bar' type: 'bar'
}] }]
...@@ -109,7 +111,7 @@ export class ResourceUsabilComponent implements OnInit { ...@@ -109,7 +111,7 @@ export class ResourceUsabilComponent implements OnInit {
xAxis: { xAxis: {
type: 'category', type: 'category',
data: this.lastList.map(e=>{ data: this.lastList.map(e=>{
return e.operateStatusName; return e.name;
}) })
}, },
yAxis: { yAxis: {
...@@ -117,7 +119,7 @@ export class ResourceUsabilComponent implements OnInit { ...@@ -117,7 +119,7 @@ export class ResourceUsabilComponent implements OnInit {
}, },
series: [{ series: [{
data: this.lastList.map(e=>{ data: this.lastList.map(e=>{
return e.num; return e.value;
}), }),
type: 'bar' type: 'bar'
}] }]
......
...@@ -19,22 +19,23 @@ ...@@ -19,22 +19,23 @@
</div> </div>
</div> </div>
<div nz-row [nzGutter]="4" class="search-form"> <div nz-row [nzGutter]="4" class="search-form">
<div nz-col nzSpan="5"> <div nz-col nzSpan="4">
<nz-select style="width: 100%;" [(ngModel)]="obj.type" nzPlaceHolder="选择分类" (ngModelChange)="changeType()"> <nz-select style="width: 100%;" [(ngModel)]="obj.type" nzPlaceHolder="选择分类" (ngModelChange)="changeType()">
<ng-container *ngFor="let item of parentList"> <ng-container *ngFor="let item of parentList">
<nz-option [nzLabel]="item.name" [nzValue]="item.id"></nz-option> <nz-option [nzLabel]="item.name" [nzValue]="item.id"></nz-option>
</ng-container> </ng-container>
</nz-select> </nz-select>
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="3" class="text-center">
<button (click)="showUploadModal()" nz-button nzType="default"><i class="anticon anticon-upload"></i>导入资产</button> <button (click)="showUploadModal()" nz-button nzType="default"><i class="anticon anticon-upload"></i>导入资产</button>
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="3" class="text-center">
<button nz-button nzType="default"><i class="anticon anticon-download"></i>下载</button> <button nz-button nzType="default"><i class="anticon anticon-download"></i>下载模版</button>
</div> </div>
<div nz-col nzSpan="6"> <div nz-col nzSpan="8"></div>
<div nz-col nzSpan="6" class="text-right">
<button (click)="showAddModal()" nz-button nzType="default"><i class="anticon anticon-plus"></i>添加</button> <button (click)="showAddModal()" nz-button nzType="default"><i class="anticon anticon-plus"></i>添加</button>
<button (click)="showPEditModal()" nz-button nzType="default"><i class="anticon anticon-edit"></i>编辑</button> <button (click)="showPEditModal()" nz-button nzType="default"><i class="anticon anticon-form"></i>编辑</button>
<button (click)="deleteParentType()" nz-button nzType="default"><i class="anticon anticon-close-circle-o"></i>删除</button> <button (click)="deleteParentType()" nz-button nzType="default"><i class="anticon anticon-close-circle-o"></i>删除</button>
</div> </div>
</div> </div>
...@@ -55,7 +56,7 @@ ...@@ -55,7 +56,7 @@
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let data of childrenList"> <tr *ngFor="let data of childrenList">
<td class="round-tag tag-form"> <td class="round-tag tag-form main-font-color">
<span (click)="showCEditModal(data.id)">{{data.name}}</span> <span (click)="showCEditModal(data.id)">{{data.name}}</span>
</td> </td>
<td> <td>
...@@ -75,7 +76,7 @@ ...@@ -75,7 +76,7 @@
<td>关联事件</td> <td>关联事件</td>
<td class="handle text-center"> <td class="handle text-center">
<span (click)="goToChild(data)">明细</span> <span (click)="goToChild(data)">明细</span>
<span (click)="showEditModal(data)">编辑</span> <span (click)="showCEditModal(data)">编辑</span>
<span (click)="deleteChildType(data)">删除</span> <span (click)="deleteChildType(data)">删除</span>
</td> </td>
</tr> </tr>
......
...@@ -13,20 +13,23 @@ ...@@ -13,20 +13,23 @@
</nz-breadcrumb> </nz-breadcrumb>
</div> </div>
<div nz-col nzSpan="8" class="text-right"> <div nz-col nzSpan="8" class="text-right">
<button nz-button nzType="primary"><i class="anticon anticon-search"></i></button> <button (click)="getList()" nz-button nzType="primary"><i class="anticon anticon-search"></i></button>
<button nz-button nzType="primary"><i class="anticon anticon-sync"></i></button> <button nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
<button nz-button nzType="primary"><i class="anticon anticon-arrows-alt"></i></button> <button nz-button nzType="primary"><i class="anticon anticon-arrows-alt"></i></button>
</div> </div>
</div> </div>
<div nz-row [nzGutter]="4" class="search-form"> <div nz-row [nzGutter]="4" class="search-form">
<div nz-col nzSpan="3"> <div nz-col nzSpan="3">
<button (click)="addPlan()" nz-button nzType="default"><i class="anticon anticon-plus"></i>新增计划</button>
</div>
<div nz-col nzSpan="4">
<nz-select style="width: 100%;" [(ngModel)]="obj.status" nzPlaceHolder="计划状态"> <nz-select style="width: 100%;" [(ngModel)]="obj.status" nzPlaceHolder="计划状态">
<nz-option nzLabel="未开始" nzValue="0"></nz-option> <nz-option nzLabel="未开始" nzValue="0"></nz-option>
<nz-option nzLabel="进行中" nzValue="1"></nz-option> <nz-option nzLabel="进行中" nzValue="1"></nz-option>
<nz-option nzLabel="结束" nzValue="2"></nz-option> <nz-option nzLabel="结束" nzValue="2"></nz-option>
</nz-select> </nz-select>
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="4">
<nz-select style="width: 100%;" [(ngModel)]="obj.typeId" nzPlaceHolder="计划类型"> <nz-select style="width: 100%;" [(ngModel)]="obj.typeId" nzPlaceHolder="计划类型">
<ng-container *ngFor="let item of planTypeList"> <ng-container *ngFor="let item of planTypeList">
<nz-option [nzValue]="item.id" [nzLabel]="item.name"></nz-option> <nz-option [nzValue]="item.id" [nzLabel]="item.name"></nz-option>
...@@ -34,13 +37,10 @@ ...@@ -34,13 +37,10 @@
</nz-select> </nz-select>
</div> </div>
<div nz-col nzSpan="8"> <div nz-col nzSpan="8">
<nz-input-group nzPrefixIcon="anticon anticon-search"> <nz-input-group>
<input type="text" nz-input [(ngModel)]="obj.searchStr" placeholder="输入资源名称"> <input type="text" nz-input [(ngModel)]="obj.searchStr" placeholder="计划名称/负责人">
</nz-input-group> </nz-input-group>
</div> </div>
<div nz-col nzSpan="3">
<button (click)="addPlan()" nz-button nzType="default"><i class="anticon anticon-plus"></i>新增计划</button>
</div>
</div> </div>
<nz-table #nzTable [nzData]="planList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageCount" (nzPageIndexChange)="change($event)"> <nz-table #nzTable [nzData]="planList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageCount" (nzPageIndexChange)="change($event)">
......
...@@ -42,9 +42,9 @@ export class EventComponent implements OnInit { ...@@ -42,9 +42,9 @@ export class EventComponent implements OnInit {
); );
} }
getPlanType() { getEventType() {
const data = { const data = {
type: 1 type: 0
}; };
this.workSer.findByType(data).subscribe( this.workSer.findByType(data).subscribe(
(res) => { (res) => {
...@@ -68,14 +68,14 @@ export class EventComponent implements OnInit { ...@@ -68,14 +68,14 @@ export class EventComponent implements OnInit {
showAddModal(title) { showAddModal(title) {
this.isVisiable = true; this.isVisiable = true;
this.title = title; this.title = title;
this.getPlanType(); this.getEventType();
} }
showEditModal(title, id) { showEditModal(title, id) {
this.isVisiable = true; this.isVisiable = true;
this.title = title; this.title = title;
this.eventId = id; this.eventId = id;
this.getPlanType(); this.getEventType();
this.workSer.findByNo(this.eventId).subscribe( this.workSer.findByNo(this.eventId).subscribe(
(res)=>{ (res)=>{
this.validateForm.patchValue(res.data); this.validateForm.patchValue(res.data);
......
...@@ -13,16 +13,20 @@ ...@@ -13,16 +13,20 @@
</nz-breadcrumb> </nz-breadcrumb>
</div> </div>
<div nz-col nzSpan="8" class="text-right"> <div nz-col nzSpan="8" class="text-right">
<button nz-button nzType="primary"><i class="anticon anticon-search"></i></button> <button (click)="search()" nz-button nzType="primary"><i class="anticon anticon-search"></i></button>
<button nz-button nzType="primary"><i class="anticon anticon-sync"></i></button> <button nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
<button nz-button nzType="primary"><i class="anticon anticon-arrows-alt"></i></button> <button nz-button nzType="primary"><i class="anticon anticon-arrows-alt"></i></button>
</div> </div>
</div> </div>
<div nz-row [nzGutter]="4" class="search-form"> <div nz-row [nzGutter]="4" class="search-form">
<div nz-col nzSpan="3"> <div nz-col nzSpan="3">
<button (click)="showAddModal()" nz-button nzType="default"><i class="anticon anticon-plus"></i>新增事件</button>
</div>
<div nz-col nzSpan="3">
<nz-select style="width: 100%;" [(ngModel)]="obj.type" nzPlaceHolder="事件分类"> <nz-select style="width: 100%;" [(ngModel)]="obj.type" nzPlaceHolder="事件分类">
<nz-option nzLabel="告警" nzValue="告警"></nz-option> <ng-container *ngFor="let item of eventTypeList">
<nz-option nzLabel="严重" nzValue="严重"></nz-option> <nz-option [nzLabel]="item.name" [nzValue]="item.id"></nz-option>
</ng-container>
</nz-select> </nz-select>
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="3">
...@@ -41,16 +45,16 @@ ...@@ -41,16 +45,16 @@
<nz-date-picker <nz-date-picker
nzShowTime nzShowTime
[nzFormat]="timeFormat" [nzFormat]="timeFormat"
[(ngModel)]="timeBegin" [(ngModel)]="startTime"
nzPlaceHolder="开始时间"></nz-date-picker> nzPlaceHolder="开始时间"></nz-date-picker>
<nz-date-picker <nz-date-picker
nzShowTime nzShowTime
[nzFormat]="timeFormat" [nzFormat]="timeFormat"
[(ngModel)]="timeEnd" [(ngModel)]="endTime"
nzPlaceHolder="结束时间"></nz-date-picker> nzPlaceHolder="结束时间"></nz-date-picker>
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="4">
<button (click)="showAddModal()" nz-button nzType="default"><i class="anticon anticon-plus"></i>新增事件</button> <input type="text" nz-input [(ngModel)]="obj.searchStr" placeholder="事件编号/处理人">
</div> </div>
</div> </div>
...@@ -89,7 +93,6 @@ ...@@ -89,7 +93,6 @@
</td> </td>
<td class="handle text-center"> <td class="handle text-center">
<span *ngIf="data.status == 1" (click)="lookEvent(data)">查看</span> <span *ngIf="data.status == 1" (click)="lookEvent(data)">查看</span>
<!--<span (click)="showEditModal(data)">编辑</span>-->
<span *ngIf="data.status == 0" (click)="goToHandle(data)">处理</span> <span *ngIf="data.status == 0" (click)="goToHandle(data)">处理</span>
<span *ngIf="data.status == 0" (click)="showTransforModal(data)">转派</span> <span *ngIf="data.status == 0" (click)="showTransforModal(data)">转派</span>
<span (click)="deleteHandle(data)">删除</span> <span (click)="deleteHandle(data)">删除</span>
......
...@@ -7,6 +7,7 @@ import {EventComponent} from './Event/event.component'; ...@@ -7,6 +7,7 @@ import {EventComponent} from './Event/event.component';
import {CommonService} from '../../shared/common/common.service'; import {CommonService} from '../../shared/common/common.service';
import {SelectPersonComponent} from '../../modal/select-person/select-person.component'; import {SelectPersonComponent} from '../../modal/select-person/select-person.component';
import {TransforComponent} from '../modal/transfor/transfor.component'; import {TransforComponent} from '../modal/transfor/transfor.component';
import {DatePipe} from '@angular/common';
@Component({ @Component({
selector: 'smart-work-handle', selector: 'smart-work-handle',
...@@ -19,9 +20,11 @@ export class WorkHandleComponent implements OnInit { ...@@ -19,9 +20,11 @@ export class WorkHandleComponent implements OnInit {
@ViewChild('smartSelectPerson') smartSelectPerson:SelectPersonComponent; @ViewChild('smartSelectPerson') smartSelectPerson:SelectPersonComponent;
timeFormat = 'yyyy-MM-dd'; timeFormat = 'yyyy-MM-dd';
timeType = "1";
eventList; eventList;
timeBegin; eventTypeList;
timeEnd; startTime;
endTime;
pageCount = pageSize; pageCount = pageSize;
pageNum = 1; pageNum = 1;
totalNum; totalNum;
...@@ -38,13 +41,27 @@ export class WorkHandleComponent implements OnInit { ...@@ -38,13 +41,27 @@ export class WorkHandleComponent implements OnInit {
}; };
constructor(private workSer: WorkService, private message: NzMessageService, constructor(private workSer: WorkService, private message: NzMessageService,
private router: Router, private commonSer: CommonService) { private router: Router, private commonSer: CommonService,private datePipe:DatePipe) {
} }
ngOnInit() { ngOnInit() {
this.getList(); this.getList();
this.getEventType();
} }
//获取事件分类
getEventType(){
const data = {
type:0
};
this.workSer.findParamsByType(data).subscribe(
(res)=>{
this.eventTypeList = res.data;
}
);
}
//获取列表
getList() { getList() {
const obj = { const obj = {
pageCount: this.pageCount, pageCount: this.pageCount,
...@@ -61,13 +78,12 @@ export class WorkHandleComponent implements OnInit { ...@@ -61,13 +78,12 @@ export class WorkHandleComponent implements OnInit {
if (res.errCode == 10000) { if (res.errCode == 10000) {
this.eventList = res.data.data; this.eventList = res.data.data;
this.totalNum = res.data.totalNum; this.totalNum = res.data.totalNum;
} else {
} }
} }
); );
} }
//翻页
change(e) { change(e) {
this.pageNum = e; this.pageNum = e;
this.getList(); this.getList();
...@@ -125,4 +141,49 @@ export class WorkHandleComponent implements OnInit { ...@@ -125,4 +141,49 @@ export class WorkHandleComponent implements OnInit {
showTransforModal(item){ showTransforModal(item){
this.smartTransfor.showTransforModal("事件转派",item.id); this.smartTransfor.showTransforModal("事件转派",item.id);
} }
//时间改变
changeType() {
const nowDate = new Date().getTime();
let day1, day2;
switch (this.timeType) {
case'1': {
this.obj.startTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endTime = this.datePipe.transform(nowDate, 'yyyy-MM-dd') + ' 23:59:59';
break;
}
case'2': {
day1 = nowDate - 1 * 24 * 60 * 60 * 1000;
this.obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 23:59:59';
break;
}
case'3': {
day1 = nowDate - 3 * 24 * 60 * 60 * 1000;
day2 = nowDate - 1 * 24 * 60 * 60 * 1000;
this.obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endTime = this.datePipe.transform(day2, 'yyyy-MM-dd') + ' 23:59:59';
break;
}
case'4': {
day1 = nowDate - 7 * 24 * 60 * 60 * 1000;
day2 = nowDate - 1 * 24 * 60 * 60 * 1000;
this.obj.startTime = this.datePipe.transform(day1, 'yyyy-MM-dd') + ' 00:00:00';
this.obj.endTime = this.datePipe.transform(day2, 'yyyy-MM-dd') + ' 23:59:59';
break;
}
case'5': {
break;
}
}
}
//搜索
search() {
if (this.timeType == '5') {
this.obj.startTime = this.datePipe.transform(this.startTime, 'yyyy-MM-dd HH:mm:ss');
this.obj.endTime = this.datePipe.transform(this.endTime, 'yyyy-MM-dd HH:mm:ss');
}
this.getList();
}
} }
...@@ -29,6 +29,9 @@ Browser Upgrade Prompt ...@@ -29,6 +29,9 @@ Browser Upgrade Prompt
color: #000; color: #000;
padding: 0.2em 0; padding: 0.2em 0;
} }
.ant-modal-body{
padding-top: 15px;
}
/* ========================================================================== /* ==========================================================================
Generic styles Generic styles
...@@ -308,3 +311,11 @@ ui bootstrap tweaks ...@@ -308,3 +311,11 @@ ui bootstrap tweaks
overflow: auto; overflow: auto;
margin-top: 10px; margin-top: 10px;
} }
.time-div{
position: absolute;
z-index: 9;
left: 35%;
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