2018-10-29 16:27:34 +08:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
2018-12-13 17:56:42 +08:00
|
|
|
import { HttpClientService } from '../../../services/http-client.service';
|
|
|
|
|
import { Router } from '@angular/router';
|
|
|
|
|
import { NzMessageService } from 'ng-zorro-antd';
|
|
|
|
|
|
2018-10-29 16:27:34 +08:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-operation-logs',
|
|
|
|
|
templateUrl: './operation-logs.component.html',
|
|
|
|
|
styleUrls: ['./operation-logs.component.scss']
|
|
|
|
|
})
|
|
|
|
|
export class OperationLogsComponent implements OnInit {
|
2018-12-13 17:56:42 +08:00
|
|
|
collectionSize:any ;
|
|
|
|
|
public tableData:any=[];
|
|
|
|
|
statusParamsTable:any={ //获取用户列表接口的状态,0请求失败 1请求前 2请求中 3请求成功,有数据 4请求成功,无数据
|
|
|
|
|
status:1,
|
|
|
|
|
}
|
|
|
|
|
public search:any={
|
|
|
|
|
page_index:'1',
|
|
|
|
|
page_size:'10',
|
|
|
|
|
date_start:'',
|
|
|
|
|
date_end:'',
|
|
|
|
|
keyword:'',
|
|
|
|
|
orgId:'',
|
|
|
|
|
}
|
|
|
|
|
logType:any={
|
|
|
|
|
'LOGIN':'登录',
|
|
|
|
|
'LOGOUT':'退出',
|
|
|
|
|
'USER_UI_SET':'修改用户设置',
|
|
|
|
|
'USER_INFO_OPT':'增删改用户信息',
|
|
|
|
|
};
|
|
|
|
|
optType:any={
|
|
|
|
|
'ADD':'新增',
|
|
|
|
|
'UPDATE':'修改',
|
|
|
|
|
'DELETE':'删除',
|
|
|
|
|
};
|
2018-12-14 17:57:01 +08:00
|
|
|
dateRange = [];
|
2018-12-13 17:56:42 +08:00
|
|
|
constructor(
|
|
|
|
|
private http:HttpClientService,
|
|
|
|
|
private router:Router,
|
|
|
|
|
private message: NzMessageService,
|
|
|
|
|
) { }
|
2018-10-29 16:27:34 +08:00
|
|
|
|
2018-12-13 17:56:42 +08:00
|
|
|
ngOnInit() {
|
|
|
|
|
// 页面监听 动态改变表单高度
|
|
|
|
|
$('#main-box').css('height',(document.documentElement.clientHeight-106+'px'));
|
|
|
|
|
$(window).resize(function(){
|
|
|
|
|
$('#main-box').css('height',(document.documentElement.clientHeight-106+'px'));
|
|
|
|
|
})
|
|
|
|
|
this.queryTable();
|
|
|
|
|
}
|
2018-12-14 17:57:01 +08:00
|
|
|
onChange(result: Date): void {
|
|
|
|
|
this.search.date_start=new Date(result[0]).getTime();
|
|
|
|
|
this.search.date_end=new Date(result[1]).getTime();
|
|
|
|
|
}
|
2018-12-13 17:56:42 +08:00
|
|
|
//重置,重置搜索条件
|
|
|
|
|
reset(){
|
|
|
|
|
this.search.page_index=1;
|
|
|
|
|
this.search.page_size=10;
|
|
|
|
|
this.search.keyword='';
|
2018-12-14 17:57:01 +08:00
|
|
|
this.search.date_start='';
|
|
|
|
|
this.search.date_end='';
|
2018-12-13 17:56:42 +08:00
|
|
|
this.queryTable();
|
|
|
|
|
}
|
|
|
|
|
//获取列表
|
|
|
|
|
queryTable():void{
|
|
|
|
|
this.statusParamsTable.status=1;
|
2018-12-14 17:57:01 +08:00
|
|
|
this.tableData=[];
|
2018-12-13 17:56:42 +08:00
|
|
|
this.http.get('/sysapi/oplog/list',this.search).subscribe((json)=>{
|
|
|
|
|
if(json.is_success){
|
|
|
|
|
this.tableData=json.body.recordList;
|
|
|
|
|
this.collectionSize=json.body.recordCount;
|
|
|
|
|
if(json.body.recordList&&json.body.recordList.length>0){
|
|
|
|
|
this.statusParamsTable.status=3;
|
|
|
|
|
}else{
|
|
|
|
|
this.statusParamsTable.status=4;
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
this.statusParamsTable.status=0;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
//翻页
|
|
|
|
|
pageChange(event){
|
|
|
|
|
this.search.page_index=event;
|
|
|
|
|
this.queryTable();
|
|
|
|
|
}
|
2018-10-29 16:27:34 +08:00
|
|
|
|
|
|
|
|
}
|