Commit 8a96f318 by fengshuonan

完善业务日志

parent 2016d082
@layout("/common/_container.html"){ @layout("/common/_container.html",{plugins:["table","layer","sweet-alert","laydate"],js:["/assets/modular/system/log/log.js"]}){
<div class="row"> <div class="row" id="logPage">
<div class="col-sm-12"> <div class="col-lg-12">
<div class="ibox float-e-margins"> <div class="card card-outline-theme m-b-10">
<div class="ibox-title"> <div class="card-body">
<h5>业务日志</h5> <div class="form-horizontal">
</div> <div class="form-body">
<div class="ibox-content">
<div class="row row-lg">
<div class="col-sm-12">
<div class="row"> <div class="row">
<div class="col-sm-2"> <div class="col-md-3">
<#TimeCon id="beginTime" name="开始时间" isTime="false" pattern="YYYY-MM-DD" /> <div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text">开始时间</div>
</div>
<input type="text" id="beginTime" class="form-control" placeholder="开始时间" autocomplete="off">
</div>
</div> </div>
<div class="col-sm-2"> <div class="col-md-3">
<#TimeCon id="endTime" name="结束时间" isTime="false" pattern="YYYY-MM-DD" /> <div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text">结束时间</div>
</div>
<input type="text" id="endTime" class="form-control" placeholder="结束时间" autocomplete="off">
</div>
</div> </div>
<div class="col-sm-2"> <div class="col-md-3">
<#NameCon id="logName" name="日志名称" /> <div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text">日志名称</div>
</div>
<input v-model="logName" type="text" class="form-control" placeholder="日志名称" autocomplete="off">
</div>
</div> </div>
<div class="col-sm-2"> <div class="col-md-3">
<#SelectCon id="logType" name="日志类型" > <div class="input-group">
<option value="0">全部</option> <div class="input-group-prepend">
<option value="1">业务日志</option> <div class="input-group-text">日志类型</div>
<option value="2">异常日志</option> </div>
</#SelectCon> <select id="logType" class="form-control">
<option value="0">全部</option>
<option value="1">业务日志</option>
<option value="2">异常日志</option>
</select>
</div>
</div> </div>
<div class="col-sm-2"> <div class="col-md-3 m-t-10">
<#button name="搜索" icon="fa-search" clickFun="OptLog.search()"/> <div class="input-group condition-button">
<div class="input-group-btn condition-button">
<button type="button" id="check-minutes"
class="btn btn-info waves-effect waves-light condition-button-width"
onclick="OptLog.search()">查询
</button>
</div>
</div>
</div> </div>
</div> </div>
<div class="hidden-xs" id="OptLogTableToolbar" role="group"> </div>
<#button name="查看详情" icon="fa-plus" clickFun="OptLog.detail()"/> </div>
@if(shiro.hasPermission("/log/delLog")){ </div>
<#button name="清空日志" icon="fa-plus" clickFun="OptLog.delLog()" space="true"/> </div>
@} </div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="card card-outline-theme m-b-0">
<div class="card-body p-t-0 p-b-0">
<div class="form-horizontal">
<div class="form-actions">
<div class="row">
<div class="col-lg-12">
<div class="card m-b-0 p-b-0">
<div class="hidden-xs" id="OptLogTableToolbar" role="group">
<button type="button" class="btn btn-primary waves-effect" onclick="OptLog.detail()">
<i class="fa fa-plus"></i>&nbsp;查看详情
</button>
@if(shiro.hasPermission("/log/delLog")){
<button type="button" class="btn btn-primary waves-effect" onclick="OptLog.delLog()">
<i class="fa fa-plus"></i>&nbsp;清空日志
</button>
@}
</div>
<#table id="OptLogTable"/>
</div>
</div>
</div> </div>
<#table id="OptLogTable"/>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<script src="${ctxPath}/static/modular/system/log/log.js"></script>
@} @}
/** /**
* 日志管理初始化 * 业务日志
*/ */
var OptLog = { var OptLog = {
id: "OptLogTable", //表格id id: "OptLogTable", //表格id
seItem: null, //选中的条目 seItem: null, //选中的条目
table: null, table: null,
layerIndex: -1 layerIndex: -1,
condition: {
logName: ""
}
}; };
/** /**
...@@ -14,14 +17,13 @@ var OptLog = { ...@@ -14,14 +17,13 @@ var OptLog = {
OptLog.initColumn = function () { OptLog.initColumn = function () {
return [ return [
{field: 'selectItem', radio: true}, {field: 'selectItem', radio: true},
{title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, {title: 'id', field: 'operationLogId', visible: false, align: 'center', valign: 'middle'},
{title: '日志类型', field: 'logtype', align: 'center', valign: 'middle', sortable: true}, {title: '日志类型', field: 'logType', align: 'center', valign: 'middle', sortable: true},
{title: '日志名称', field: 'logname', align: 'center', valign: 'middle', sortable: true}, {title: '日志名称', field: 'logName', align: 'center', valign: 'middle', sortable: true},
// {title: '用户名称', field: 'userName', align: 'center', valign: 'middle', sortable: true, sortName: 'userid'},
{title: '用户名称', field: 'userName', align: 'center', valign: 'middle'}, {title: '用户名称', field: 'userName', align: 'center', valign: 'middle'},
{title: '类名', field: 'classname', align: 'center', valign: 'middle', sortable: true}, {title: '类名', field: 'className', align: 'center', valign: 'middle', sortable: true},
{title: '方法名', field: 'method', align: 'center', valign: 'middle', sortable: true}, {title: '方法名', field: 'method', align: 'center', valign: 'middle', sortable: true},
{title: '时间', field: 'createtime', align: 'center', valign: 'middle', sortable: true}, {title: '时间', field: 'createTime', align: 'center', valign: 'middle', sortable: true},
{title: '具体消息', field: 'message', align: 'center', valign: 'middle', sortable: true}]; {title: '具体消息', field: 'message', align: 'center', valign: 'middle', sortable: true}];
}; };
...@@ -30,7 +32,7 @@ OptLog.initColumn = function () { ...@@ -30,7 +32,7 @@ OptLog.initColumn = function () {
*/ */
OptLog.check = function () { OptLog.check = function () {
var selected = $('#' + this.id).bootstrapTable('getSelections'); var selected = $('#' + this.id).bootstrapTable('getSelections');
if(selected.length == 0){ if(selected.length === 0){
Feng.info("请先选中表格中的某一记录!"); Feng.info("请先选中表格中的某一记录!");
return false; return false;
}else{ }else{
...@@ -44,7 +46,7 @@ OptLog.check = function () { ...@@ -44,7 +46,7 @@ OptLog.check = function () {
*/ */
OptLog.detail = function () { OptLog.detail = function () {
if (this.check()) { if (this.check()) {
var ajax = new $ax(Feng.ctxPath + "/log/detail/" + this.seItem.id, function (data) { var ajax = new $ax(Feng.ctxPath + "/log/detail/" + this.seItem.operationLogId, function (data) {
Feng.infoDetail("日志详情", data.regularMessage); Feng.infoDetail("日志详情", data.regularMessage);
}, function (data) { }, function (data) {
Feng.error("获取详情失败!"); Feng.error("获取详情失败!");
...@@ -63,7 +65,7 @@ OptLog.delLog = function () { ...@@ -63,7 +65,7 @@ OptLog.delLog = function () {
ajax.start(); ajax.start();
OptLog.table.refresh(); OptLog.table.refresh();
}); });
} };
/** /**
* 查询表单提交参数对象 * 查询表单提交参数对象
...@@ -72,26 +74,43 @@ OptLog.delLog = function () { ...@@ -72,26 +74,43 @@ OptLog.delLog = function () {
OptLog.formParams = function() { OptLog.formParams = function() {
var queryData = {}; var queryData = {};
queryData['logName'] = $("#logName").val(); queryData['logName'] = OptLog.condition.logName;
queryData['beginTime'] = $("#beginTime").val(); queryData['beginTime'] = $("#beginTime").val();
queryData['endTime'] = $("#endTime").val(); queryData['endTime'] = $("#endTime").val();
queryData['logType'] = $("#logType").val(); queryData['logType'] = $("#logType").val();
return queryData; return queryData;
} };
/** /**
* 查询日志列表 * 查询日志列表
*/ */
OptLog.search = function () { OptLog.search = function () {
OptLog.table.refresh({query: OptLog.formParams()}); OptLog.table.refresh({query: OptLog.formParams()});
}; };
$(function () { $(function () {
OptLog.app = new Vue({
el: '#logPage',
data: OptLog.condition
});
var defaultColunms = OptLog.initColumn(); var defaultColunms = OptLog.initColumn();
var table = new BSTable(OptLog.id, "/log/list", defaultColunms); var table = new BSTable(OptLog.id, "/log/list", defaultColunms);
table.setPaginationType("server"); table.setPaginationType("server");
table.setQueryParams(OptLog.formParams()); table.init();
OptLog.table = table.init(); OptLog.table = table;
laydate.render({
elem: '#beginTime',
theme: '#009efb',
max: Feng.currentDate()
});
laydate.render({
elem: '#endTime',
theme: '#009efb',
max: Feng.currentDate()
});
}); });
/** /**
* 角色管理的单例 * 登陆日志
*/ */
var LoginLog = { var LoginLog = {
id: "loginLogTable", //表格id id: "loginLogTable", //表格id
......
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