基本功能完成
This commit is contained in:
@@ -122,7 +122,7 @@
|
||||
<div class="layui-form-item" pane>
|
||||
<label class="layui-form-label">是否有效</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="isValid" name="open" lay-filter="required" class="layui-input" >
|
||||
<input type="text" id="isValid" placeholder="1 为有效/0为无效" name="open" lay-filter="required" class="layui-input" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
@@ -177,7 +177,7 @@
|
||||
<div class="layui-form-item" pane>
|
||||
<label class="layui-form-label">是否有效</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="isValid" name="open" lay-filter="required" class="layui-input" >
|
||||
<input type="text" id="isValid" placeholder="1 为有效/0为无效" name="open" lay-filter="required" class="layui-input" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
@@ -252,6 +252,7 @@
|
||||
layer.msg('开启成功'), {
|
||||
offset: '6px'
|
||||
}
|
||||
window.location.reload();
|
||||
})
|
||||
}
|
||||
|
||||
@@ -269,7 +270,9 @@
|
||||
layer.msg('关闭成功'), {
|
||||
offset: '6px'
|
||||
}
|
||||
window.location.reload();
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function upAdateAdmin(){
|
||||
|
@@ -17,6 +17,23 @@
|
||||
<script src="//unpkg.com/layui@2.8.0/dist/layui.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
<%-- <button class="layui-btn layui-btn-sm" lay-event="addAdmin">添加管理员</button>--%>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-clear-space">
|
||||
<%-- <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>--%>
|
||||
<a class="layui-btn layui-btn-xs" lay-event="more">
|
||||
更多
|
||||
<i class="layui-icon layui-icon-down"></i>
|
||||
</a>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
||||
<table class="layui-hide" id="ID-table-demo-data"></table>
|
||||
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
||||
<script>
|
||||
@@ -39,6 +56,7 @@
|
||||
// 已知数据渲染
|
||||
var inst = table.render({
|
||||
elem: '#ID-table-demo-data'
|
||||
,toolbar: '#toolbarDemo'
|
||||
,cols: [[ //标题栏
|
||||
{field: 'userId', title: 'ID', width: 80, sort: true}
|
||||
,{field: 'nickName', title: '昵称', width: 130}
|
||||
@@ -48,9 +66,53 @@
|
||||
{field:'dateTime', title: '评论时间', width:130, },
|
||||
{field:'replyContent', title: '回复内容', width:200, },
|
||||
{field:'replyDateTime', title: '回复时间', width:130, },
|
||||
{fixed: 'right', title:'操作', width: 134, minWidth: 125, toolbar: '#barDemo'}
|
||||
// {fixed: 'right', title:'操作', width: 134, minWidth: 125, toolbar: '#barDemo'}
|
||||
|
||||
]]
|
||||
]],done:function (){
|
||||
// 触发单元格工具事件
|
||||
table.on('tool(ID-table-demo-data)', function(obj){ // 双击 toolDouble
|
||||
var data = obj.data; // 获得当前行数据
|
||||
// console.log(obj)
|
||||
if(obj.event === 'more'){
|
||||
// 更多 - 下拉菜单
|
||||
dropdown.render({
|
||||
elem: this, // 触发事件的 DOM 对象
|
||||
show: true, // 外部事件触发即显示
|
||||
data: [{
|
||||
title: '查看',
|
||||
id: 'detail'
|
||||
},{
|
||||
title: '删除',
|
||||
id: 'del'
|
||||
}],
|
||||
click: function(menudata){
|
||||
if(menudata.id === 'detail'){
|
||||
layer.msg('ID:'+ data.userId
|
||||
+'\n昵称:'+data.nickName
|
||||
+"\nQ Q:"+data.qQ
|
||||
+"\nEmail:"+data.email
|
||||
+"\n评论内容:"+data.content
|
||||
+"\n评论时间:"+data.dateTime
|
||||
+"\n回复内容:"+data.replyContent
|
||||
+"\n回复时间:"+data.replyDateTime
|
||||
);
|
||||
} else if(menudata.id === 'del'){
|
||||
layer.confirm('真的删除行 [id: '+ data.userId +'] 么', function(){
|
||||
obj.del(); // 删除对应行(tr)的DOM结构
|
||||
// layer.close(index);
|
||||
// deleteAdmin(data.adminId);
|
||||
deleteUser(data.userId);
|
||||
// 向服务端发送删除指令
|
||||
});
|
||||
}
|
||||
},
|
||||
align: 'right', // 右对齐弹出
|
||||
style: 'box-shadow: 1px 1px 10px rgb(0 0 0 / 12%);' // 设置额外样式
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
,data: result.data
|
||||
//,skin: 'line' // 表格风格
|
||||
//,even: true
|
||||
@@ -66,6 +128,22 @@
|
||||
})
|
||||
}
|
||||
getDate();
|
||||
function deleteUser(id){
|
||||
axios({
|
||||
// 请求方式
|
||||
method: 'get',
|
||||
// 请求的地址
|
||||
url: 'http://localhost:8080${pageContext.request.contextPath}/deleteUser',
|
||||
// URL 中的查询参数
|
||||
params: {
|
||||
id:id,
|
||||
}
|
||||
}).then(function (result) {
|
||||
layer.msg('删除成功!'), {
|
||||
offset: '6px'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
@@ -59,7 +59,7 @@
|
||||
|
||||
<div class="main">
|
||||
<div class="header">
|
||||
<div style="display: flex;flex-direction: row;flex-wrap: nowrap;align-items: center;">
|
||||
<div style="display: flex;position: fixed;flex-direction: row;flex-wrap: nowrap;align-items: center;z-index: 99999;background-color: white">
|
||||
<div style="width: 570px;height: 45px;">
|
||||
<span style="font-size: 2rem;font-weight: 700;font-family: FZShuTi;color:coral;">留 言 本</span>
|
||||
</div>
|
||||
@@ -90,7 +90,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<blockquote class="layui-elem-quote layui-text">
|
||||
<blockquote style="margin-top: 6%" class="layui-elem-quote layui-text">
|
||||
留言列表
|
||||
</blockquote>
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
<div class="show">
|
||||
<div class="show-content">
|
||||
<div class="show-name">
|
||||
<div class="avtors"><img src="./static/img/touxiang.png" alt=""
|
||||
<div class="avtors"><img src="./static/img/头像修改.png" alt=""
|
||||
style="width: 40px;height: 40px;border-radius: 50%;"></div>
|
||||
<span style="margin-left: 10px;font-size: 1rem;">${list.nickName}</span>
|
||||
</div>
|
||||
@@ -350,8 +350,10 @@
|
||||
}
|
||||
}).then(function (result) {
|
||||
//定位 span id 名称 error 修改
|
||||
console.log(result);
|
||||
// console.log(result);
|
||||
window.location.reload();
|
||||
})
|
||||
|
||||
}
|
||||
// 回复
|
||||
function reply(userId){
|
||||
@@ -368,8 +370,10 @@
|
||||
}
|
||||
}).then(function (result) {
|
||||
//定位 span id 名称 error 修改
|
||||
console.log(result);
|
||||
// console.log(result);
|
||||
window.location.reload();
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
$(function () {
|
||||
|
Reference in New Issue
Block a user