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.

122 lines
4.4 KiB

3 months ago
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="../../component/pear/css/pear.css" />
<style>
.woo-templet-url {
display: inline-block;
background: rgba(0, 0, 0, 0.3);
border-radius: 6px;
height: 20px;
line-height: 21px;
padding: 0 5px;
color: #fff;
max-width: 100%;
overflow: hidden;
margin-top: 5px;
}
.layui-card-body .layui-form {
margin-top: 0 !important;
}
</style>
</head>
<body class="pear-container">
<div class="layui-card">
<div class="layui-card-body">
<table id="dataTable"></table>
<script type="text/html" id="lessonNameTpl">
<span style="color: #1e9fff;font-weight: bold;cursor: pointer;" onclick="openImg('{{=d.lesson_id}}')">{{=d.lesson_name}}</span>
</script>
</div>
</div>
<script type="text/html" id="user-bar">
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="match" title="匹配"><i class="layui-icon layui-icon-app"></i></button>
</script>
<script src="../../component/layui/layui.js"></script>
<script src="../../component/pear/pear.js"></script>
<script src="../../component/pear/base64.js"></script>
<script>
layui.use(function () {
var table = layui.table;
var form = layui.form;
var $ = layui.jquery;
var layer = layui.layer;
table.render({
elem: '#dataTable',
3 months ago
url: '/dsBase/yx/matchLessonSchoolName',
3 months ago
height: 'full-45',
request: {
pageName: 'pageNum', // 页码的参数名称默认page
limitName: 'pageSize' // 每页数据条数的参数名默认limit
},
page: {
limit: 20
, layout: ['count', 'prev', 'page', 'next', 'skip']
, prev: "上一页"
, next: "下一页"
},
cols: [[
{ title: '序号', field: 'username', align: 'center', width: "5%", type: 'numbers', },
{ title: '课程名称', templet: '#lessonNameTpl', align: 'left' },
{ title: '学段', field: 'stage_name', align: 'left', width: "10%" },
{ title: '学科', field: 'subject_name', align: 'left', width: "10%" },
{ title: '册', field: 'book_name', align: 'left', width: "10%" },
// { title: '原学校名称', field: 'original_school_name', width: "20%", align: 'left' },
{ title: '操作', toolbar: '#user-bar', align: 'center', width: "10%" }
]],
skin: 'line',
defaultToolbar: [{
title: '刷新',
layEvent: 'refresh',
icon: 'layui-icon-refresh',
}, 'filter', 'print', 'exports']
});
table.on('tool(dataTable)', function (obj) {
if (obj.event === 'match') {
layer.open({
type: 2,
title: '匹配学校名称',
shade: 0.1,
area: ['650px', '450px'],
content: './update_lesson.html?lesson_name=' + Base64.encode(obj.data.lesson_name) + '&lesson_id=' + obj.data.lesson_id
});
}
});
window.openImg = function (lesson_id) {
layer.photos({
photos: {
"title": "Photos Demo",
"start": 0,
"data": [
{
3 months ago
"src": "http://10.10.21.19:9000/dsBase/yx/getLessonCover?lessonId=" + lesson_id,
3 months ago
}
]
},
footer: false // 是否显示底部栏 --- 2.8.16+
});
}
window.refresh = function (param) {
table.reload('dataTable');
}
})
</script>
</body>
</html>