网络文章评价功能

Lvtianfang
许宏杰 2 years ago
parent de27609baf
commit ba1a4e799e

@ -132,7 +132,7 @@
label="操作" label="操作"
align="center" align="center"
class-name="small-padding fixed-width" class-name="small-padding fixed-width"
width="200" width="260"
fixed="right" fixed="right"
> >
<template slot-scope="scope"> <template slot-scope="scope">
@ -153,6 +153,7 @@
<el-button <el-button
type="success" type="success"
size="mini" size="mini"
v-show="scope.row.status == 2"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['zongzhi:article:edit']" v-hasPermi="['zongzhi:article:edit']"
>修改</el-button >修改</el-button
@ -288,6 +289,24 @@
<dict-tag :options="dict.type.tc_pj_status" :value="form.status" /> <dict-tag :options="dict.type.tc_pj_status" :value="form.status" />
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<div style="margin-top: 15px"></div>
<el-descriptions
v-if="form.status == 1"
title="评价详情"
:column="2"
border
labelClassName="desLable"
>
<el-descriptions-item label="评价人">{{
formPj.appraiserName
}}</el-descriptions-item>
<el-descriptions-item label="评价时间">{{
formPj.createTime
}}</el-descriptions-item>
<el-descriptions-item label="评价内容" :span="2">{{
formPj.pjContent
}}</el-descriptions-item>
</el-descriptions>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
@ -331,6 +350,11 @@ import {
updateArticle, updateArticle,
exportArticle, exportArticle,
} from "@/api/zongzhi/netZoology/netArticle/index.js"; } from "@/api/zongzhi/netZoology/netArticle/index.js";
import {
addEvaluate,
delEvaluate,
listEvaluate,
} from "@/api/zongzhi/netZoology/netP/index.js";
export default { export default {
computed: { computed: {
...mapGetters(["townList", "name", "userId"]), ...mapGetters(["townList", "name", "userId"]),
@ -381,6 +405,7 @@ export default {
// //
rules: {}, rules: {},
formPj: {}, formPj: {},
currentData: {},
}; };
}, },
created() { created() {
@ -397,6 +422,7 @@ export default {
methods: { methods: {
/**评价 */ /**评价 */
handPj(row) { handPj(row) {
this.currentData = row;
this.formPj = { this.formPj = {
appraiserId: this.userId, appraiserId: this.userId,
appraiserName: this.name, appraiserName: this.name,
@ -409,12 +435,20 @@ export default {
articleUrl: row.url, articleUrl: row.url,
pjContent: "", pjContent: "",
}; };
console.log(this.formPj);
this.pjShow = true; this.pjShow = true;
}, },
submitFormPj() { submitFormPj() {
this.$refs["formPj"].validate((valid) => { this.$refs["formPj"].validate((valid) => {
if (valid) { if (valid) {
addEvaluate(this.formPj).then((res) => {
this.currentData.status = 1;
updateArticle(this.currentData).then((response) => {
this.$modal.msgSuccess("评价成功");
this.pjShow = false;
this.currentData = {};
this.getList();
});
});
} }
}); });
}, },
@ -439,6 +473,7 @@ export default {
}, },
// //
reset() { reset() {
this.formPj = {};
this.form = { this.form = {
id: null, id: null,
@ -493,8 +528,17 @@ export default {
const id = row.id || this.ids; const id = row.id || this.ids;
getArticle(id).then((response) => { getArticle(id).then((response) => {
this.form = response.data; this.form = response.data;
this.infoOpen = true; if (row.status == 1) {
this.infoTitle = "查看网络文章详情"; //
listEvaluate({ articleId: id }).then((res) => {
this.formPj = res.rows[0];
this.infoOpen = true;
this.infoTitle = "查看网络文章详情";
});
} else {
this.infoOpen = true;
this.infoTitle = "查看网络文章详情";
}
}); });
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */

Loading…
Cancel
Save