75 lines
2.4 KiB
Plaintext
75 lines
2.4 KiB
Plaintext
<%--
|
|
Created by IntelliJ IDEA.
|
|
User: LDQ
|
|
Date: 2023/6/9
|
|
Time: 16:57
|
|
To change this template use File | Settings | File Templates.
|
|
--%>
|
|
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
|
<html>
|
|
<head>
|
|
<title>Title</title>
|
|
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
|
|
<!-- 引入 layui.css -->
|
|
<link href="//unpkg.com/layui@2.8.0/dist/css/layui.css" rel="stylesheet">
|
|
|
|
<!-- 引入 layui.js -->
|
|
<script src="//unpkg.com/layui@2.8.0/dist/layui.js"></script>
|
|
</head>
|
|
<body>
|
|
<table class="layui-hide" id="ID-table-demo-data"></table>
|
|
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
|
<script>
|
|
function getDate(){
|
|
axios({
|
|
// 请求方式
|
|
method: 'get',
|
|
// 请求的地址
|
|
url: 'http://localhost:8080${pageContext.request.contextPath}/listManage',
|
|
// URL 中的查询参数
|
|
params: {
|
|
|
|
}
|
|
}).then(function (result) {
|
|
console.log(result);
|
|
layui.use('table', function(){
|
|
var table = layui.table;
|
|
var form = layui.form;
|
|
var dropdown = layui.dropdown;
|
|
// 已知数据渲染
|
|
var inst = table.render({
|
|
elem: '#ID-table-demo-data'
|
|
,cols: [[ //标题栏
|
|
{field: 'userId', title: 'ID', width: 80, sort: true}
|
|
,{field: 'nickName', title: '昵称', width: 130}
|
|
,{field: 'qQ', title: 'QQ', width: 130}
|
|
,{field: 'email', title: '邮箱', width: 180},
|
|
{field:'content', title: '评论内容', width:250, },
|
|
{field:'dateTime', title: '评论时间', width:130, },
|
|
{field:'replyContent', title: '回复内容', width:200, },
|
|
{field:'replyDateTime', title: '回复时间', width:130, },
|
|
// {fixed: 'right', title:'操作', width: 134, minWidth: 125, toolbar: '#barDemo'}
|
|
|
|
]]
|
|
,data: result.data
|
|
//,skin: 'line' // 表格风格
|
|
//,even: true
|
|
,page: true // 是否显示分页
|
|
,limits: [5, 10, 15]
|
|
,limit: 5 // 每页默认显示的数量
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
})
|
|
}
|
|
getDate();
|
|
|
|
</script>
|
|
|
|
|
|
</body>
|
|
</html>
|