main
kgdxpr 2 years ago
parent 27aeab073b
commit e9735afe0d

@ -24,41 +24,34 @@
top: -1px;
cursor: pointer;
}
.layui-table-tool-temp {
padding-right: 0;
}
</style>
</head>
<body class="pear-container layui-form">
<div class="layui-card" style="margin-bottom: 10px !important;">
<div class="layui-card-body">
<div class="layui-form-item" style="margin: 10px 0 5px 0 !important;">
<div class="layui-form-item layui-inline">
<label class="layui-form-label" style="width: 65px;">配置名称</label>
<div class="layui-input-inline">
<input type="text" id="config_name" lay-affix="clear" lay-filter="clear" placeholder="请输入配置名称"
class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="user-query">
<i class="layui-icon layui-icon-search"></i>
查询
</button>
</div>
</div>
</div>
</div>
<div class="layui-card">
<div class="layui-card-body">
<table id="data-table"></table>
</div>
</div>
<script type="text/html" id="table-bar">
<span class="woo-tool-span woo-tool-text-span" lay-event="edit"><a
class="woo-theme-color">编辑</a></span>
<span class="woo-tool-span woo-tool-text-span" lay-event="viewDetails"><a
class="woo-theme-color">查看详情</a></span>
<i class="woo-tool-text-delimiter"></i>
<span class="woo-tool-span woo-tool-text-span" lay-event="downExcel"><a
class="woo-theme-color">下载EXCEL</a></span>
<i class="woo-tool-text-delimiter"></i>
<span class="woo-tool-span woo-tool-text-span" lay-event="viewLog"><a
class="woo-theme-color">查看日志</a></span>
</script>
<script src="../../../component/layui/layui.js"></script>
@ -74,33 +67,29 @@
tableRender();
form.on('submit(user-query)', function () {
tableRender();
return false;
});
form.on('input-affix(clear)', function (data) {
tableRender();
});
function tableRender() {
table.render({
elem: '#data-table',
url: '/QingLong/dataShare/listConfig',
url: '/QingLong/yunxiao/getTop10',
where: {
keyword: $("#config_name").val()
},
height: 'full-150',
page: {
limit: 15
, layout: ['count', 'prev', 'page', 'next', 'skip']
, prev: "上一页"
, next: "下一页"
page: 1,
limit: 100,
system_id: 0
},
height: 'full-60',
cols: [[
{ title: '序号', align: 'center', width: "5%", type: 'numbers' },
{ title: '配置名称', field: 'config_name', align: 'center' },
{ title: '配置值', field: 'config_value', align: 'center', width: "20%" },
{ title: '开始时间', field: 'st', align: 'center', width: "10%" },
{ title: '结束时间', field: 'ed', align: 'center', width: "10%" },
{ title: '单位数', field: 'ds_base_bureau', align: 'center' },
{ title: '部门数', field: 'ds_base_org', align: 'center' },
{ title: '班级数', field: 'ds_base_class', align: 'center' },
{ title: '教师数', field: 'ds_base_teacher', align: 'center' },
{ title: '学生数', field: 'ds_base_student', align: 'center' },
{ title: '学段数', field: 'ds_res_stage', align: 'center' },
{ title: '学科数', field: 'ds_res_subject', align: 'center' },
{ title: '版本数', field: 'ds_res_edition', align: 'center' },
{ title: '教材数', field: 'ds_res_textbook', align: 'center' },
{ title: '教材章节数', field: 'ds_res_chapter', align: 'center' },
{ title: '操作', toolbar: '#table-bar', align: 'center', width: "20%" }
]],
skin: 'line',
@ -108,23 +97,39 @@
});
}
table.on('tool(data-table)', function (obj) {
if (obj.event === 'edit') {
window.edit(obj);
if (obj.event === 'viewDetails') {
window.viewDetails(obj);
} else if (obj.event === 'downExcel') {
window.downExcel(obj);
} else if (obj.event === 'viewLog') {
window.viewLog(obj);
}
});
window.edit = function (obj) {
window.viewDetails = function (obj) {
window.open('/QingLong/Logs/' + obj.data.start_time + '.html');
}
window.downExcel = function (obj) {
window.location = '/QingLong/Logs/' + obj.data.start_time + '.xlsx';
}
window.viewLog = function (obj) {
layer.open({
type: 2,
title: '编辑',
title: '日志',
shade: 0.1,
area: ['650px', '180px'],
content: './update.html?config_id=' + obj.data.config_id
area: ['800px', '680px'],
content: './viewLog.html?ts=' + obj.data.start_time
});
}
function GetQueryString(name, istop) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);

@ -0,0 +1,62 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Demo</title>
<!-- 请勿在项目正式环境中引用该 layui.css 地址 -->
<link href="//unpkg.com/layui@2.9.1/dist/css/layui.css" rel="stylesheet">
<style>
.flow-demo {
height: 400px;
overflow: auto;
font-size: 0;
}
.flow-demo li {
display: inline-block;
margin: 0 5px;
font-size: 14px;
width: 48%;
margin-bottom: 10px;
height: 100px;
line-height: 100px;
text-align: center;
background-color: #eee;
}
</style>
</head>
<body>
<div class="flow-demo" id="ID-flow-demo" style="width: 300px;height: 300px;"></div>
<!-- 请勿在项目正式环境中引用该 layui.js 地址 -->
<script src="//unpkg.com/layui@2.9.1/dist/layui.js"></script>
<script>
layui.use(function () {
var flow = layui.flow;
// 流加载实例
flow.load({
elem: '#ID-flow-demo', // 流加载容器
scrollElem: '#ID-flow-demo', // 滚动条所在元素,一般不用填,此处只是演示需要。
done: function (page, next) { // 执行下一页的回调
// 模拟数据插入
setTimeout(function () {
var lis = [];
for (var i = 0; i < 8; i++) {
lis.push('<li>' + ((page - 1) * 8 + i + 1) + '</li>')
}
// 执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
// pages 为 Ajax返回的总页数只有当前页小于总页数的情况下才会继续出现加载更多
next(lis.join(''), page < 10); // 10
}, 520);
}
});
});
</script>
</body>
</html>

@ -0,0 +1,71 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="../../../component/pear/css/pear.css" />
</head>
<body class="pear-container layui-form">
<pre class="layui-code code-demo" id="logs">
</pre>
<script src="../../../component/layui/layui.js"></script>
<script src="../../../component/pear/pear.js"></script>
<script>
layui.use(function () {
var $ = layui.jquery;
// code
var ts = GetQueryString('ts');
getTextFile('/QingLong/Logs/' + ts + '.log');
function getTextFile(url) {
let loading = layer.load();
fetch(url)
.then(response => {
if (!response.ok) {
layer.close(loading);
layer.msg('读取失败!', { icon: 2 });
} else {
return response.text();
}
})
.then(content => {
layer.close(loading);
layui.code({
elem: '.code-demo',
code: content
});
})
.catch(error => {
layer.close(loading);
layer.msg('读取失败!', { icon: 2 });
});
}
function GetQueryString(name, istop) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (typeof (istop) != "undefined") r = top.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
});
</script>
</body>
</html>
Loading…
Cancel
Save