| | |
| | | <!DOCTYPE html> |
| | | <html> |
| | | |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title>操作记录</title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" |
| | | content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> |
| | | <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all"> |
| | | <link rel="stylesheet" href="../../css/public.css" media="all"> |
| | | |
| | | <script> |
| | | // 这里是需要在页面渲染之前执行的代码 |
| | | document.addEventListener("DOMContentLoaded", function () { |
| | | //获取table默认显示数 |
| | | pageCntFirst(); |
| | | //判断是否开启table列表列宽调整功能。 |
| | | GetIsSetColW(); |
| | | }); |
| | | </script> |
| | | |
| | | </head> |
| | | |
| | | <body id="body"> |
| | | <div class="layui-card" style="padding-bottom: 0"> |
| | | <div class="layui-form layui-card-header layuiadmin-card-header-auto" id="top"> |
| | | <div class="layui-form-item"> |
| | | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">菜单名称</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" id="MenuName" name="MenuName" placeholder="请输入菜单名称" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 45px;">类型</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="Type" id="Type" lay-verify="" lay-search> |
| | | <option value=""></option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">操作内容</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" id="Msg" name="Msg" placeholder="请输入操作内容" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 60px;">开始时间</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" autocomplete="off" name="StartTime" id="StartTime" class="layui-input" |
| | | placeholder="开始时间"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" style="width: 60px;">结束时间</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" autocomplete="off" name="EndTime" id="EndTime" class="layui-input" |
| | | placeholder="结束时间"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <button class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit |
| | | lay-filter="LAY-app-contlist-search"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>搜索 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div id="center"></div> |
| | | <div class="layui-card-body"> |
| | | <div class="position-relative"><!-- class="position-relative" --><!-- 自定义表头加上 --> |
| | | <table id="LAY-app-content-list" lay-filter="LAY-app-content-list"></table> |
| | | <!-- #region 自定义表头 --> |
| | | <div class="headerSetIcon"> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" data-type="customCols"> |
| | | <i class="layui-icon"></i> |
| | | </button> |
| | | </div> |
| | | <!-- #endregion --> |
| | | |
| | | <!-- #region 自定义表头 --> |
| | | <script type="text/html" id="templetCreateTime"> |
| | | {{# function GetBtn(d){ |
| | | return formatDate(d.CreateTime); |
| | | } |
| | | }} |
| | | {{ GetBtn(d) }} |
| | | </script> |
| | | <!-- #endregion --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="../../layuiadmin/layui/layui.js"></script> |
| | | <script src="../../js/jquery-3.5.1.min.js"></script> |
| | | <script src="../../js/jquery.cookie.js"></script> |
| | | <script src="../../js/public.js"></script> |
| | | |
| | | <script> |
| | | layui.config({ |
| | | base: '../../layuiadmin/' //静态资源所在路径 |
| | | }).extend({ |
| | | index: 'lib/index' //主入口模块 |
| | | }).use(['index', 'table', 'laypage', 'layer', 'laydate'], function () { |
| | | var table = layui.table, |
| | | form = layui.form, |
| | | laypage = layui.laypage, |
| | | layer = layui.layer; |
| | | laydate = layui.laydate; |
| | | laydate.render({ |
| | | elem: '#StartTime' |
| | | , format: 'yyyy-MM-dd' //可任意组合 |
| | | }); |
| | | laydate.render({ |
| | | elem: '#EndTime' |
| | | , format: 'yyyy-MM-dd' //可任意组合 |
| | | }); |
| | | |
| | | var h1 = GetTableHeight(); |
| | | |
| | | refreshTable(); |
| | | //获取类型菜单下拉 |
| | | |
| | | sendData(IP + "/Sys/GetDictionaryByParentNo", { parentNo: "LogType" }, 'get', function (res) { |
| | | var html = ''; |
| | | console.log(res); |
| | | if (res.code == 0) { //成功 |
| | | var list = res.data; |
| | | for (var i = 0; i < list.length; i++) { |
| | | html += '<option value = "' + list[i].Id + '">' + list[i].DictName + '</option>'; |
| | | } |
| | | $("#Type").append(html); |
| | | form.render('select'); |
| | | } else { //不成功 |
| | | layer.msg('获取操作类型信息失败!', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | //渲染表格 |
| | | //#region 自定义表头 |
| | | var TotalColsArr = [[ |
| | | { field: '', title: '序号', type: 'numbers', width: 65, align: 'center', fixed: 'left', "disabled": true }, |
| | | { field: 'ParentNo', title: '模块号', align: 'center', fixed: 'left', width: 80, "disabled": true }, |
| | | { field: 'MenuNo', title: '菜单号', align: 'center', fixed: 'left', width: 80, "disabled": true }, |
| | | { field: 'MenuName', title: '菜单名称', align: 'center', width: 190 }, |
| | | { field: 'FkNo', title: '数据编号', align: 'center', width: 180 }, |
| | | { field: 'Type', title: '类型', align: 'center', width: 100 }, |
| | | { field: 'Msg', title: '操作内容', align: 'center' }, |
| | | { field: 'CreateUserName', title: '创建人', align: 'center', width: 120 }, |
| | | { field: 'CreateTime', title: '创建时间', align: 'center', width: 160, templet: '#templetCreateTime' } |
| | | ]]; |
| | | var TotalColsSysArr = encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//将表头数据进行url编码 |
| | | |
| | | function refreshTable() { |
| | | |
| | | //#region 自定义表头 |
| | | var colsJson |
| | | var param1 = { |
| | | Href: 'Sys/GetLogOperationList' |
| | | }; |
| | | sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function (res) { |
| | | if (res.code == 0) { |
| | | if (res.data == '' || res.data == undefined || res.data == null) { |
| | | colsJson = TotalColsArr |
| | | } else { |
| | | colsJson = eval(res.data); |
| | | } |
| | | } else { |
| | | colsJson = TotalColsArr |
| | | } |
| | | var param = { |
| | | MenuName: $("#MenuName").val(), |
| | | Type: $("#Type").val(), |
| | | Msg: $("#Msg").val(), |
| | | StartTime: $("#StartTime").val(), |
| | | EndTime: $("#EndTime").val(), |
| | | }; |
| | | table.render({ |
| | | elem: '#LAY-app-content-list', |
| | | url: IP + "/Sys/GetLogOperationList", |
| | | method: 'POST', |
| | | height: h1, |
| | | id: 'LAY-app-content-list', |
| | | where: param, |
| | | contentType: 'application/json', |
| | | headers: { ToKen: $.cookie('token') }, |
| | | page: true, |
| | | limit: pageCnt, |
| | | limits: pageLimits, |
| | | cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增 |
| | | cols: colsJson, |
| | | done: function (res) { |
| | | //自定义列宽 |
| | | SetTableColW('LAY-app-content-list', 'Sys/GetLogOperationList', TotalColsSysArr); |
| | | }, |
| | | }); |
| | | }); |
| | | //#endregion |
| | | |
| | | } |
| | | //监听搜索 |
| | | form.on('submit(LAY-app-contlist-search)', function (data) { |
| | | |
| | | refreshTable(); |
| | | }); |
| | | |
| | | //#region 自定义表头 |
| | | //自定义表头 |
| | | active = { |
| | | customCols: function () { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '自定义列', |
| | | content: '../SystemSettings/HeaderSetting.html?Href=Sys/GetLogOperationList&ColsSysArr=' + TotalColsSysArr, |
| | | maxmin: false, |
| | | resize: false, |
| | | area: ['970px', '650px'] |
| | | }); |
| | | } |
| | | }; |
| | | $('.layui-btn').on('click', function () { |
| | | var type = $(this).data('type'); |
| | | active[type] ? active[type].call(this) : ''; |
| | | }); |
| | | //#endregion |
| | | }); |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!-- <!DOCTYPE html> |
| | | <html> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title>用户信息列表</title> |
| | |
| | | }); |
| | | </script> |
| | | </body> |
| | | </html> |
| | | </html> --> |