123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="keywords" content="">
- <meta name="description" content="">
- <title text="日志"></title>
- <link rel="stylesheet" href="../../../component/pear/css/pear.css">
- <style>
- .layui-form-label {
- width: 60px;
- }
- .layui-table-box button {
- font-size: 13px !important;
- }
- </style>
- </head>
- <body class="pear-container">
- <div class="layui-card">
- <div class="layui-card-body">
- <form class="layui-form" action="">
- <div class="layui-form-item">
- <label class="layui-form-label">操作模块</label>
- <div class="layui-input-inline">
- <input type="text" name="title" placeholder="" class="layui-input">
- </div>
- <label class="layui-form-label">操作类型</label>
- <div class="layui-input-inline">
- <select id="operationType" name="operationType">
- <option value="">请选择</option>
- </select>
- </div>
- <label class="layui-form-label">操作状态</label>
- <div class="layui-input-inline">
- <select name="status">
- <option value="">请选择</option>
- <option value="1">成功</option>
- <option value="0">失败</option>
- </select>
- </div>
- <label class="layui-form-label">操作人员</label>
- <div class="layui-input-inline">
- <input type="text" name="username" placeholder="" class="layui-input">
- </div>
- <label class="layui-form-label">操作时间</label>
- <div class="layui-input-inline">
- <input type="text" id="createTime" placeholder="" class="layui-input">
- </div>
- <button class="pear-btn pear-btn-md-0 pear-btn-primary" lay-submit lay-filter="query">
- <i class="layui-icon layui-icon-search"></i>
- 查询
- </button>
- <button id="btn_reset" class="pear-btn pear-btn-md-0">
- <i class="layui-icon layui-icon-refresh"></i>
- 重置
- </button>
- </div>
- </form>
- </div>
- </div>
- <div class="layui-card">
- <div class="layui-card-body">
- <table id="table" lay-filter="table"></table>
- </div>
- </div>
- </body>
- <script type="text/html" id="bar">
- <a class="cool-line-btn cool-bg-blue" lay-event="detail">详情</a>
- </script>
- <script type="text/html" id="statusTpl">
- {{# if (d.status == 1){ }}
- <span class="layui-badge" style="background-color: #42d885;">成功</span>
- {{# } else { }}
- <span class="layui-badge" style="background-color: #ffa4a4;">失败</span>
- {{# } }}
- </script>
- <script type="text/html" id="createTimeTpl">
- {{layui.util.toDateString(d.createTime, 'yyyy-MM-dd HH:mm:ss')}}
- </script>
- <script src="../../../component/layui/layui.js"></script>
- <script src="../../../component/pear/pear.js"></script>
- <script>
- layui.use(['request', 'table', 'form', 'laydate', 'common'], function () {
- var $ = layui.jquery,
- request = layui.request,
- table = layui.table,
- form = layui.form,
- laydate = layui.laydate,
- common = layui.common;
- var MODULE_PATH = "/system/log/v1/";
- layer.ready(function () {
- request.dictSelect("operationType", "sys_log_type")
- });
- request.tableRender({
- url: MODULE_PATH,
- cols: [
- [
- {type: 'checkbox'},
- {title: '操作模块', field: 'title', align: 'center'},
- {title: '操作类型', field: 'operationType', align: 'center', templet: '#operationTypeTpl'},
- {title: '请求方式', field: 'httpMethod', align: 'center'},
- {title: '操作人员', field: 'username', align: 'center'},
- {title: 'IP地址', field: 'remoteAddr', align: 'center'},
- {title: '操作状态', field: 'status', align: 'center', templet: '#statusTpl'},
- {title: '操作时间', field: 'createTime', align: 'center', width: 200, templet: '#createTimeTpl'},
- {title: '消耗时间(ms)', field: 'useTime', align: 'center'},
- {title: '操作', align: 'center', toolbar: '#bar'}
- ]
- ]
- });
- laydate.render({
- elem: '#createTime',
- range: '~'
- });
- table.on('tool(table)', function (obj) {
- if (obj.event === 'detail') {
- window.detail(obj.data.id);
- }
- });
- table.on('toolbar(table)', function (obj) {
- if (obj.event === 'refresh') {
- refresh();
- }
- });
- form.on('submit(query)', function (data) {
- var timeList = $('#createTime').val().split('~');
- if (!common.isEmpty(timeList)) {
- data.field.beginTime = timeList[0];
- data.field.endTime = timeList[1].trim();
- }
- window.refresh(data.field);
- return false;
- });
- window.detail = function (id) {
- layer.open({
- type: 2,
- title: '详情',
- shade: 0.1,
- scrollbar: false,
- area: ['850px', '610px'],
- content: 'view.html?id=' + id
- });
- };
- window.refresh = function (param) {
- table.reload('table', {where: param});
- }
- })
- </script>
- </html>
|