|
|
@@ -8,77 +8,50 @@
|
|
|
</head>
|
|
|
|
|
|
<body class="content">
|
|
|
-<form class="layui-form" id = "formName" >
|
|
|
-<div class="form-input" >
|
|
|
- <div class="layui-form-item">
|
|
|
- <div class="layui-inline">
|
|
|
- <label class="layui-form-label">操作员姓名:</label>
|
|
|
- <div class="layui-input-block">
|
|
|
- <input type="tel" name="name" id ="name" lay-verify="name" autocomplete="off" placeholder="请输入姓名" class="layui-input">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="layui-inline">
|
|
|
- <label class="layui-form-label">登录名:</label>
|
|
|
- <div class="layui-input-block">
|
|
|
- <input type="tel" name="logonname" id ="logonname" lay-verify="logonname" autocomplete="off" placeholder="请输入姓名" class="layui-input">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="layui-form-item">
|
|
|
- <div class="layui-inline">
|
|
|
- <label class="layui-form-label">所属角色:</label>
|
|
|
- <div class="layui-input-block" id="seleRoleid">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- <div class="layui-inline">
|
|
|
- <label class="layui-form-label">状态:</label>
|
|
|
- <div class="layui-input-block" id="state">
|
|
|
-
|
|
|
- </div>
|
|
|
- </div> -->
|
|
|
- <div class="layui-inline">
|
|
|
- <label class="layui-form-label">部门:</label>
|
|
|
- <div class="layui-input-block" id="branchId">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="layui-form-item">
|
|
|
- <div class="layui-inline">
|
|
|
- <label class="layui-form-label">日期范围:</label>
|
|
|
- <div class="layui-input-block">
|
|
|
- <input type="text" class="layui-input" id="dates" placeholder="请选择日期范围">
|
|
|
- </div>
|
|
|
-<!-- <label class="layui-form-label">创建日期:</label>
|
|
|
- <div class="layui-input-block">
|
|
|
- <input class="layui-input " type="text" id="date" placeholder="请输入日期" />
|
|
|
- </div> -->
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
-</div>
|
|
|
-</form>
|
|
|
-<div class="form-input demoTable" >
|
|
|
- <button class="layui-btn" data-type="reload" >查询</button>
|
|
|
- <button class="layui-btn" data-type="reset">重置</button>
|
|
|
-</div>
|
|
|
- <table id="logTable" lay-filter="tableFilter"></table>
|
|
|
+ <div class="order-body">
|
|
|
+ <div class="order-tiaojian back-gray">
|
|
|
+ <div class="tiaojian-part1" id = "conditions">
|
|
|
+ <div class="fl f12-gray4-op mt4">所选条件:</div>
|
|
|
+ </div>
|
|
|
+ <div class="tiaojian-part2 fr demoTable">
|
|
|
+ <button class="layui-btn order-bnt1" data-type="reload" >搜索</button>
|
|
|
+ <button class="layui-btn order-bnt2" data-type="reset">重置</button>
|
|
|
+ <a href="#" id="toggle" class="top">收起</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <form class="layui-form" id = "formName" >
|
|
|
+ <div class="order-select back-border" id="content">
|
|
|
+ <div class="layui-inline">
|
|
|
+ <label class="f12-gray4">登录名:</label>
|
|
|
+ <input onchange = "changeSelectCon(0,this,'inp')" class="search-select" type="tel" name="logonname" id ="logonname" value="" placeholder="请输入登录名" />
|
|
|
+ </div>
|
|
|
+ <div class="layui-inline">
|
|
|
+ <label class="f12-gray4">姓名:</label>
|
|
|
+ <input onchange = "changeSelectCon(1,this,'inp')" class="search-select" type="tel" name="name" id ="name" value="" placeholder="请输入姓名" />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="layui-inline">
|
|
|
+ <label class="f12-gray4">操作:</label>
|
|
|
+ <input onchange = "changeSelectCon(2,this,'inp')" class="search-select" type="tel" name="desc" id ="desc" value="" placeholder="请输入操作" />
|
|
|
+ </div>
|
|
|
+ <div class="d-dashed" style="margin: 10px 0;"></div>
|
|
|
+ <div class="layui-inline">
|
|
|
+ <label class="f12-gray4">日期:</label>
|
|
|
+ <input class="search-select" type="text" id="dates" placeholder="日期(区间)" readonly />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ <div class="shadow-content" style="margin:1.5rem;">
|
|
|
+ <table id="logTable" lay-filter="tableFilter"></table>
|
|
|
+ </div>
|
|
|
<!--操作功能-->
|
|
|
<script type="text/html" id="barDemo">
|
|
|
- <a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
|
|
|
+ <a class="layui-btn layui-btn-xs" lay-event="delete">删除</a>
|
|
|
</script>
|
|
|
-
|
|
|
+
|
|
|
<script>
|
|
|
-//仅选择日期
|
|
|
-/* layui.use('laydate', function(){
|
|
|
- var laydate = layui.laydate;
|
|
|
- laydate.render({
|
|
|
- elem: '#date'
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
-}) */
|
|
|
// 仅选择日期
|
|
|
layui.use('laydate', function(){
|
|
|
var laydate = layui.laydate;
|
|
|
@@ -93,8 +66,11 @@
|
|
|
elem: '#dates'
|
|
|
,range: true
|
|
|
,format:'yyyyMMdd'
|
|
|
+ ,done: function(value, date, endDate){
|
|
|
+ changeSelectCon(3,"dates",'date',value)
|
|
|
+ }
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
|
|
|
layui.use('form', function(){
|
|
|
@@ -114,13 +90,13 @@
|
|
|
html = html + 'value="';
|
|
|
html = html + j.id + '">';
|
|
|
html = html + j.name+ '</option>';
|
|
|
- })
|
|
|
+ })
|
|
|
html = html + '</select>';
|
|
|
$("#seleRoleid").html(html);
|
|
|
initSelectb('state', "IM_USER_STATE", "state", ' ', true);
|
|
|
form.render();
|
|
|
},
|
|
|
- });
|
|
|
+ });
|
|
|
$.request({
|
|
|
action : '../../RoleManageAction/roleQueryBranch',
|
|
|
data : { },
|
|
|
@@ -136,12 +112,12 @@
|
|
|
html1 = html1 + 'value="';
|
|
|
html1 = html1 + j.id + '">';
|
|
|
html1 = html1 + j.name+ '</option>';
|
|
|
- })
|
|
|
+ })
|
|
|
html1 = html1 + '</select>';
|
|
|
$("#branchId").html(html1);
|
|
|
form.render();
|
|
|
},
|
|
|
- });
|
|
|
+ });
|
|
|
})
|
|
|
var table;
|
|
|
layui.use('table', function(){
|
|
|
@@ -149,7 +125,6 @@
|
|
|
table.render({
|
|
|
id : 'logTable'
|
|
|
//tbname:'userLoger',
|
|
|
- ,height:'full-20'
|
|
|
,elem: '#logTable'
|
|
|
,limit:10
|
|
|
,url: '../../LogManageAction/queryLogs' //数据接口
|
|
|
@@ -159,32 +134,70 @@
|
|
|
{field:'no', type : 'numbers', title: '序号'}//
|
|
|
//,{field: 'logId', title: '操作员编号', width:140, sort: true}
|
|
|
,{field: 'logonname', title: '登录名', width:100}
|
|
|
- ,{field: 'name', title: '操作员名称', width:120}
|
|
|
+ ,{field: 'name', title: '姓名', width:120}
|
|
|
,{field: 'logdatetime', title: '执行时间', width:140}
|
|
|
- ,{field: 'branchname', title: '所属部门',width:150}
|
|
|
- ,{field: 'rolename', title: '角色', width:150}
|
|
|
- ,{field: 'loginfo', title: '操作描述', width:150}
|
|
|
- ,{field: 'logresult', title: '操作结果', width:150}
|
|
|
+ ,{field: 'branchname', title: '所属商户',width:100}
|
|
|
+ ,{field: 'rolename', title: '角色', width:100}
|
|
|
+ ,{field: 'loginfo', title: '操作描述', width:200}
|
|
|
+ ,{field: 'logresult', title: '操作结果', width:100}
|
|
|
,{field: 'ip', title: 'IP地址',width:180}
|
|
|
+ ,{field: 'operate', title: '操作', toolbar: '#barDemo', width:100}
|
|
|
]]
|
|
|
,done: function(res, curr, count){
|
|
|
//如果是异步请求数据方式,res即为你接口返回的信息。
|
|
|
console.log(res);
|
|
|
-
|
|
|
+
|
|
|
//得到当前页码
|
|
|
- console.log(curr);
|
|
|
-
|
|
|
+ console.log(curr);
|
|
|
+
|
|
|
//得到数据总量
|
|
|
console.log(count);
|
|
|
}
|
|
|
,even: true //开启隔行背景
|
|
|
-
|
|
|
+
|
|
|
});
|
|
|
+ // 监听工具条(操作)
|
|
|
+ table.on('tool(tableFilter)', function(obj){ //注:tool是工具条事件名,tableFilter是table原始容器的属性 lay-filter="对应的值"
|
|
|
+ var data = obj.data; //获得当前行数据
|
|
|
+ var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
|
|
|
+ var tr = obj.tr; //获得当前行 tr 的DOM对象
|
|
|
+ if(layEvent === 'delete'){ //详情
|
|
|
+ layer.confirm('确认删除此数据?', function(index){
|
|
|
+ layer.close(index);
|
|
|
+ //向服务端发送删除指令roleDelete
|
|
|
+ $.request({
|
|
|
+ action : "../../LogManageAction/deleteLogs",
|
|
|
+ data : {
|
|
|
+ id : data.logId
|
|
|
+ },
|
|
|
+ success : function(resData) {
|
|
|
+ if (resData.MINStatus == 0) {
|
|
|
+ layer.alert('操作成功!', {icon: 1});
|
|
|
+ obj.del(); //删除对应行(tr)的DOM结构,并更新缓存
|
|
|
+ } else {
|
|
|
+ layer.alert(resData.MINErrorMessage, {
|
|
|
+ icon: 5,
|
|
|
+ title: "提示"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error : function(data2){
|
|
|
+ layer.alert(data2.MINErrorMessage, {
|
|
|
+ icon: 5,
|
|
|
+ title: "提示"
|
|
|
+ });
|
|
|
+// layer.alert(resData.MINErrorMessage, {icon: 2});
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
$('.demoTable .layui-btn').on('click', function(){
|
|
|
var type = $(this).data('type');
|
|
|
active[type] ? active[type].call(this) : '';
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
});
|
|
|
var $ = layui.$, active = {
|
|
|
reload: function(){
|
|
|
@@ -208,7 +221,7 @@
|
|
|
,{field: 'createdate', title: '创建日期'}
|
|
|
,{field: 'lastlogon', title: '最后登录日期'}
|
|
|
,{field: 'sttdesc', title: '状态'}
|
|
|
- ];
|
|
|
+ ];
|
|
|
// 寄存当前数据
|
|
|
setNowRowData(data, params);
|
|
|
layer.open({
|
|
|
@@ -232,6 +245,9 @@
|
|
|
var branchId = $("#branchId option:selected").val();
|
|
|
//日期范围
|
|
|
var dates = $('#dates').val();
|
|
|
+ var desc = $('#desc').val();
|
|
|
+
|
|
|
+ desc
|
|
|
//执行重载
|
|
|
table.reload('logTable', {
|
|
|
page: {
|
|
|
@@ -242,12 +258,83 @@
|
|
|
logonname : logonname,
|
|
|
roleid : seleRoleid,
|
|
|
branchid : branchId,
|
|
|
- date : dates
|
|
|
+ date : dates,
|
|
|
+ desc : desc
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ function changeSelectCon(index, t, type, dateValue){
|
|
|
+ if (type == "date") {
|
|
|
+ if (isEmpty(dateValue)) {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ } else {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ if (isEmpty($("#search" + index).attr("name"))) {
|
|
|
+ $("#conditions").append(getSelectConHtml(index, t, type,dateValue));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (type == 'inp') {
|
|
|
+ if (isEmpty($(t).val())) {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ } else {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ if (isEmpty($("#search" + index).attr("name"))) {
|
|
|
+ $("#conditions").append(getSelectConHtml(index, t, type));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (isEmpty($(t).val())) {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ } else {
|
|
|
+ $("#search" + index).remove();
|
|
|
+ if (isEmpty($("#search" + index).attr("name"))) {
|
|
|
+ $(t).attr("id",dateValue);
|
|
|
+ $("#conditions").append(getSelectConHtml(index, t, type,dateValue));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var array = new Array('登录名','姓名','操作','日期');
|
|
|
+ function getSelectConHtml(index, t, type,dateValue){
|
|
|
+ var name;
|
|
|
+ var value;
|
|
|
+ if(type == "inp"){
|
|
|
+ value = t.value.substr(0,5)+"..";
|
|
|
+ }
|
|
|
+ if (type == "date") {
|
|
|
+ value = dateValue;
|
|
|
+ }
|
|
|
+ if(type == "sel" && dateValue =="state"){
|
|
|
+ value = $("#state").find("option:selected").text();
|
|
|
+ }
|
|
|
+ if(type == "sel" && dateValue =="roleid"){
|
|
|
+ value = $("#roleid").find("option:selected").text();
|
|
|
+ }
|
|
|
+ if (type == "date") {
|
|
|
+ name = $("#"+t).attr("id");
|
|
|
+ } else {
|
|
|
+ name = $(t).attr("id");
|
|
|
+ }
|
|
|
+ var html = '<div class="fl xuanzhong-active" id = "search' + index + '" name = "' + name + '" onclick = "removeSearch(this)">' +
|
|
|
+ '<div class="fl">' + array[index] + '</div>' +
|
|
|
+ ':<i class="iconfont">'+value+'</i>' +
|
|
|
+ '<svg class="icon" aria-hidden="true">' +
|
|
|
+ '<use xlink:href="#iconicon_close1"></use>' +
|
|
|
+ '</svg>' +
|
|
|
+ '</div>';
|
|
|
+ return html;
|
|
|
+ }
|
|
|
+ function removeSearch(t) {
|
|
|
+ $("#"+$(t).attr("name")).val('');
|
|
|
+ $(t).remove();
|
|
|
+ }
|
|
|
+ $("#toggle").click(function() {
|
|
|
+ $(this).html($("#content").is(":hidden") ? "收起" + "<i class='iconfont up iconSelect_drop-down'/></i>" : "展开" +
|
|
|
+ "<i class='iconfont up iconSelect_drop-down'/></i>");
|
|
|
+ $("#content").slideToggle();
|
|
|
+ });
|
|
|
</script>
|
|
|
-
|
|
|
+
|
|
|
</body>
|
|
|
|
|
|
</html>
|