|
|
|
@ -7,78 +7,80 @@
|
|
|
|
|
<link rel="stylesheet" href="layui/css/layui.css">
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<div class="layui-container">
|
|
|
|
|
<div class="layui-row">
|
|
|
|
|
<div class="layui-col-md12">
|
|
|
|
|
<h2 class="layui-header">长春市教育信息资讯库维护</h2>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-container">
|
|
|
|
|
<div class="layui-row">
|
|
|
|
|
<div class="layui-col-md12">
|
|
|
|
|
<h2 class="layui-header">长春市教育信息资讯库维护</h2>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="layui-tab layui-tab-brief">
|
|
|
|
|
<ul class="layui-tab-title">
|
|
|
|
|
<li class="layui-this">信息来源</li>
|
|
|
|
|
<li>文章列表</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<div class="layui-tab-content">
|
|
|
|
|
<div class="layui-tab-item layui-show">
|
|
|
|
|
<table id="sourceTable" lay-filter="sourceTable"></table>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-tab-item">
|
|
|
|
|
<table id="articleTable" lay-filter="articleTable"></table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="layui-tab layui-tab-brief">
|
|
|
|
|
<ul class="layui-tab-title">
|
|
|
|
|
<li class="layui-this">文章列表</li>
|
|
|
|
|
<li>信息来源</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<div class="layui-tab-content">
|
|
|
|
|
<div class="layui-tab-item layui-show">
|
|
|
|
|
<table id="articleTable" lay-filter="articleTable"></table>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-tab-item">
|
|
|
|
|
<table id="sourceTable" lay-filter="sourceTable"></table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script src="layui/layui.js"></script>
|
|
|
|
|
<script>
|
|
|
|
|
layui.use(['table', 'element'], function () {
|
|
|
|
|
var table = layui.table;
|
|
|
|
|
var element = layui.element;
|
|
|
|
|
|
|
|
|
|
// 信息来源表格
|
|
|
|
|
table.render({
|
|
|
|
|
elem: '#sourceTable',
|
|
|
|
|
url: '/api/sources',
|
|
|
|
|
page: true,
|
|
|
|
|
parseData: function (res) { // 新增parseData函数处理返回数据
|
|
|
|
|
return {
|
|
|
|
|
"code": res.code,
|
|
|
|
|
"msg": res.msg,
|
|
|
|
|
"count": res.data.total,
|
|
|
|
|
"data": res.data.list
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
cols: [[
|
|
|
|
|
{field: 'id', title: '序号', width: 80},
|
|
|
|
|
{field: 'name', title: '账号名称'},
|
|
|
|
|
{field: 'type', title: '来源类型'},
|
|
|
|
|
{field: 'update_time', title: '更新时间'}
|
|
|
|
|
]]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
<script src="layui/layui.js"></script>
|
|
|
|
|
<script>
|
|
|
|
|
layui.use(['table', 'element'], function(){
|
|
|
|
|
var table = layui.table;
|
|
|
|
|
var element = layui.element;
|
|
|
|
|
|
|
|
|
|
// 信息来源表格
|
|
|
|
|
table.render({
|
|
|
|
|
elem: '#sourceTable',
|
|
|
|
|
url: '/api/sources',
|
|
|
|
|
page: true,
|
|
|
|
|
parseData: function(res) { // 新增parseData函数处理返回数据
|
|
|
|
|
return {
|
|
|
|
|
"code": res.code,
|
|
|
|
|
"msg": res.msg,
|
|
|
|
|
"count": res.data.total,
|
|
|
|
|
"data": res.data.list
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
cols: [[
|
|
|
|
|
{field: 'id', title: 'ID', width:80},
|
|
|
|
|
{field: 'name', title: '账号名称'},
|
|
|
|
|
{field: 'type', title: '来源类型'},
|
|
|
|
|
{field: 'update_time', title: '更新时间'}
|
|
|
|
|
]]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 文章列表表格
|
|
|
|
|
table.render({
|
|
|
|
|
elem: '#articleTable',
|
|
|
|
|
url: '/api/articles',
|
|
|
|
|
page: true,
|
|
|
|
|
parseData: function(res) {
|
|
|
|
|
return {
|
|
|
|
|
"code": res.code,
|
|
|
|
|
"msg": res.msg,
|
|
|
|
|
"count": res.data.total,
|
|
|
|
|
"data": res.data.list
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
cols: [[
|
|
|
|
|
{field: 'id', title: 'ID', width:80},
|
|
|
|
|
{field: 'title', title: '标题'},
|
|
|
|
|
{field: 'source', title: '来源'},
|
|
|
|
|
{field: 'publish_date', title: '发布日期'},
|
|
|
|
|
{field: 'collect_time', title: '采集时间'}
|
|
|
|
|
]]
|
|
|
|
|
});
|
|
|
|
|
// 文章列表表格
|
|
|
|
|
table.render({
|
|
|
|
|
elem: '#articleTable',
|
|
|
|
|
url: '/api/articles',
|
|
|
|
|
page: true,
|
|
|
|
|
parseData: function (res) {
|
|
|
|
|
return {
|
|
|
|
|
"code": res.code,
|
|
|
|
|
"msg": res.msg,
|
|
|
|
|
"count": res.data.total,
|
|
|
|
|
"data": res.data.list
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
cols: [[
|
|
|
|
|
{field: 'id', title: '序号', width: 80},
|
|
|
|
|
{field: 'title', title: '标题', templet: function(d){
|
|
|
|
|
return '<a href="' + d.url + '" target="_blank" style="color: #1E88E5; text-decoration: underline; cursor: pointer;">' + d.title + '</a>';
|
|
|
|
|
}},
|
|
|
|
|
{field: 'source', title: '来源', width: 150},
|
|
|
|
|
{field: 'publish_date', title: '发布日期', width: 120},
|
|
|
|
|
{field: 'collect_time', title: '采集时间', width: 150}
|
|
|
|
|
]]
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|