文件

198 行
6.7 KiB
HTML
可执行文件

此文件含有模棱两可的 Unicode 字符

此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>后台管理系统</title>
<link rel="stylesheet" href="__PUBLIC__/bootstrap/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/layui/css/layui.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Retail/css/goodsList.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Retail/css/myscroll.css"/>
<style>
* {
margin: 0;
padding: 0;
}
body {
padding: 10px 15px;
}
table {
border: 1px solid #f1f1f1;
margin-top: 40px;
}
.layui-btn {
background-color: white!important;
color: #999!important;
border: 1px solid #CCCCCC!important;
}
.layui-table-cell {
height: 85px;
line-height: 85px;
padding: 0 15px;
position: relative;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
box-sizing: border-box;
}
</style>
</head>
<body style="cursor: pointer;">
<div class="goodsBox">
<div class="goods_title">
<div class="goods_title_inner" id="goods_title_inner">
产品列表
</div>
</div>
</div>
<form action="#" class="form-inline PromotionForm">
<div class="form-group" >
<div class="col-md-12 col-sm-12 ">
<div class="form-group">
<input class="searchInput form-control" type="text" value="" placeholder="菜单名称" id="keyword">
</div>
</div>
</div>
<button type="button" class="btn btn-default" id="Preservation">查询</button>
<button type="button" class="btn btn-default" id="add">添加</button>
</form>
<table class="layui-hide" id="test" lay-filter="demo"></table>
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-sm edit" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-sm del" lay-event="del">删除</a>
</script>
<script src="__PUBLIC__/jquery/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/layui/layui.js"></script>
<script>
layui.use(['form', 'layedit', 'laydate', 'table'], function() {
// 日期
var laydate = layui.laydate;
var table = layui.table;
var form = layui.form
//展示已知数据
table.render({
elem: '#test',
url: "{:U('Help/getmanual')}",
cols: [
[ //标题栏
{
field: 'id',
title: '序号',
width:60
},
{
field: 'logo',
title: '手册LOGO',
align:'center',
style:'height:100%;',
templet:'<div><img src="{{ d.logo}}" style="width: 80px;"></div>'
},{
field: 'manual',
title: '手册名称',
align:'center',
}, {
field: 'addtime',
title: '添加时间',
align:'center',
}, {
field: 'cate_name',
title: '所属分类',
align:'center',
},{
fixed: 'right',
title: '操作',
align: 'center',
toolbar: '#barDemo',
width:200
}
]
],
page: {
layout: [ 'count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
}, //是否开启分页
});
table.on('tool(demo)', function(obj){ //注:tool是工具条事件名,test是table原始容器的属性 lay-filter="对应的值"
var data = obj.data; //获得当前行数据
if(obj.event === 'edit') { //编辑
top.layer.open({
type: 2,
content: "{:U('amend_manual')}?id=" + data.id,
title: "编辑-菜单信息",
area: ["600px", '450px'],
btnAlign: 'c',
end: function () {
table.reload('test', {});
}
})
}else if(obj.event == 'del')
{
id = data.id;
console.log(data.id);
layer.confirm("您确认要删除该菜单吗?", function (index) {
$.ajax({
url: "{:U('Help/del_manual')}",
type: "POST",
data: {id: data.id},
success: function (res) {
if (res.status == 1) {
layer.msg(res.msg, {
icon: 1,
time: 1000
}, function () {
layer.close(index);
obj.del();
})
} else {
layer.msg(res.msg, {
icon: 1,
time: 1000
})
}
}
})
})
}
});
//查询
$('#Preservation').click(function () {
//执行重载
table.reload('test', {
page: {
curr: 1 //重新从第 1 页开始
}
,where: {
keyword:$('#keyword').val()
}
});
})
$('#add').click(function () {
top.layer.open({
type: 2,
content: "{:U('help/add_manual')}",
title: "添加产品手册",
area: ["45%",'50%'],
btnAlign: 'c',
end:function () {
table.reload('test', {
});
}
})
})
function checkPwd(pwd){
var reg=/^[a-zA-Z0-9]{1,}$/;
if(reg.test(pwd)==false){
return false;
}
return true;
}
})
</script>
</body>
</html>