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.
127 lines
4.5 KiB
127 lines
4.5 KiB
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title></title>
|
|
<link rel="stylesheet" href="../../component/pear/css/pear.css" />
|
|
</head>
|
|
|
|
<body class="pear-container">
|
|
|
|
<div class="layui-card">
|
|
<div class="layui-card-body">
|
|
<table id="task-table" lay-filter="task-table"></table>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/html" id="task-toolbar">
|
|
<button class="layui-btn" lay-event="add">
|
|
<i class="layui-icon layui-icon-download-circle"></i>
|
|
导出EXCEL
|
|
</button>
|
|
</script>
|
|
|
|
<script type="text/html" id="tableOperate">
|
|
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove" title="删除"><i class="layui-icon layui-icon-delete"></i>
|
|
</button>
|
|
</script>
|
|
|
|
<script src="../../component/layui/layui.js"></script>
|
|
<script src="../../component/pear/pear.js"></script>
|
|
|
|
<script>
|
|
layui.use(['table', 'form', 'jquery', 'common'], function () {
|
|
let table = layui.table;
|
|
let form = layui.form;
|
|
let $ = layui.jquery;
|
|
let common = layui.common;
|
|
|
|
let cols = [
|
|
[
|
|
{ field: 'num', title: '名次', align: 'center', width: "5%" }
|
|
, { field: 'person_name', title: '姓名', align: 'center' , width: "10%" }
|
|
, { field: 'ks', title: '处室', align: 'center' , width: "15%" }
|
|
, { field: 'tel', title: '办公电话', align: 'center', width: "15%" }
|
|
, { field: 'score', title: '得分', align: 'center', width: "5%" }
|
|
, { field: 'ys', title: '用时', align: 'center', width: "15%" }
|
|
, { field: 'start_time', title: '开始时间', align: 'center', width: "15%" }
|
|
, { field: 'end_time', title: '交卷时间', align: 'center', width: "15%" }
|
|
, { field: '', title: '操作', toolbar: '#tableOperate', align: 'center', width: "5%" }
|
|
]
|
|
]
|
|
|
|
tableRender()
|
|
|
|
function tableRender() {
|
|
table.render({
|
|
elem: '#task-table',
|
|
url: '/FengHuang/exam/getPageSummary',
|
|
page: {
|
|
limit: 10
|
|
, layout: ['count', 'prev', 'page', 'next', 'skip']
|
|
, prev: "上一页"
|
|
, next: "下一页"
|
|
},
|
|
cols: cols,
|
|
skin: 'line',
|
|
toolbar: '#task-toolbar',
|
|
defaultToolbar: []
|
|
});
|
|
}
|
|
|
|
|
|
table.on('toolbar(task-table)', function (data) {
|
|
if (data.event === 'add') {
|
|
window.location = "/FengHuang/exam/exportExcel";
|
|
}
|
|
});
|
|
|
|
table.on('tool(task-table)', function (data) {
|
|
if (data.event === 'remove') {
|
|
rankRemove(data.data.person_id);
|
|
}
|
|
});
|
|
|
|
|
|
window.rankRemove = function (personId) {
|
|
layer.confirm('确定要删除该条数据吗?', {
|
|
icon: 3,
|
|
title: '提示'
|
|
}, function (index) {
|
|
$.ajax({
|
|
url: "/FengHuang/exam/delPerson",
|
|
data: { "person_id": personId },
|
|
type: 'POST',
|
|
success: function (result) {
|
|
console.log(result)
|
|
if (result.success) {
|
|
layer.msg("删除成功!", {
|
|
icon: 1,
|
|
time: 1000
|
|
}, function () {
|
|
refresh();
|
|
});
|
|
} else {
|
|
layer.msg(result.msg, {
|
|
icon: 2,
|
|
time: 1000
|
|
});
|
|
}
|
|
}
|
|
})
|
|
});
|
|
}
|
|
|
|
window.refresh = function (param) {
|
|
table.reload('task-table');
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
</script>
|
|
</body>
|
|
|
|
</html> |