user.html页面编辑、删除、搜索效果
parent
651f1704bb
commit
6778529b51
45
user.html
45
user.html
|
|
@ -25,10 +25,10 @@
|
|||
<!--模糊搜索区域-->
|
||||
<div class="layui-row">
|
||||
<form class="layui-form layui-col-md12 ok-search">
|
||||
<input class="layui-input" placeholder="开始日" id="startTime">
|
||||
<input class="layui-input" placeholder="截止日" id="endTime">
|
||||
<input class="layui-input" placeholder="开始日期" autocomplete="off" id="startTime">
|
||||
<input class="layui-input" placeholder="截止日期" autocomplete="off" id="endTime">
|
||||
<input class="layui-input" placeholder="请输入用户名" autocomplete="off">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="sreach">
|
||||
<button class="layui-btn" lay-submit="" lay-filter="search">
|
||||
<i class="layui-icon layui-icon-search"></i>
|
||||
</button>
|
||||
</form>
|
||||
|
|
@ -47,10 +47,10 @@
|
|||
<button class="layui-btn">
|
||||
<i class="layui-icon"></i>添加用户
|
||||
</button>
|
||||
<span>共有数据:8888 条</span>
|
||||
<span>共有数据:<i id="countNum"></i> 条</span>
|
||||
</okToolbar>
|
||||
<!--数据表格-->
|
||||
<table class="layui-hide" id="userTable"></table>
|
||||
<table class="layui-hide" id="tableId" lay-filter="tableFilter"></table>
|
||||
</div>
|
||||
<!--js逻辑-->
|
||||
<script src="lib/layui/layui.js"></script>
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
});
|
||||
|
||||
table.render({
|
||||
elem: '#userTable',
|
||||
elem: '#tableId',
|
||||
url:'data/data.json',
|
||||
limit: 10,
|
||||
page: true,
|
||||
|
|
@ -88,15 +88,42 @@
|
|||
{field:'email', title:'邮箱', width:200},
|
||||
{field:'createTime', title:'创建时间', width:200},
|
||||
{field:'logins', title:'登陆次数', width:100},
|
||||
{field:'sex', title:'操作', width:280, templet: '#operationTpl', align:'center'}
|
||||
]]
|
||||
{title:'操作', width:280, templet: '#operationTpl', align:'center'}
|
||||
]],
|
||||
done: function(res, curr, count){
|
||||
$("#countNum").text(count);
|
||||
}
|
||||
});
|
||||
|
||||
form.on('submit(search)', function () {
|
||||
alert(666);
|
||||
layer.msg('正在查询,请稍后...');
|
||||
return false;
|
||||
});
|
||||
|
||||
table.on('tool(tableFilter)', function(obj){
|
||||
var data = obj.data;
|
||||
var layEvent = obj.event;
|
||||
if(layEvent === 'edit'){
|
||||
layer.open({
|
||||
title: '编辑用户',
|
||||
type: 2,
|
||||
shade: false,
|
||||
maxmin: true,
|
||||
shade: 0.5,
|
||||
area: ['90%', '90%'],
|
||||
content: 'user-edit.html',
|
||||
zIndex: layer.zIndex,
|
||||
end: function () {
|
||||
// $(".layui-laypage-btn")[0].click();
|
||||
}
|
||||
});
|
||||
}else if(layEvent === 'del'){
|
||||
layer.confirm("确定要删除吗?", {skin: 'layui-layer-lan', icon: 2, title:'提示', anim: 4}, function () {
|
||||
layer.msg("操作成功!", {icon: 1, time: 1000});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#batchEnabled").click(function(){
|
||||
layer.confirm("确定要批量启用吗?", {icon: 3, title:'提示'}, function () {
|
||||
layer.msg("操作成功!", {icon: 1, time: 1000});
|
||||
|
|
|
|||
Loading…
Reference in New Issue