feat(评论举报): 评论举报功能

dev
zjb 7 months ago
parent e4bad6aa88
commit afd3cf8bff

@ -18,8 +18,8 @@ module.exports = {
proxyTable: {
"/": {
// target: 'http://39.103.180.196:9011', // 接口域名
target: "http://localhost:9011", // 接口域名
// target: "http://testapi.indie.cn:9012", // 接口域名
// target: "http://localhost:9011", // 接口域名
target: "http://testapi.indie.cn:9012", // 接口域名
changeOrigin: true, //是否跨域
pathRewrite: {
"^/": "/" //需要rewrite重写的,

@ -23,5 +23,23 @@ export default {
url: `/luoo-comment/commentCms/${id}`,
method: "delete"
});
},
getReportList(page, size) {
return request({
url: `/luoo-comment/commentCms/complaint/${page}/${size}`,
method: "get"
});
},
getReportById(id) {
return request({
url: `/luoo-comment/commentCms/complaint/${id}`,
method: "get"
});
},
reportHandel(id, flag) {
return request({
url: `/luoo-comment/commentCms/complaintHandle/${id}/${flag}`,
method: "post"
});
}
};

@ -2,8 +2,8 @@
* @Author: zhangjiabao
* @Date: 2024-02-01 22:15:37
* @LastEditors: zhangjiabao
* @LastEditTime: 2024-02-06 13:52:55
* @FilePath: /luoo_manage_fe/src/views/comment/commentReport.vue
* @LastEditTime: 2024-02-21 00:06:38
* @FilePath: \luoo_manage_fe\src\views\comment\commentReport.vue
-->
<template>
<div class="app-container">
@ -16,12 +16,14 @@
<el-input
placeholder="评论内容"
size="medium"
disabled
v-model="queryForm.data.qf_d_content"
></el-input>
</el-form-item>
<el-form-item>
<!-- :disabled="queryForm.typeLoading" -->
<el-select
:disabled="queryForm.typeLoading"
disabled
placeholder="举报类型"
size="medium"
v-model="queryForm.data.qf_d_type"
@ -39,6 +41,7 @@
v-model="queryForm.data.qf_d_user"
filterable
remote
disabled
reserve-keyword
placeholder="请选择用户"
:loading="queryForm.userLoading"
@ -58,6 +61,7 @@
placeholder="评论时间"
v-model="queryForm.data.qf_d_time"
type="daterange"
disabled
:range-separator="
queryForm.data.qf_d_time.length === 0 ? null : '~'
"
@ -111,25 +115,29 @@
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="index" label="编号"></el-table-column>
<el-table-column label="举报类型"></el-table-column>
<el-table-column label="举报人"></el-table-column>
<el-table-column label="举报时间"></el-table-column>
<el-table-column prop="commentId" label="编号"></el-table-column>
<el-table-column prop="type" label="举报类型"></el-table-column>
<el-table-column prop="complaintFrom" label="举报人"></el-table-column>
<el-table-column
prop="complaintTime"
label="举报时间"
></el-table-column>
<el-table-column label="举报关联">
<template slot-scope="scope">
<el-button
type="text"
size="mini"
v-if="scope.row.journalId"
@click="jumpToJournal(scope.row.journalId)"
>{{ scope.row.journalId }}</el-button
>
</template>
</el-table-column>
<el-table-column label="举报对象"></el-table-column>
<el-table-column label="举报状态"></el-table-column>
<el-table-column label="处理结果"></el-table-column>
<el-table-column label="处理人"></el-table-column>
<el-table-column label="处理时间"></el-table-column>
<el-table-column prop="complaintTo" label="举报对象"></el-table-column>
<el-table-column prop="state" label="举报状态"></el-table-column>
<el-table-column prop="handleResult" label="处理结果"></el-table-column>
<el-table-column prop="handleBy" label="处理人"></el-table-column>
<el-table-column prop="handleTime" label="处理时间"></el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button
@ -137,7 +145,7 @@
icon="el-icon-video-play"
type="primary"
size="mini"
@click="handleDetailClick"
@click="handleDetailClick(scope.row)"
>详情</el-button
>
<el-button
@ -145,7 +153,7 @@
icon="el-icon-s-tools"
type="primary"
size="mini"
@click="handleReportHandleClick"
@click="handleReportHandleClick(scope.row)"
>处理</el-button
>
</template>
@ -234,31 +242,20 @@ export default {
methods: {
fetchData() {
this.table.loading = true;
// commentApi
// .getList(this.table.page.current, this.table.page.size)
// .then(res => {
// if (res.code === 200) {
// this.table.data = res.data.rows;
// this.table.page.total = res.data.total;
// this.table.loading = false;
// } else {
// this.$message.error(res.message);
// this.table.data = [];
// this.table.page.total = 0;
// this.table.loading = false;
// }
// });
setTimeout(() => {
this.table.data = [];
for (let index = 0; index < 10; index++) {
this.table.data.push({
id: index,
index: index
});
}
this.table.loading = false;
this.table.page.total = 11;
}, 1000);
commentApi
.getReportList(this.table.page.current, this.table.page.size)
.then(res => {
if (res.code === 200) {
this.table.data = res.data.rows;
this.table.page.total = res.data.total;
this.table.loading = false;
} else {
this.$message.error(res.message);
this.table.data = [];
this.table.page.total = 0;
this.table.loading = false;
}
});
},
fetchTypeData() {
this.queryForm.typeLoading = true;
@ -345,9 +342,8 @@ export default {
* 详情操作
*/
handleDetailClick(row) {
this.$message.success("detail" + row.id);
this.$router.push(
`/contentManage/commentReportDetail?type=0&id=${row.id}`
`/contentManage/commentReportDetail?type=0&id=${row._id}`
);
// commentApi.delete(row._id).then(res => {
// if (res.code === 200) {
@ -362,9 +358,8 @@ export default {
* 举报处理
*/
handleReportHandleClick(row) {
this.$message.success("handle" + row.id);
this.$router.push(
`/contentManage/commentReportDetail?type=1&id=${row.id}`
`/contentManage/commentReportDetail?type=1&id=${row._id}`
);
},
handleTypeManageClick() {

@ -2,8 +2,8 @@
* @Author: zhangjiabao
* @Date: 2024-02-06 09:41:22
* @LastEditors: zhangjiabao
* @LastEditTime: 2024-02-07 00:31:46
* @FilePath: /luoo_manage_fe/src/views/comment/commentReportDetail.vue
* @LastEditTime: 2024-02-21 00:16:28
* @FilePath: \luoo_manage_fe\src\views\comment\commentReportDetail.vue
-->
<template>
<div class="app-container">
@ -26,49 +26,49 @@
<template slot="label">
编号
</template>
{{ data.d_index }}
{{ data.commentId }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
举报类型
</template>
{{ data.d_type }}
{{ data.type }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
举报人
</template>
{{ data.d_report_user }}
{{ data.complaintFrom }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
举报时间
</template>
{{ data.d_report_time }}
{{ data.complaintTime }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
举报对象
</template>
{{ data.d_report_be_user }}
{{ data.complaintTo }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
举报状态
</template>
{{ data.d_report_status }}
{{ data.state }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
举报内容
</template>
{{ data.d_report_content }}
{{ data.commentContent }}
</el-descriptions-item>
</el-descriptions>
<el-descriptions
@ -143,6 +143,8 @@
</template>
<script>
import commentApi from "@/api/comment";
export default {
name: "CommentReportDetail",
components: {},
@ -152,7 +154,21 @@ export default {
type: 0,
id: null,
loading: false,
data: {},
data: {
_id: null,
commentId: null,
commentContent: null,
type: null,
complaintFrom: null,
complaintTime: null,
journalId: null,
journalTitle: null,
complaintTo: null,
state: null,
handleResult: null,
handleBy: null,
handleTime: null
},
handelDialog: {
visible: false,
data: {
@ -175,25 +191,52 @@ export default {
methods: {
fetchData() {
this.loading = true;
setTimeout(() => {
this.data = {
d_index: this.id,
d_type: "恶意评论",
d_report_user: "左岸以西",
d_report_time: "2023-03-22 11:05",
d_report_be_user: "mask",
d_report_status: "未处理",
d_report_content: "###",
d_hanedl_remark: "333333"
};
if (!this.id || this.id === "undefined") {
this.loading = false;
}, 1000);
return;
}
commentApi.getReportById(this.id).then(res => {
if (res.code === 200) {
this.data = res.data;
this.loading = false;
} else {
this.$message.error(res.message);
this.data = {
_id: null,
commentId: null,
commentContent: null,
type: null,
complaintFrom: null,
complaintTime: null,
journalId: null,
journalTitle: null,
complaintTo: null,
state: null,
handleResult: null,
handleBy: null,
handleTime: null
};
this.loading = false;
}
});
},
handelReportYes() {
this.handelDialog.visible = true;
// this.handelDialog.visible = true;
commentApi.reportHandel(this.data._id, 1).then(res => {
if (res.code === 200) {
this.$message.success(res.message);
this.fetchData();
}
});
},
handelReportNo() {
this.fetchData();
commentApi.reportHandel(this.data._id, 2).then(res => {
if (res.code === 200) {
this.$message.success(res.message);
this.fetchData();
}
});
},
jumpToCommentReport() {
this.$router.push(`/contentManage/commentReport`);

Loading…
Cancel
Save