You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.4 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!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="../../static/css/font.css">
<link rel="stylesheet" href="../../static/css/weadmin.css">
<!-- 让IE8/9支持媒体查询从而兼容栅格 -->
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
.layui-table-view .layui-table {width:100%}
</style>
</head>
<body>
<div class="weadmin-body">
<!--表名-->
<center><h2><span id="table_title"></span></h2></center>
<table class="layui-table" lay-filter="idTest" id="idTest"></table>
</div>
<script src="../../lib/layui/layui.js"></script>
<script src="../../lib/template.js"></script>
<script src="../../lib/JqueryExtend.js"></script>
<script src="../../lib/layuiExtend.js"></script>
<script>
layui.use(['jquery', 'table'], function () {
var $ = layui.jquery,
table = layui.table;
//接入输入的参数1-15
var id = GetQueryString("id");
if (id == null) {
//如果没有传入默认值是1
id=1;
}
if(id>15 || id <1){
alert("本功能只限参数id:[1,4],参数传递错误!");
return;
}
//动态加载js文件万恶的异步回调
loadJS(id+".js",function(){
//处理一下页面的title
document.title=title;
//表的名称
$("#table_title").text(title);
//展示已知数据
table.render({
elem: '#idTest'
, cols: cols
, data: data
//,skin: 'line' //表格风格
, even: true
, page: false //是否显示分页
//,limits: [5, 7, 10]
,limit: 50 //每页默认显示的数量
,done: function () {
$('th').css({'font-weight':'bold'})
}
});
});
})
</script>
</body>
</html>