/**
|
* 角色管理的单例
|
*/
|
var SysOperationLog = {
|
id: "SysOperationLogTable", //表格id
|
seItem: null, //选中的条目
|
table: null,
|
layerIndex: -1
|
};
|
|
/**
|
* 初始化表格的列
|
*/
|
SysOperationLog.initColumn = function () {
|
var columns = [
|
{field: 'select_item', radio: true},
|
{title: 'ID', field: 'id', align: 'center', valign: 'middle'},
|
{title: '类型', field: 'menu', align: 'center', valign: 'middle'},
|
{title: '配置人', field: 'name', align: 'center', valign: 'middle'},
|
{title: '配置时间', field: 'createTime', align: 'center', valign: 'middle'},
|
{title: '操作类型', field: 'operationType', align: 'center', valign: 'middle'},
|
{title: '操作内容', field: 'content', align: 'center', valign: 'middle',
|
formatter: function (value) {
|
return '<span title="' + value + '">' + value + '</span>'
|
}
|
}
|
]
|
return columns;
|
};
|
|
|
/**
|
* 检查是否选中
|
*/
|
SysOperationLog.check = function () {
|
var selected = $('#' + this.id).bootstrapTable('getSelections');
|
if (selected.length == 0) {
|
Feng.info("请先选中表格中的某一记录!");
|
return false;
|
} else {
|
SysOperationLog.seItem = selected[0];
|
return true;
|
}
|
};
|
|
|
|
/**
|
* 导出
|
*/
|
SysOperationLog.exportSysOperationLog = function () {
|
let uri = Feng.ctxPath + "/sysOperationLog/exportSysOperationLog?";
|
const menu = $("#menu").val();
|
const user = $("#user").val();
|
const createTime = $("#createTime").val();
|
if(null != menu && '' != menu){
|
uri += "menu=" + menu + "&";
|
}
|
if(null != user && '' != user){
|
uri += "user=" + user + "&";
|
}
|
if(null != createTime && '' != createTime){
|
uri += "createTime=" + createTime + "&";
|
}
|
window.location.href = uri;
|
};
|
|
/**
|
* 删除
|
*/
|
SysOperationLog.delSysOperationLog = function () {
|
if (this.check()) {
|
var operation = function () {
|
var ajax = new $ax(Feng.ctxPath + "/sysOperationLog/delSysOperationLog", function (data) {
|
if(data.code == 200 ){
|
Feng.success("删除成功!");
|
SysOperationLog.table.refresh();
|
}else{
|
Feng.error(data.msg);
|
}
|
}, function (data) {
|
Feng.error("删除失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set("id", SysOperationLog.seItem.id);
|
ajax.start();
|
};
|
|
Feng.confirm("是否刪除该日志?", operation);
|
}
|
};
|
|
|
/**
|
* 搜索
|
*/
|
SysOperationLog.search = function () {
|
var queryData = {};
|
queryData['menu'] = $("#menu").val();
|
queryData['user'] = $("#user").val();
|
queryData['createTime'] = $("#createTime").val();
|
SysOperationLog.table.setQueryParams({})
|
SysOperationLog.table.refresh({query: queryData});
|
}
|
|
/**
|
* 重置
|
*/
|
SysOperationLog.resetSearch = function(){
|
var queryData = {};
|
$("#menu").val('');
|
$("#user").val('');
|
$("#createTime").val('');
|
SysOperationLog.table.setQueryParams({})
|
SysOperationLog.table.refresh({query: queryData});
|
}
|
|
|
$(function () {
|
var defaultColunms = SysOperationLog.initColumn();
|
var table = new BSTable(SysOperationLog.id, "/sysOperationLog/querySysOperationLog", defaultColunms);
|
table.setPaginationType("server");
|
SysOperationLog.table = table.init();
|
|
});
|