7e47ce238b
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
126 lines
3.6 KiB
HTML
126 lines
3.6 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="renderer" content="webkit">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
<title>陈列管理-e订通后台</title>
|
|
<link rel="stylesheet" href="layuiadmin/layui/css/layui.css">
|
|
<link rel="stylesheet" href="index.css">
|
|
<script src="layuiadmin/layui/layui.js"></script>
|
|
<script src="js/function.js"></script>
|
|
<style type="text/css">
|
|
.layui-table-cell {
|
|
height: auto;
|
|
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div>
|
|
<blockquote class="layui-elem-quote" style="line-height:44px;padding:8px;" id="search_top">
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-normal btn_add">新增</a></div>
|
|
<div class="layui-inline"><a class="layui-btn layui-btn-danger btn_del">删除</a></div>
|
|
</blockquote>
|
|
<div style="width:99%;">
|
|
<form class="layui-form">
|
|
<table id="layui_table" lay-filter="layui_table" style="">
|
|
</table>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<script type="text/html" id="tpltitle">
|
|
<a href="javascript:;" style="color:blue;" lay-event="edit">{{d.title}}</a>
|
|
</script>
|
|
<script>
|
|
var tableIns={};
|
|
layui.use(['form','layer','table','laytpl'],function(){
|
|
var form = layui.form,
|
|
layer = layui.layer,
|
|
$=layui.jquery,
|
|
laytpl = layui.laytpl,
|
|
table = layui.table;
|
|
|
|
//---------------------------------------------数据表格
|
|
var url='./?_m=kh_tb&_a=group_list';
|
|
|
|
var cols=[];
|
|
cols[0]={type: "checkbox", width:60};
|
|
cols[1]={field: 'xh', width:120 , title: '序号',align:"center"};
|
|
cols[2]={field: 'title', title: '名称',align:"left",templet:'#tpltitle'};
|
|
var table_heaight=(document.documentElement.clientHeight>300)?document.documentElement.clientHeight-$('#search_top').outerHeight(true)-80:"500";
|
|
|
|
tableIns = table.render({
|
|
even:false,
|
|
elem: '#layui_table',
|
|
url : url,
|
|
cellMinWidth:80,
|
|
page : true,
|
|
height : table_heaight,
|
|
limit : 20,
|
|
limits : [10,20,30,50,100],
|
|
id : "kh_tb_ztmanageTable",
|
|
cols : [cols]
|
|
});
|
|
|
|
//新增、编辑
|
|
function add(tid){
|
|
var t1=(tid>0)?"编辑":"新增";
|
|
var index = layui.layer.open({
|
|
title : t1+"展厅",
|
|
type : 2,
|
|
content : "kh_tb_ztmanage_add.htm?id="+tid,
|
|
success : function(layero, index){
|
|
|
|
}
|
|
})
|
|
layui.layer.full(index);
|
|
//改变窗口大小时,重置弹窗的宽高,防止超出可视区域(如F12调出debug的操作)
|
|
$(window).on("resize",function(){
|
|
layui.layer.full(index);
|
|
})
|
|
}
|
|
$(".btn_add").click(function(){
|
|
add(0);
|
|
})
|
|
|
|
//列表操作
|
|
table.on('tool(layui_table)', function(obj){
|
|
var layEvent = obj.event,
|
|
data = obj.data;
|
|
if(layEvent === 'edit'){
|
|
//编辑
|
|
add(data.id);
|
|
}
|
|
});
|
|
|
|
//批量删除
|
|
$(".btn_del").click(function(){
|
|
var checkStatus = table.checkStatus('kh_tb_ztmanageTable'),
|
|
data = checkStatus.data,
|
|
check_id = [];
|
|
if(data.length>0) {
|
|
for (var i in data) {
|
|
check_id.push(data[i].id);
|
|
}
|
|
layer.confirm('确定删除吗?', {icon: 3, title: '提示信息'}, function (index) {
|
|
$.get("./?_m=kh_tb&_a=group_del",{id:check_id},function(data){
|
|
if(data.code=="1"){
|
|
layer.msg("删除成功!");
|
|
tableIns.reload();
|
|
parent.tableIns.reload();
|
|
layer.close(index);
|
|
}else{
|
|
layer.msg(data.msg);
|
|
}
|
|
},"json")
|
|
})
|
|
}else{
|
|
layer.msg("请选择需要删除的记录");
|
|
}
|
|
})
|
|
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |