You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

135 lines
5.7 KiB

<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<!--#include file="/widget/head.html"-->
<!--#include file="/widget/email-tail.html"-->
<style>
.layui-table-cell {
height: auto;
}
.col-md-4,
.col-md-1 {
display: inline !important;
float: left;
}
.inline {
display: inline !important;
}
</style>
</head>
<body class="layui-layout-body" layadmin-themealias="default">
<div id="wrapper">
<!-- Navigation -->
<!--#include file="/widget/nav.html"-->
<div id="page-wrapper" class="layui-body layadmin-tabsbody-item layui-show layui-fluid layui-row layui-col-space15">
<div class="layui-card" id="card-page-wrapper">
<div class="layui-col-md4">
<div class="col-lg-12">
<div class="layui-card-header"><h3>操作日志</h3></div>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="send">
<div class="layui-form">
<div class="layui-form-item layui-inline" style="width:2300px;">
<label class="layui-form-label">用户</label>
<div class="layui-input-inline">
<input type="text" name="position" autocomplete="off" class="layui-input" id="account">
</div>
<label class="layui-form-label">地址</label>
<div class="layui-input-inline">
<input type="text" name="position" autocomplete="off" class="layui-input" id="url">
</div>
<label class="layui-form-label">方法</label>
<div class="layui-input-inline">
<input type="text" name="position" autocomplete="off" class="layui-input" id="method">
</div>
<label class="layui-form-label">开始时间</label>
<div class="layui-input-inline">
<input type="datetime" name="position" autocomplete="off" class="llayer-input" id="start">
</div>
<div class="layui-input-inline">
<input type="datetime" name="end" autocomplete="off" class="llayer-input" id="end">
</div>
<div class="layui-inline" style="width:100px;">
<button class="layui-btn" type="button" id="query">查询</button>
</div>
</div>
</div>
<div id="Datatab" style="width:1100px;"></div>
</div>
</div>
</div>
</div>
<script>
$(function () {
var _d = new Date();
layui.laydate.render({
elem: '#end',
// value: _d.getFullYear() + "-" + (_d.getMonth() + 1) + "-" + _d.getDate()+" "+_d.getHours()+":"+_d.getMinutes()+":"+_d.getSeconds(),
format: 'yyyy-MM-dd HH:mm:ss',
});
layui.laydate.render({
elem: '#start',
// value: _d.getFullYear() + "-" + (_d.getMonth() + 1) + "-" + _d.getDate()+" "+_d.getHours()+":"+_d.getMinutes()+":"+_d.getSeconds(),
format: 'yyyy-MM-dd HH:mm:ss',
});
$("#query").click(function () {
tableIns.reload({
url: Page.SvrIp +'/api/operation_log', // 重新加载数据的 URL
where: {
token: cookie.get("token"),
account: $("#account").val(),
method: $("#method").val(),
url: $("#url").val(),
start: $("#start").val(),
end: $("#end").val()
}
});
});
var tableIns = layui.table.render({
elem: '#Datatab'
, url: Page.SvrIp +'/api/operation_log' //数据接口
, where: {
token: cookie.get("token")
}
, page: true
, cols: [[
{ field: 'id', title: 'id', width: 100 },
{ field: 'name', title: 'name', width: 200 },
{ field: 'url', title: '地址', width: 200 },
{ field: 'method', title: '方法', width: 100 },
{field: 'account', title: '操作人', width: 100,},
{field: 'data', title: '数据', width: 600,templet:function(d){
return'<pre>'+d.data+'</pre>'
} },
{ field: 'ctime', title: '操作时间', width: 200 },
]]
, parseData: function (res) { //res 即为原始返回的数据
debugger
if (res.ret == 1) {
location.href = "/pages/login.html";
}
return {
"code": res.ret, //解析接口状态
"msg": res.msg, //解析提示文本
"count": res.count, //解析数据长度
"data": res.data //解析数据列表
};
}
});
});
</script>
</body>
</html>