|
|
<!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> |