feat: 后台评论管理

This commit is contained in:
xiongxiaoyang 2023-04-14 22:34:36 +08:00
parent 5854536c70
commit 8ddc6cc434
4 changed files with 70 additions and 60 deletions

View File

@ -108,3 +108,14 @@ INSERT INTO `sys_menu` (menu_id, `parent_id`, `name`, `url`, `perms`, `type`, `i
VALUES (602, 601, '删除', null, 'novel:book:remove', '2', null, '6'); VALUES (602, 601, '删除', null, 'novel:book:remove', '2', null, '6');
INSERT INTO sys_role_menu (role_id, menu_id) INSERT INTO sys_role_menu (role_id, menu_id)
VALUES (1, 602); VALUES (1, 602);
INSERT
INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
VALUES (603, 600, '评论管理', 'novel/bookComment', 'novel:bookComment:bookComment', '1', 'fa', '10');
INSERT INTO sys_role_menu (role_id, menu_id)
VALUES (1, 603);
INSERT INTO `sys_menu` (menu_id, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
VALUES (604, 603, '删除', null, 'novel:bookComment:remove', '2', null, '6');
INSERT INTO sys_role_menu (role_id, menu_id)
VALUES (1, 604);

View File

@ -2937,3 +2937,14 @@ INSERT INTO `sys_menu` (menu_id, `parent_id`, `name`, `url`, `perms`, `type`, `i
VALUES (602, 601, '删除', null, 'novel:book:remove', '2', null, '6'); VALUES (602, 601, '删除', null, 'novel:book:remove', '2', null, '6');
INSERT INTO sys_role_menu (role_id, menu_id) INSERT INTO sys_role_menu (role_id, menu_id)
VALUES (1, 602); VALUES (1, 602);
INSERT
INTO `sys_menu`(`menu_id`, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
VALUES (603, 600, '评论管理', 'novel/bookComment', 'novel:bookComment:bookComment', '1', 'fa', '10');
INSERT INTO sys_role_menu (role_id, menu_id)
VALUES (1, 603);
INSERT INTO `sys_menu` (menu_id, `parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
VALUES (604, 603, '删除', null, 'novel:bookComment:remove', '2', null, '6');
INSERT INTO sys_role_menu (role_id, menu_id)
VALUES (1, 604);

View File

@ -59,49 +59,31 @@ function load() {
return arguments[2] + 1; return arguments[2] + 1;
} }
}, },
{
field: 'id', {
title: '主键' field: 'bookId',
}, title: '小说ID'
},
{
field: 'commentContent',
title: '评价内容'
},
{ {
field: 'bookId', field: 'createTime',
title: '小说ID' title: '评价时间'
}, },
{ {
field: 'commentContent', field: 'createUserId',
title: '评价内容' title: '评价人ID'
}, },
{ {
field: 'replyCount',
title: '回复数量'
},
{
field: 'auditStatus',
title: '审核状态0待审核1审核通过2审核不通过'
},
{
field: 'createTime',
title: '评价时间'
},
{
field: 'createUserId',
title: '评价人'
},
{
title: '操作', title: '操作',
field: 'id', field: 'id',
align: 'center', align: 'center',
@ -120,9 +102,11 @@ function load() {
}] }]
}); });
} }
function reLoad() { function reLoad() {
$('#exampleTable').bootstrapTable('refresh'); $('#exampleTable').bootstrapTable('refresh');
} }
function add() { function add() {
layer.open({ layer.open({
type: 2, type: 2,
@ -133,6 +117,7 @@ function add() {
content: prefix + '/add' // iframe的url content: prefix + '/add' // iframe的url
}); });
} }
function detail(id) { function detail(id) {
layer.open({ layer.open({
type: 2, type: 2,
@ -143,6 +128,7 @@ function detail(id) {
content: prefix + '/detail/' + id // iframe的url content: prefix + '/detail/' + id // iframe的url
}); });
} }
function edit(id) { function edit(id) {
layer.open({ layer.open({
type: 2, type: 2,
@ -153,6 +139,7 @@ function edit(id) {
content: prefix + '/edit/' + id // iframe的url content: prefix + '/edit/' + id // iframe的url
}); });
} }
function remove(id) { function remove(id) {
layer.confirm('确定要删除选中的记录', { layer.confirm('确定要删除选中的记录', {
btn: ['确定', '取消'] btn: ['确定', '取消']
@ -177,6 +164,7 @@ function remove(id) {
function resetPwd(id) { function resetPwd(id) {
} }
function batchRemove() { function batchRemove() {
var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行当没有选择的记录时返回一个空数组 var rows = $('#exampleTable').bootstrapTable('getSelections'); // 返回所有选择的行当没有选择的记录时返回一个空数组
if (rows.length == 0) { if (rows.length == 0) {

View File

@ -7,30 +7,30 @@
<div class="col-sm-12"> <div class="col-sm-12">
<div class="ibox"> <div class="ibox">
<div class="ibox-body"> <div class="ibox-body">
<div class="fixed-table-toolbar"> <!-- <div class="fixed-table-toolbar">
<div class="columns pull-left"> <div class="columns pull-left">
<button shiro:hasPermission="novel:bookComment:add" type="button" <button shiro:hasPermission="novel:bookComment:add" type="button"
class="btn btn-primary" onclick="add()"> class="btn btn-primary" onclick="add()">
<i class="fa fa-plus" aria-hidden="true"></i>添加 <i class="fa fa-plus" aria-hidden="true"></i>添加
</button> </button>
<button shiro:hasPermission="novel:bookComment:batchRemove" type="button" <button shiro:hasPermission="novel:bookComment:batchRemove" type="button"
class="btn btn-danger" class="btn btn-danger"
onclick="batchRemove()"> onclick="batchRemove()">
<i class="fa fa-trash" aria-hidden="true"></i>删除 <i class="fa fa-trash" aria-hidden="true"></i>删除
</button> </button>
</div> </div>
<div class="columns pull-right"> <div class="columns pull-right">
<button class="btn btn-success" onclick="reLoad()">查询</button> <button class="btn btn-success" onclick="reLoad()">查询</button>
</div> </div>
<form id="searchForm"> <form id="searchForm">
<div class="columns pull-right col-md-2"> <div class="columns pull-right col-md-2">
<input id="id" name="id" type="text" class="form-control" <input id="id" name="id" type="text" class="form-control"
placeholder="主键"> placeholder="主键">
</div> </div>
</form> </form>
</div> </div>-->
<table id="exampleTable" data-mobile-responsive="true"> <table id="exampleTable" data-mobile-responsive="true">
</table> </table>
</div> </div>