From 306724a394e73ccb839979659d61cbcf3e47c9e8 Mon Sep 17 00:00:00 2001 From: TSQ <1970742763@qq.com> Date: Sat, 9 Jan 2021 17:11:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=97=A5=E5=BF=97=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../guns/modular/log/LogViewController.java | 2 +- .../webapp/assets/modular/system/log/log.js | 133 +++++++++--------- .../webapp/pages/modular/system/log/log.html | 9 +- 3 files changed, 74 insertions(+), 70 deletions(-) diff --git a/src/main/java/cn/stylefeng/guns/modular/log/LogViewController.java b/src/main/java/cn/stylefeng/guns/modular/log/LogViewController.java index 942e61bf..344e8c68 100644 --- a/src/main/java/cn/stylefeng/guns/modular/log/LogViewController.java +++ b/src/main/java/cn/stylefeng/guns/modular/log/LogViewController.java @@ -15,7 +15,7 @@ import org.springframework.stereotype.Controller; */ @Controller @Slf4j -@ApiResource(name = "操作日志管理相关的界面渲染", path = "log") +@ApiResource(name = "操作日志管理相关的界面渲染", path = "/view/log") public class LogViewController { private String PREFIX = "/modular/system/log"; diff --git a/src/main/webapp/assets/modular/system/log/log.js b/src/main/webapp/assets/modular/system/log/log.js index 41166e62..9de2c030 100644 --- a/src/main/webapp/assets/modular/system/log/log.js +++ b/src/main/webapp/assets/modular/system/log/log.js @@ -1,31 +1,32 @@ -layui.use(['layer', 'table', 'ax', 'laydate'], function () { +layui.use(['HttpRequest', 'treeTable', 'laydate', 'func' ,'form'], function () { var $ = layui.$; - var $ax = layui.ax; - var layer = layui.layer; var table = layui.table; + var HttpRequest = layui.HttpRequest; + var func = layui.func; + var form = layui.form; var laydate = layui.laydate; /** * 系统管理--操作日志 */ - var LoginLog = { + var Log = { tableId: "logTable" //表格id }; /** * 初始化表格的列 */ - LoginLog.initColumn = function () { + Log.initColumn = function () { return [[ {type: 'checkbox'}, - {field: 'operationLogId', hide: true, sort: true, title: 'id'}, - {field: 'logType', align: "center", sort: true, title: '日志类型'}, + {field: 'logId', hide: true, sort: true, title: 'id'}, + /*{field: 'logType', align: "center", sort: true, title: '日志类型'},*/ {field: 'logName', align: "center", sort: true, title: '日志名称'}, - {field: 'userName', align: "center", sort: true, title: '用户名称'}, - {field: 'className', align: "center", sort: true, title: '类名'}, - {field: 'method', align: "center", sort: true, title: '方法名'}, + {field: 'createUser', align: "center", sort: true, title: '用户名称'}, + {field: 'appName', align: "center", sort: true, title: '服务器名'}, + {field: 'requestUrl', align: "center", sort: true, title: '方法名'}, {field: 'createTime', align: "center", sort: true, title: '时间'}, - {field: 'regularMessage', align: "center", sort: true, title: '具体消息'}, + {field: 'logContent', align: "center", sort: true, title: '具体消息'}, {align: 'center', toolbar: '#tableBar', title: '操作', minWidth: 100} ]]; }; @@ -33,13 +34,13 @@ layui.use(['layer', 'table', 'ax', 'laydate'], function () { /** * 点击查询按钮 */ - LoginLog.search = function () { + Log.search = function () { var queryData = {}; - queryData['beginTime'] = $("#beginTime").val(); - queryData['endTime'] = $("#endTime").val(); + queryData['beginDateTime'] = $("#beginTime").val(); + queryData['endDateTime'] = $("#endTime").val(); queryData['logName'] = $("#logName").val(); - queryData['logType'] = $("#logType").val(); - table.reload(LoginLog.tableId, { + // queryData['logType'] = $("#logType").val(); + table.reload(Log.tableId, { where: queryData, page: {curr: 1} }); }; @@ -47,79 +48,81 @@ layui.use(['layer', 'table', 'ax', 'laydate'], function () { /** * 导出excel按钮 */ - LoginLog.exportExcel = function () { - var checkRows = table.checkStatus(LoginLog.tableId); - if (checkRows.data.length === 0) { - Feng.error("请选择要导出的数据"); - } else { - table.exportFile(tableResult.config.id, checkRows.data, 'xls'); - } - }; + // Log.exportExcel = function () { + // var checkRows = table.checkStatus(Log.tableId); + // if (checkRows.data.length === 0) { + // Feng.error("请选择要导出的数据"); + // } else { + // table.exportFile(tableResult.config.id, checkRows.data, 'xls'); + // } + // }; /** * 日志详情 */ - LoginLog.logDetail = function (param) { - var ajax = new $ax(Feng.ctxPath + "/log/detail/" + param.operationLogId, function (data) { - Feng.infoDetail("日志详情", data.regularMessage); - }, function (data) { - Feng.error("获取详情失败!"); - }); - ajax.start(); - }; + // Log.logDetail = function (param) { + // var ajax = new $ax(Feng.ctxPath + "/log/detail/" + param.operationLogId, function (data) { + // Feng.infoDetail("日志详情", data.regularMessage); + // }, function (data) { + // Feng.error("获取详情失败!"); + // }); + // ajax.start(); + // }; /** * 清空日志 */ - LoginLog.cleanLog = function () { - Feng.confirm("是否清空所有日志?", function () { - var ajax = new $ax(Feng.ctxPath + "/log/delLog", function (data) { - Feng.success("清空日志成功!"); - LoginLog.search(); - }, function (data) { - Feng.error("清空日志失败!"); - }); - ajax.start(); - }); - }; + // Log.cleanLog = function () { + // Feng.confirm("是否清空所有日志?", function () { + // var ajax = new $ax(Feng.ctxPath + "/log/delLog", function (data) { + // Feng.success("清空日志成功!"); + // Log.search(); + // }, function (data) { + // Feng.error("清空日志失败!"); + // }); + // ajax.start(); + // }); + // }; - //渲染时间选择框 + // 渲染时间选择框 laydate.render({ - elem: '#beginTime' + elem: '#createTime' }); - //渲染时间选择框 - laydate.render({ - elem: '#endTime' - }); + // 渲染时间选择框 + // laydate.render({ + // elem: '#createTime' + // }); // 渲染表格 var tableResult = table.render({ - elem: '#' + LoginLog.tableId, - url: Feng.ctxPath + '/log/list', + elem: '#' + Log.tableId, + url: Feng.ctxPath + '/logManager/page', page: true, - height: "full-98", + height: "full-158", cellMinWidth: 100, - cols: LoginLog.initColumn() + cols: Log.initColumn(), + request: {pageName: 'pageNo', limitName: 'pageSize'}, + parseData: Feng.parseData }); // 搜索按钮点击事件 $('#btnSearch').click(function () { - LoginLog.search(); + Log.search(); }); // 搜索按钮点击事件 - $('#btnClean').click(function () { - LoginLog.cleanLog(); - }); + // $('#btnClean').click(function () { + // Log.cleanLog(); + // }); // 工具条点击事件 - table.on('tool(' + LoginLog.tableId + ')', function (obj) { - var data = obj.data; - var layEvent = obj.event; - - if (layEvent === 'detail') { - LoginLog.logDetail(data); - } - }); + // table.on('tool(' + Log.tableId + ')', function (obj) { + // var data = obj.data; + // var layEvent = obj.event; + // + // if (layEvent === 'detail') { + // Log.logDetail(data); + // } + // }); }); diff --git a/src/main/webapp/pages/modular/system/log/log.html b/src/main/webapp/pages/modular/system/log/log.html index e8a6eceb..a22fcff6 100644 --- a/src/main/webapp/pages/modular/system/log/log.html +++ b/src/main/webapp/pages/modular/system/log/log.html @@ -20,19 +20,18 @@
-
+
- @if(shiro.hasPermission("/log/delLog")){ + - @}
@@ -42,7 +41,9 @@ + + @} \ No newline at end of file