406 lines
11 KiB
Vue
Executable File
406 lines
11 KiB
Vue
Executable File
<template>
|
|
<div>
|
|
<el-dialog
|
|
:title="'帖子审核'"
|
|
:visible.sync="dialogVisible"
|
|
width="850px"
|
|
border
|
|
:before-close="handleClose"
|
|
:close-on-click-modal="false"
|
|
top="1%"
|
|
>
|
|
<el-table :data="tableData" style="width: 100%;">
|
|
<el-table-column label="用户ID" align="center" width="110" fixed>
|
|
<template slot-scope="scope">
|
|
<span>{{scope.row.publisher.uid || '未知'}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="id" label="视频ID" align="center" width="220"></el-table-column>
|
|
<el-table-column
|
|
prop="userName"
|
|
label="用户昵称"
|
|
align="center"
|
|
width="140"
|
|
:show-overflow-tooltip="true"
|
|
>
|
|
<template slot-scope="scope">
|
|
<span>{{scope.row.publisher.name || '未知'}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="title"
|
|
label="视频标题"
|
|
align="center"
|
|
:show-overflow-tooltip="true"
|
|
width="250"
|
|
></el-table-column>
|
|
<el-table-column prop="isPay" label="是否付费" align="center" width="80">
|
|
<template slot-scope="scope">
|
|
<span>{{scope.row.coins > 0 ? '是' : '否'}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="coins" label="价格" align="center" width="80">
|
|
<template slot-scope="scope">
|
|
<el-input
|
|
v-model.number="scope.row.coins"
|
|
size="small"
|
|
class="param-input"
|
|
v-if="type === 'many'"
|
|
></el-input>
|
|
<span v-else>{{scope.row.coins}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<!-- <el-table-column prop="freeTime" label="免费时长" align="center" width="80" v-if="type === 'many'">
|
|
<template slot-scope="scope">
|
|
<el-input v-model="scope.row.freeTime" size="small" class="param-input"></el-input>
|
|
</template>
|
|
</el-table-column>-->
|
|
<el-table-column
|
|
prop="reason"
|
|
label="不通过理由"
|
|
align="center"
|
|
width="300"
|
|
v-if="type === 'many'"
|
|
>
|
|
<template slot-scope="scope">
|
|
<el-input
|
|
v-model="scope.row.reason"
|
|
size="small"
|
|
class="param-input"
|
|
type="textarea"
|
|
:row="10"
|
|
></el-input>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="tags" label="标签" align="center" min-width="200">
|
|
<template slot-scope="scope">
|
|
<el-tag
|
|
type="success"
|
|
size="mini"
|
|
effect="plain"
|
|
:closable="true"
|
|
@close="handleCloseTag(i,scope.row)"
|
|
class="tags"
|
|
v-for="(tag,i) in scope.row.tags"
|
|
:key="i"
|
|
>{{tag.name}}</el-tag>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button
|
|
:type=" (type === 'many') ? 'danger' : '' "
|
|
@click="changeStatus"
|
|
size="small"
|
|
>{{type === 'many' ? '不通过' : '取消'}}</el-button>
|
|
<el-button type="success" size="small" @click="examine(1)">通过</el-button>
|
|
<el-button
|
|
type="success"
|
|
size="small"
|
|
@click="examine(3)"
|
|
v-if="type === 'single'"
|
|
>通过并修改为免费视频</el-button>
|
|
<el-button type="danger" size="small" @click="passButton" v-if="type === 'single'">不通过</el-button>
|
|
</span>
|
|
<!-- <div class="not_pass" v-if="type === 'many'">
|
|
<table-List :isShow="isShow" :reasonTableData="reasonTableData" :reasonTotal="reasonTotal" :reasonLoading="reasonLoading" @handTextArea1="handTextArea1" :isFocus="isFocus"></table-List>
|
|
</div>-->
|
|
</el-dialog>
|
|
<!--审核不通过信息填写弹窗-->
|
|
<el-dialog
|
|
:title="'驳回原因'"
|
|
:visible.sync="dialogVisible1"
|
|
width="30%"
|
|
:before-close="handleClose1"
|
|
append-to-body
|
|
:close-on-click-modal="false"
|
|
>
|
|
<el-input
|
|
type="textarea"
|
|
placeholder="请输入审核不通过理由"
|
|
v-model="textarea"
|
|
maxlength="50"
|
|
show-word-limit
|
|
></el-input>
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="handleClose1" size="small">取 消</el-button>
|
|
<el-button type="success" size="small" @click="examineNo()">确定提交</el-button>
|
|
</span>
|
|
<div>
|
|
<!-- 审核不通过理由弹窗 -->
|
|
<p class="passTitle">驳回原因列表</p>
|
|
<table-List
|
|
:isShow="isShow"
|
|
:reasonTableData="reasonTableData"
|
|
:reasonTotal="reasonTotal"
|
|
:reasonLoading="reasonLoading"
|
|
:showType="showType"
|
|
@handTextArea="handTextArea"
|
|
></table-List>
|
|
</div>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
<script>
|
|
import API from "@/api";
|
|
import TableList from "./notPass-list";
|
|
export default {
|
|
data() {
|
|
return {
|
|
center: true,
|
|
dialogVisible: false,
|
|
dialogVisible1: false,
|
|
showType: "single",
|
|
index: "",
|
|
tableData: [],
|
|
idList: [],
|
|
isFocus: false,
|
|
isClickPl: false,
|
|
type: "", // 通过单条审核还是多条判断多条时不能点击审核不通过
|
|
textarea: "", // 不通过原由
|
|
isShow: false,
|
|
// 不通过理由列表
|
|
reasonTableData: [],
|
|
// 不通过理由列表总条数
|
|
reasonTotal: 0,
|
|
// 不通过理由加载
|
|
reasonLoading: false,
|
|
params: {
|
|
pageNumber: 1,
|
|
pageSize: 10
|
|
}
|
|
};
|
|
},
|
|
components: {
|
|
TableList
|
|
},
|
|
methods: {
|
|
open(data, type) {
|
|
// eslint-disable-next-line no-console
|
|
this.dialogVisible = true;
|
|
this.tableData = data;
|
|
if (type === "many") {
|
|
this.isClickPl = true;
|
|
this.queryFailList();
|
|
}
|
|
this.type = type;
|
|
this.textarea = "";
|
|
data.forEach(element => {
|
|
this.idList.push(element.vid);
|
|
});
|
|
},
|
|
//批量不通过
|
|
changeStatus() {
|
|
if (this.type === "many") {
|
|
// 不通过
|
|
let infos = [];
|
|
this.tableData.forEach(item => {
|
|
let params1 = {};
|
|
params1.id = item.id;
|
|
params1.reason = item.reason;
|
|
params1.coins = item.coins;
|
|
params1.freeTime = item.freeTime;
|
|
infos.push(params1);
|
|
});
|
|
let params2 = {
|
|
pass: 2,
|
|
infos: infos
|
|
};
|
|
this.batchReview(params2);
|
|
} else {
|
|
this.handleClose();
|
|
}
|
|
},
|
|
// 点击不通过按钮
|
|
passButton() {
|
|
this.dialogVisible1 = true;
|
|
this.queryFailList();
|
|
},
|
|
handleCloseTag(index,row){
|
|
let tags = row.tags;
|
|
tags.splice(index,1)
|
|
|
|
let id = row.id;
|
|
let params = {
|
|
id:id,
|
|
tags:tags.map(e=> e.name),
|
|
type:1
|
|
}
|
|
this.deleteTag(params);
|
|
},
|
|
// 提交tags
|
|
deleteTag(params) {
|
|
API.editVideoInfo(params).then(res => {
|
|
if (res.code === 200) {
|
|
this.$message({
|
|
message: '删除成功!',
|
|
type: 'success'
|
|
});
|
|
} else {
|
|
this.$message.error('删除失败!');
|
|
}
|
|
}).catch(() => {
|
|
this.$message.error('删除失败!');
|
|
})
|
|
},
|
|
// 获取不通过理由列表
|
|
queryFailList(type) {
|
|
if (type === "status") {
|
|
this.params.pageNumber = 1;
|
|
}
|
|
this.reasonLoading = true;
|
|
API.queryFailList(this.params)
|
|
.then(res => {
|
|
if (res.code === 200 && res.data.list) {
|
|
this.reasonTableData = res.data.list;
|
|
this.reasonTotal = res.data.total;
|
|
} else {
|
|
this.reasonTableData = [];
|
|
this.reasonTotal = 0;
|
|
}
|
|
this.reasonLoading = false;
|
|
})
|
|
.catch(() => {
|
|
this.reasonTableData = [];
|
|
this.reasonLoading = false;
|
|
});
|
|
},
|
|
// 关闭外层弹窗
|
|
handleClose() {
|
|
this.dialogVisible = false;
|
|
this.isShow = false;
|
|
(this.reasonTableData = []),
|
|
(this.reasonTotal = 0),
|
|
(this.reasonLoading = false),
|
|
(this.isClickPl = false);
|
|
// 关闭弹窗时清空视频审核界面理由
|
|
this.tableData.forEach(item => {
|
|
item.reason = "";
|
|
});
|
|
},
|
|
// 通过审核
|
|
examine(status) {
|
|
if (
|
|
this.type !== "many" &&
|
|
this.tableData[0].coins === 0 &&
|
|
status === 3
|
|
) {
|
|
this.$message.error("该视频已是免费视频!");
|
|
return;
|
|
}
|
|
let params = {
|
|
ids: [],
|
|
pass: status,
|
|
reason: "",
|
|
freeTime: ""
|
|
};
|
|
if (this.type === "many") {
|
|
delete params.reason;
|
|
delete params.ids;
|
|
let infos = [];
|
|
this.tableData.forEach(item => {
|
|
let params1 = {};
|
|
params1.id = item.id;
|
|
params1.reason = item.reason;
|
|
params1.coins = item.coins;
|
|
params1.freeTime = item.freeTime;
|
|
infos.push(params1);
|
|
});
|
|
params.infos = infos;
|
|
this.batchReview(params);
|
|
} else {
|
|
params.ids.push(this.tableData[0].id);
|
|
this.examineVideo(params);
|
|
}
|
|
},
|
|
// 审核不通过
|
|
examineNo() {
|
|
this.dialogVisible1 = true;
|
|
if (!this.textarea && this.type === "single") {
|
|
this.$message.error("请填写不通过理由");
|
|
return;
|
|
}
|
|
this.examineVideo({
|
|
ids: [this.tableData[0].id],
|
|
pass: 2,
|
|
reason: this.textarea
|
|
});
|
|
},
|
|
// 审核请求
|
|
examineVideo(params) {
|
|
API.examineVideo(params)
|
|
.then(res => {
|
|
if (res.code === 200) {
|
|
this.$message({
|
|
message: "操作成功!",
|
|
type: "success"
|
|
});
|
|
this.$emit("handlerExamine");
|
|
} else {
|
|
this.$message.error("操作失败!");
|
|
}
|
|
this.dialogVisible = false;
|
|
this.dialogVisible1 = false;
|
|
})
|
|
.catch(() => {
|
|
this.dialogVisible = false;
|
|
this.dialogVisible1 = false;
|
|
});
|
|
},
|
|
// 批量审核请求
|
|
batchReview(params) {
|
|
API.batchReview(params)
|
|
.then(res => {
|
|
if (res.code === 200) {
|
|
this.$message({
|
|
message: "操作成功!",
|
|
type: "success"
|
|
});
|
|
this.$emit("handlerExamine");
|
|
} else {
|
|
this.$message.error("操作失败!");
|
|
}
|
|
this.dialogVisible = false;
|
|
this.dialogVisible1 = false;
|
|
})
|
|
.catch(() => {
|
|
this.dialogVisible = false;
|
|
this.dialogVisible1 = false;
|
|
});
|
|
},
|
|
// 驳回信息弹出框
|
|
handleClose1() {
|
|
this.dialogVisible1 = false;
|
|
this.textarea = "";
|
|
},
|
|
handTextArea(text) {
|
|
this.textarea = text;
|
|
}
|
|
// handTextArea1(text) {
|
|
// this.tableData[this.index].reason = text
|
|
// },
|
|
// 输入框获得焦点时
|
|
// focus(index) {
|
|
// // eslint-disable-next-line no-console
|
|
// console.log(index);
|
|
// this.index = index;
|
|
// this.isFocus = true
|
|
// }
|
|
}
|
|
};
|
|
</script>
|
|
<style scoped>
|
|
.passTitle {
|
|
text-align: center;
|
|
font-size: 18px;
|
|
padding-top: 20px;
|
|
padding-bottom: 20px;
|
|
}
|
|
.not_pass {
|
|
position: absolute;
|
|
width: 300px;
|
|
top: 300px;
|
|
right: -350px;
|
|
}
|
|
</style>
|